Skip to main content Switch to mobile version gupt-mcp 0.1.0 Gupt (गुप्त): a privacy firewall for AI. MCP server + CLI that detects, redacts and restores PII, PHI and secrets: 125+ entity types, India-first, zero dependencies beyond MCP.
pip install gupt-mcp==0.1.0 Copy PIP instructions
A privacy firewall for AI. Gupt is an MCP server and CLI that finds personal data (PII), health data (PHI) and secrets, replaces them before they reach a language model, and puts the real values back afterwards. It runs entirely on your machine and makes zero network calls.
"Patient: Rahul Verma, Aadhaar 2341 2341 2346, PAN ABCPE1234F, +91 98765 43210, rahul@okaxis" placeholder → Patient: <
Most redaction MCP servers return the token map (the real values) as the tool result. In MCP the caller is the model, so that hands the model exactly what you meant to hide. Gupt is designed around that problem:
pip install gupt-mcp # or: uvx gupt-mcp Only dependency: the official MCP SDK. Optional statistical NER for free-text names and places:
pip install "gupt-mcp[ner]" && python -m spacy download en_core_web_sm # then set GUPT_ENGINE=auto (or ner) For better name/place accuracy (especially Indian names) use the larger model: python -m spacy download en_core_web_lg and set GUPT_SPACY_MODEL=en_core_web_lg.
Connect it to your AI client
claude mcp add gupt -e GUPT_ALLOWED_DIRS="$PWD" -- uvx gupt-mcp Claude Desktop / Cursor / Windsurf / VS Code (mcpServers block):
{ "mcpServers": { "gupt": { "command": "uvx", "args": ["gupt-mcp"], "env": { "GUPT_ALLOWED_DIRS": "/path/to/your/data" } } } } More ready-to-paste configs in examples/.
Also exposes resources gupt://entities, gupt://policies and two prompts: safe_file_workflow and privacy_audit.
The zero-exposure workflow
Ask your assistant to "summarise complaints in tickets.csv and draft replies to replies.csv" with Gupt connected:
The model calls redact_file("tickets.csv"). Gupt reads it locally and returns only <
The model writes replies using the tokens.
The model calls restore_file(session_id, text=…, output_path="replies.csv"). Real names and numbers are filled in on disk.
The model completed the task without ever seeing a single real identifier.
For agent pipelines (send text to an external API, a translation service, another agent), use redact → forward redacted_text → restore with the same session_id.
Per-type overrides: "entity_modes": {"CREDIT_CARD": "mask"}.
all (default) · pii · hipaa / phi (18 Safe-Harbor identifiers) · gdpr · dpdp (India DPDP Act 2023) · pci · financial · secrets · india · government_ids · contact
Combine and subtract: policy="dpdp,secrets", policy="all,-URL,-IP_ADDRESS".
What it detects (125+ types)
Every identifier that has a check digit is validated, so look-alikes are discarded instead of redacted. Format-less identifiers are context-anchored (they need a nearby word like "passport" or "NHS"). Known false-positive contexts (e.g. "order id", "invoice", "txn") veto a match.
India: Aadhaar (Verhoeff), Aadhaar VID, PAN, GSTIN (mod-36), UPI ID (80+ PSP handles), mobile (+91 / 10-digit), passport, voter ID (EPIC), driving licence, vehicle registration (incl. BH series), UAN, ration card, IFSC, ABHA number & address. Hindi context words (आधार, मोबाइल, जन्म तिथि…).
Healthcare: NPI, DEA, MRN / UHID / IP-OP numbers, Medicare MBI & HICN, CLIA, health-plan member IDs, medical licence, ICD-10 codes, admission/discharge dates, NHS number, Australian Medicare, ABHA.
Personal & contact: names (honorifics like Dr./Mr./Shri/Smt., labelled fields, JSON/CSV keys, or NER), street addresses (US/UK/India), postal codes, DOB, ages over 89, GPS coordinates, usernames, email, phone (NANP + international), URL, IPv4/IPv6, MAC.
Financial & crypto: cards (Luhn), IBAN (mod-97), SWIFT/BIC, bank accounts, ABA routing, Bitcoin (Base58Check/bech32 verified), Ethereum.
Government IDs, 35+ countries: US (SSN, ITIN, EIN, passport, DL), Canada SIN, Brazil CPF/CNPJ, Mexico CURP/RFC, UK NINO, Spain DNI/NIE, Italy codice fiscale, France NIR, Germany Steuer-ID, Netherlands BSN, Poland PESEL, Sweden personnummer, Finland HETU, Portugal NIF, Belgium NRN, Ireland PPSN, Turkey TCKN, Australia TFN/ABN, NZ IRD, Singapore NRIC, Hong Kong ID, China resident ID, Japan My Number, Korea RRN, Thailand, Malaysia, Indonesia, Philippines, Pakistan CNIC, Bangladesh, Sri Lanka, Nepal, Israel, UAE Emirates ID, Saudi ID, South Africa, Nigeria NIN/BVN, Kenya.
Devices & vehicles: VIN (check digit), IMEI, device / implant serials.
Secrets: AWS, GitHub, GitLab, OpenAI, Anthropic, Google, Hugging Face, Groq/Replicate/Perplexity/xAI, Stripe, Razorpay, Slack, Discord & Slack webhooks, Telegram, Twilio, SendGrid, npm, PyPI, Shopify, DigitalOcean, Azure storage, JWTs, PEM private keys, passwords in connection strings, password=/api_key= assignments (placeholders like ${VAR} ignored).
Run gupt entities (or gupt entities --region IN) for the full list.
gupt redact notes.txt -o notes.safe.txt --map notes.map.json # token map stays on your disk gupt restore llm_reply.txt --map notes.map.json cat data.json | gupt redact --json --mode synthetic gupt scan src/ config/ --policy secrets --fail # exit 1 if anything leaks gupt scan . --format json > privacy-report.json gupt serve --http --port 8765 # streamable HTTP transport Block leaks in CI / pre-commit
# .pre-commit-config.yaml repos: - repo: https://github.com/parthagni22/gupt-mcp rev: v0.1.0 hooks: - id: gupt-scan # GitHub Actions - run: pip install gupt-mcp && gupt scan . --policy secrets,government_ids --fail Python library
from gupt_mcp import Gupt g = Gupt() out = g.redact("Mail rahul@example.com, PAN ABCPE1234F", policy="dpdp") print(out["redacted_text"]) # Mail <
Zero config works. Everything is set through the client's env block or a JSON/TOML file at GUPT_CONFIG; environment variables win.
Config file (see examples/gupt.config.json):
{ "policy": "dpdp,secrets", "entity_modes": { "CREDIT_CARD": "mask" }, "entity_thresholds": { "URL": 0.9 }, "deny_list": ["Project Falcon", "Acme Hospital"], "allow_list": ["support@yourcompany.com"], "rules": [ { "entity": "EMPLOYEE_ID", "pattern": "\\bEMP-\\d{5}\\b", "score": 0.9, "context": ["employee"] } ], "field_hints": { "emp_code": "EMPLOYEE_ID" } } Custom rules may borrow any built-in check digit by name ("check": "verhoeff", "luhn", "iban"…). Config supplies data, never code. A malformed config stops startup instead of silently weakening protection.
Security model, honestly
Fail-safe: a detection-engine error blocks the call. A low-confidence finding is redacted anyway (or blocks, with on_uncertain=block). Overlapping findings are merged into their union, so no flagged byte leaks.
Exact restore: tokens are unique and collision-checked against the input, and restore is single-pass, so restore(redact(x)) == x. This is property-tested with Hypothesis across all reversible modes.
Local only: no network calls, no telemetry. The vault lives in memory and is never written to disk.
Limits: no detector catches everything, and regexes cannot find a bare name in free prose (enable the NER engine, use field hints, or a deny-list). Text the user already pasted into the chat has already reached the model; Gupt protects files, downstream tools, logs and APIs. Gupt is one technical control, not a compliance certification (HIPAA, GDPR, DPDP compliance concern your whole system and organisation).
See docs/ARCHITECTURE.md and SECURITY.md.
git clone https://github.com/parthagni22/gupt-mcp && cd gupt-mcp pip install -e ".[dev]" pytest && ruff check src tests Adding an identifier is a great first contribution: one Rule(...) in src/gupt_mcp/recognizers/, an optional validator in checksums.py, a catalog entry in entities.py, and a test row in tests/test_detection.py. Use synthetic data only.
Released: Dec 3, 2026
Both files in this release have provenance metadata.
View provenance details
MIT View SPDX License List
aadhaar ai-safety anonymization data-masking dlp dpdp gdpr hipaa india llm mcp mcp-server model-context-protocol phi pii pii-redaction privacy pseudonymization redaction secrets-detection
Development Status 4 - Beta
Intended Audience Developers
Financial and Insurance Industry
Operating System OS Independent
Programming Language Python :: 3
Topic Scientific/Engineering :: Artificial Intelligence
Text Processing :: Filters
Release files for gupt-mcp 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
Built distribution (wheel)
Total release size: 143.9 kB
Release files / gupt_mcp-0.1.0.tar.gz
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 3, 2026.
Release files / gupt_mcp-0.1.0-py3-none-any.whl
Security for gupt-mcp 0.1.0
Both files in this release have been uploaded with provenance metadata.
With provenance gupt_mcp-0.1.0.tar.gz Dec 3, 2026
With provenance gupt_mcp-0.1.0-py3-none-any.whl Dec 3, 2026
Attestation for gupt_mcp-0.1.0.tar.gz
Attestation for gupt_mcp-0.1.0-py3-none-any.whl
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.
Release history Release notifications | RSS feed
Dec 3, 2026 2 release files Full provenance
"PyPI", "Python Package Index", and the blocks logos are registered trademarks of the Python Software Foundation.
© 2026 Python Software Foundation
Deployed from 6571ef3











