MCP Server
Round-Trip PII Protection
Prompts are anonymized before the AI sees them. Responses are deanonymized before you read them. Your workflow runs unchanged — the protection is invisible.
HOW THE ROUND-TRIP WORKS
- Out → Detects 285+ PII types, replaces each with a reversible token before the AI sees the prompt
- ← In Restores every original value in the AI's response automatically — you always read real names
- 6 operators: hash names, encrypt cards, mask phones, redact SSNs — per entity type
- E2E mode: only your client holds the mapping — server never stores real values
How It Works
Transparent proxy — AI never sees real PII
Your AI Tool
Claude Desktop
Cursor · VS Code
Windsurf · Continue
MCP Server
Detects PII
Replaces with tokens
Restores on return
AI Model
Claude · GPT
Never sees
real PII data
"Debug this for user john@acme.com
API key: sk-abc123xyz
SSN: 123-45-6789"
"Debug this for user <EMAIL_1>
API key: <API_KEY_1>
SSN: <US_SSN_1>"
↩ Response comes back with all tokens automatically restored to original values
Supported Integrations
stdio for Claude Desktop · HTTP for everything else
Claude Desktop
Native stdio transport — lowest latency. Full support for all 7 tools.
stdio nativeCursor IDE
HTTP transport via anonym.legal endpoint. AI-assisted coding with full PII protection.
HTTP availableVS Code
Works with GitHub Copilot Chat MCP support and MCP extension plugins.
HTTP availableWindsurf
Codeium's Windsurf IDE supports HTTP MCP servers natively.
HTTP availableContinue / Cline
Open-source coding assistants with full HTTP MCP protocol support.
HTTP availableCustom / REST API
Any tool that supports HTTP MCP transport, or direct REST API calls.
AvailableQuick Install
Up and running in under 5 minutes
Add to claude_desktop_config.json:
{
"mcpServers": {
"anonymize": {
"command": "npx",
"args": ["-y", "@anthropic-ai/mcp-server-anonym-legal"],
"env": {
"ANONYM_LEGAL_API_KEY": "your-api-key-here"
}
}
}
}
Config file location:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
Restart Claude Desktop after saving. You should see 7 tools available in the MCP panel.
Add to Cursor MCP settings (~/.cursor/mcp.json):
{
"mcpServers": {
"anonymize": {
"url": "https://anonym.legal/mcp",
"headers": {
"Authorization": "Bearer your-api-key-here"
}
}
}
}
HTTP transport. All 7 tools available. Cursor also supports the npx approach via CLI if you prefer.
Add to .vscode/mcp.json in your workspace (VS Code 1.99+):
{
"servers": {
"anonymize": {
"type": "http",
"url": "https://anonym.legal/mcp",
"headers": {
"Authorization": "Bearer your-api-key-here"
}
}
}
}
Requires VS Code 1.99+ and GitHub Copilot or MCP-compatible extension.
Any tool supporting HTTP MCP transport:
// Generic HTTP MCP config
{
"mcpServers": {
"anonymize": {
"url": "https://anonym.legal/mcp",
"headers": {
"Authorization": "Bearer your-api-key-here"
}
}
}
}
Works with Windsurf, Continue, Cline, Zed, Msty, and any tool implementing MCP HTTP transport.
Get Started — Pick Your Product
MCP Server is available on both products. Free tier on both. See the comparison ↓
Two Products. One Technology.
Both built on the same round-trip MCP engine — choose by use case
anonym.legal
anonym.legal/mcp
- ✓ 7 MCP tools — analyze, anonymize, deanonymize, presets, sessions
- ✓ 285+ entity types, 48 languages, 26 groups
- ✓ 6 operators: hash · encrypt · mask · redact · replace · keep
- ✓ Entity groups & named presets — per-project config
- ✓ Session persistence: 24h ephemeral · 30-day vault
- ✓ NPM:
@anthropic-ai/mcp-server-anonym-legal
Best for: individual developers, Claude Desktop, Cursor, VS Code
Get Started Free →cloak.business
cloak.business/mcp
- ✓ 10 MCP tools — all of anonym.legal + batch & image
- ✓ 320+ entity types, 70+ countries, 48 languages
- ✓ Batch processing: 1–100 texts in a single tool call
- ✓ Image redaction: OCR in 38 languages + visual PII blurring
- ✓ Also includes: Chrome Extension · Office Add-in
- ✓ NPM:
cloak-business-mcp-server
Best for: teams, pipelines processing documents/images, enterprise
Get Started Free →Step-by-step guides for your specific tool
Each platform has different config files, transport options, and quirks — especially VS Code, which uses
"servers" instead of "mcpServers".
Our platform guides cover the exact steps, troubleshooting, and advanced config for each tool.
7 MCP Tools
Complete parameter reference — ★ free · ● tokens charged
Detect PII entities in text without modifying it. Returns entity types, positions, and confidence scores. Supports presets, entity groups, and custom ad-hoc recognizers.
| Parameter | Type | Required | Description |
|---|---|---|---|
| text | string | required | Text to analyze. Max 100,000 characters. |
| language | string | optional | Language code. 48 supported (en, de, fr, es, it, pt, nl, pl, ru, zh, ja, ko, ar, hi…). Default: en |
| entities | string[] | optional | Specific entity types to detect, e.g. ["PERSON", "EMAIL_ADDRESS"]. Default: all types. Max 50. |
| entity_groups | string[] | optional | Entity groups to detect. Expands to all members: UNIVERSAL, FINANCIAL, DACH, NORTH_AMERICA, HEALTHCARE, etc. (26 groups total). Max 20. |
| output | "full" | "summary" | "counts" | optional | full — entity text + positions + scores. summary — entity values only. counts — just entity type counts (fastest). Default: full |
| score_threshold | number | optional | Minimum confidence score 0.0–1.0. Lower = more detections, more false positives. Default: 0.5 |
| preset | "default" | "personal" | "private" | optional | Use a saved preset configuration. default = standard entities, personal = your custom preset, private = private preset. |
| ad_hoc_recognizers | object[] | optional | Custom regex patterns for domain-specific entities. Max 10. Each has: entity_type, patterns (regex + score), context (optional boost words), languages (optional). |
| response_format | "json" | "markdown" | optional | Output format. json for structured data, markdown for human-readable. Default: json |
// Analyze for EU financial entities
{
"text": "Invoice for Maria Müller, IBAN DE89370400440532013000",
"entity_groups": ["UNIVERSAL", "FINANCIAL", "DACH"],
"language": "de",
"output": "summary"
}
Anonymize text by detecting and replacing PII. Supports 6 operators per entity type. Use mode="tokenize" for reversible replacement (returns session_id) or mode="redact" for permanent removal.
| Parameter | Type | Required | Description |
|---|---|---|---|
| text | string | required | Text to anonymize. Max 100,000 characters. |
| mode | "redact" | "tokenize" | optional | tokenize — replace with reversible tokens (returns session_id). redact — permanent removal. Default: tokenize |
| operators | object | optional | Per-entity-type operators. Key = entity type, value = operator config. See Operators section below. |
| entities | string[] | optional | Specific entity types to anonymize. Default: all detected. |
| entity_groups | string[] | optional | Entity groups to anonymize (expands to members). Max 20. |
| language | string | optional | Language code. Default: en |
| score_threshold | number | optional | Minimum confidence 0.0–1.0. Default: 0.5 |
| preset | string | optional | Use saved preset: default, personal, private. |
| persistence | "session" | "persistent" | optional | session = 24h token lifetime. persistent = 30 days. Default: session |
| sessionName | string | optional | Optional name for the session (alphanumeric, underscore, hyphen). Max 100 chars. |
| output | "full" | "metadata" | "minimal" | optional | full = anonymized text + entity details. metadata = text + type counts. minimal = text only (fastest). Default: full |
| e2e_mode | boolean | optional | End-to-end encryption mode. Server returns original text positions; client builds token mappings locally. Server never sees PII values. Default: false |
| response_format | "json" | "markdown" | optional | Output format. Default: json |
{
"text": "Patient John Smith (DOB: 1985-03-15, SSN: 123-45-6789) prescribed aspirin",
"language": "en",
"entity_groups": ["UNIVERSAL", "NORTH_AMERICA", "HEALTHCARE"],
"operators": {
"PERSON": {"type": "hash", "hash_type": "SHA256"},
"DATE_TIME": {"type": "replace", "new_value": "[DATE]"},
"US_SSN": {"type": "mask", "chars_to_mask": 7, "from_end": false}
},
"persistence": "persistent",
"sessionName": "patient-record-2026"
}
Restore original PII values from tokens. Pass the anonymized text and the session_id returned by anonymize_text. Works for both session (24h) and persistent (30d) tokens.
| Parameter | Type | Required | Description |
|---|---|---|---|
| text | string | required | Tokenized text containing tokens like <EMAIL_1>, <PERSON_1> to restore. |
| session_id | string | required | Session ID returned by anonymize_text. Links tokens to their original values. |
{
"text": "Here is the analysis for <PERSON_1> with account <EMAIL_1>",
"session_id": "sess_abc123xyz"
}
Estimate token cost before processing. Use this before large anonymization runs to plan token budget. Does not modify text or charge tokens.
| Parameter | Type | Required | Description |
|---|---|---|---|
| text | string | required | Text to estimate cost for. |
| language | string | optional | Language code. Affects token counting. Default: en |
Returns your current token balance, plan tier, and usage statistics. No parameters required.
List all active tokenization sessions. Sessions expire: session type in 24h, persistent in 30 days. Use this to find old session IDs or audit active sessions.
No required parameters. Returns an array of session objects with id, name, entity counts, persistence type, and expiry timestamps.
Permanently delete a tokenization session and all its token mappings. Use for GDPR right-to-erasure compliance or when sensitive session data is no longer needed.
| Parameter | Type | Required | Description |
|---|---|---|---|
| session_id | string | required | Session ID to permanently delete. |
6 Operators
Configure per-entity-type anonymization method via the operators parameter
Replace entity with custom text. If no new_value provided, uses a type-appropriate synthetic placeholder (e.g., <PERSON>).
"PERSON": {"type": "replace", "new_value": "[REDACTED NAME]"}
// Input: "Contact John Smith about this"
// Output: "Contact [REDACTED NAME] about this"
Remove the entity entirely. No parameters. Permanent — no session created. Best for strict compliance where values must not exist in any form.
"EMAIL_ADDRESS": {"type": "redact"}
// Input: "Send to john@acme.com for review"
// Output: "Send to for review"
Replace with cryptographic hash. Same input always produces same hash — useful for deduplication without storing originals. Choose SHA256 (64 chars) or SHA512 (128 chars).
"PERSON": {"type": "hash", "hash_type": "SHA256"}
// Input: "Patient: John Smith"
// Output: "Patient: a8f5f167f44f4964e6c998dee827110c..."
Encrypt with AES-256. Requires a 16, 24, or 32-character key you provide. The key is yours — anonym.legal never stores it. Decryptable by anyone with the key.
"CREDIT_CARD": {"type": "encrypt", "key": "your-32char-encryption-key-here"}
// Input: "Card: 4532015112830366"
// Output: "Card: ENC:base64encoded..."
Partially hide the value with masking characters. Set chars_to_mask for how many characters to obscure. Use from_end: false (default) to mask from start, true to mask from end.
"PHONE_NUMBER": {"type": "mask", "chars_to_mask": 6, "masking_char": "*", "from_end": true}
// Input: "+1-555-867-5309"
// Output: "+1-555-******"
Exclude an entity from anonymization. Useful when you want to detect but not anonymize certain types — e.g., keep DATE_TIME visible while anonymizing names and IDs.
"DATE_TIME": {"type": "keep"}
"PERSON": {"type": "redact"}
// Input: "John filed on March 15, 2026"
// Output: "[PERSON] filed on March 15, 2026"
26 Entity Groups
Use entity_groups to target entire regions or domains at once
Advanced Configuration
Presets, custom recognizers, e2e mode
Presets
Presets save a configuration of entity types, operators, and score thresholds. Create presets in your anonym.legal account dashboard and reference them by name.
// Use a saved preset (entities + operators all pre-configured)
{
"text": "Your text here...",
"preset": "personal"
}
// Preset types:
// "default" — standard entity set
// "personal" — your saved custom preset
// "private" — private preset with additional controls
Custom Recognizers (Ad-hoc)
Define custom regex-based entity types for domain-specific data — employee IDs, internal project codes, proprietary identifiers. Up to 10 per request.
{
"text": "Employee EMP-2026-00142 accessed project P-ALPHA-7 on 2026-03-14",
"ad_hoc_recognizers": [
{
"entity_type": "EMPLOYEE_ID",
"patterns": [{"regex": "EMP-\\d{4}-\\d{5}", "score": 0.9}],
"context": ["employee", "staff", "worker"]
},
{
"entity_type": "PROJECT_CODE",
"patterns": [{"regex": "P-[A-Z]+-\\d+", "score": 0.85}],
"context": ["project", "initiative"]
}
]
}
End-to-End Encryption Mode
With e2e_mode: true, the server returns original text positions instead of managing token mappings server-side. Your client builds the mapping locally and can encrypt it with its own key. The server never stores or sees the PII values.
{
"text": "Refer patient Jane Doe (DOB: 1990-01-15) to cardiology",
"e2e_mode": true,
"mode": "tokenize",
"entity_groups": ["UNIVERSAL", "HEALTHCARE"]
}
// Returns: anonymized_text + e2e_token_positions[]
// e2e_token_positions: [{token, entity_type, original_start, original_end, score}]
// Client extracts: text.slice(original_start, original_end) = "Jane Doe"
// Client stores this mapping encrypted locally — server never sees it
Use Cases
Real-world scenarios — entity groups and operators for each domain
AI-assisted contract review without exposing client identity
Lawyers can use Claude for contract analysis, legal research, and drafting while client names, addresses, case numbers, and financial terms stay protected. The LEGAL group plus UNIVERSAL and FINANCIAL covers most legal document types.
{
"entity_groups": ["UNIVERSAL", "FINANCIAL", "LEGAL"],
"operators": {
"PERSON": {"type": "replace", "new_value": "[CLIENT]"},
"CASE_NUMBER": {"type": "hash", "hash_type": "SHA256"},
"IBAN_CODE": {"type": "mask", "chars_to_mask": 14, "from_end": true}
},
"persistence": "persistent"
}
HIPAA-safe AI analysis of patient records
Clinical staff can leverage AI for diagnosis assistance and record summarization while PHI (Protected Health Information) is automatically stripped. The HEALTHCARE group covers medical record numbers, prescription numbers, patient IDs, insurance IDs, and healthcare-specific identifiers across 5 countries.
{
"entity_groups": ["UNIVERSAL", "HEALTHCARE", "NORTH_AMERICA"],
"operators": {
"PERSON": {"type": "hash", "hash_type": "SHA256"},
"DATE_TIME": {"type": "replace", "new_value": "[DATE]"},
"US_SSN": {"type": "redact"},
"MEDICAL_RECORD_NUMBER": {"type": "hash", "hash_type": "SHA256"}
}
}
AI-powered fraud analysis without exposing account data
Financial institutions can use AI for transaction analysis, fraud detection, and customer support while IBANs, credit cards, sort codes, crypto wallets, and customer identifiers are handled per compliance policy.
{
"entity_groups": ["UNIVERSAL", "FINANCIAL"],
"operators": {
"CREDIT_CARD": {"type": "mask", "chars_to_mask": 12, "from_end": false},
"IBAN_CODE": {"type": "encrypt", "key": "your-32char-key-here------------"},
"CRYPTO": {"type": "hash", "hash_type": "SHA256"}
}
}
AI code review without leaking credentials and secrets
Developers can paste code, logs, and configuration files into Claude and Cursor for AI assistance without exposing API keys, connection strings, JWT tokens, database credentials, or internal hostnames. Works automatically in the background — zero workflow change.
// The MCP Server automatically detects these in your code:
// API_KEY, JWT_TOKEN, DATABASE_URL, OAUTH_TOKEN
// AWS_SECRET, PRIVATE_KEY, CLIENT_SECRET, SSH_KEY
// IP_ADDRESS, HOSTNAME, DOMAIN_NAME, FILE_PATH
// Example: these in a paste get automatically intercepted
DATABASE_URL=postgres://user:pass@db.internal/prod
API_KEY=sk-proj-1234abcxyz
JWT_SECRET=eyJhbGciOiJIUzI1NiJ9.secret...
Limits & Rates
Max text length
100,000 characters per request (approx. 80 pages of text)
Rate limit
100 requests per minute per API key
Session persistence
Session tokens: 24 hours. Persistent tokens: 30 days.
The MCP Privacy Gap
Adding MCP servers to your AI tool creates a data flow you may not have considered
What happens when you add any MCP server
When Claude Desktop or Cursor calls a third-party MCP server — for database queries, file access, web search — the AI can instruct that server to process any data in the current conversation context. Privacy protections from Anthropic or Cursor apply to the model, not to MCP servers you add.
The anonym.legal MCP server intercepts every prompt before the AI sees it — including before any other MCP tool call is made. PII is replaced with tokens at the protocol layer, so no other server ever receives real personal data from your conversations.
| Scenario | Without anonymize.dev | With anonymize.dev |
|---|---|---|
| AI model sees your prompt | Real PII included | Tokens only |
| Other MCP servers in context | Receive real PII | Receive tokens |
| Prompt injection targeting PII | Can extract real data | Only tokens extractable |
| GDPR Art. 25 compliance | Manual — your responsibility | Automated at protocol level |
| Developer workflow change required | None needed | None needed — transparent |
HOW THE CHAIN WORKS
Your prompt (with PII)
→ anonymize_text (tokens replace PII)
→ AI model (sees only tokens)
→ other MCP tools (receive only tokens)
→ detokenize_text (real values restored in response)
MCP Server Pricing
MCP Server uses your token balance. Analyze operations are free. Anonymize operations charge tokens proportional to text length and entity count.
Note: Currently all plans include all Pro and Business features during promo period. All 7 MCP tools available. Free plan (200 tokens/cycle) also available for testing.
Pricing above is for anonym.legal. cloak.business has separate plans with batch & image tools.
View complete pricing with all plan features →Related Resources
Operators Deep Dive
When to use replace, hash, encrypt, mask, redact, or keep — with real-world examples for each use case.
Full Documentation
REST API reference, code examples in Python, Node.js, and cURL, plus SDK documentation.
FAQ
Common questions about MCP Server integration, entity detection, session management, and security.