The Developer's Dilemma
You're debugging a production issue. The stack trace includes customer email addresses. The fastest solution? Paste it into Claude and ask for help.
But that customer data is now:
- Stored in Anthropic's systems
- Potentially used for training (depending on your plan)
- Visible to anyone with access to your chat history
77% of developers paste sensitive data into AI tools. Most don't realize the implications until it's too late.
The MCP Server Solution
The Model Context Protocol (MCP) Server acts as a transparent proxy between you and AI assistants. It:
- Intercepts your prompts before they reach the AI
- Detects and anonymizes PII automatically
- Sends only anonymized data to the AI
- De-anonymizes responses so you see original context
You interact with AI normally—the protection is invisible.
Setting Up MCP Server
Prerequisites
- Node.js 18+
- Claude Desktop, Cursor, or VS Code with Claude extension
- anonym.legal API key (get one free at anonym.legal/auth/signup)
Step 1: Get Your API Key
- Sign up at anonym.legal/auth/signup
- Navigate to Settings → API Tokens
- Generate a new token
- Copy the token (you'll only see it once)
Step 2: Configure Claude Desktop
Edit your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
Add the anonym.legal MCP server:
{
"mcpServers": {
"anonym-legal": {
"command": "npx",
"args": ["-y", "@anthropic/mcp-server-anonym-legal"],
"env": {
"ANONYM_API_KEY": "your-api-key-here"
}
}
}
}
Step 3: Restart Claude Desktop
Close and reopen Claude Desktop. You should see "anonym-legal" in the MCP servers list.
Configuration for Cursor IDE
Cursor uses the same MCP protocol. Add to your Cursor settings:
{
"mcp": {
"servers": {
"anonym-legal": {
"command": "npx",
"args": ["-y", "@anthropic/mcp-server-anonym-legal"],
"env": {
"ANONYM_API_KEY": "your-api-key-here"
}
}
}
}
}
What Gets Anonymized
The MCP Server detects and anonymizes 285+ entity types:
| Category | Examples |
|---|---|
| Personal | Names, emails, phone numbers, DOB |
| Financial | Credit cards, bank accounts, IBANs |
| Government | SSNs, passport numbers, driver's licenses |
| Technical | IP addresses, API keys, tokens |
| Healthcare | MRNs, patient IDs, insurance numbers |
| Corporate | Employee IDs, account numbers |
Example Transformation
Your prompt:
Debug this error from user john.smith@acme.com:
Error: Payment failed for card 4532-1234-5678-9012
Customer ID: CUST-12345
IP: 192.168.1.100
What Claude sees:
Debug this error from user [EMAIL_1]:
Error: Payment failed for card [CREDIT_CARD_1]
Customer ID: [CUSTOMER_ID_1]
IP: [IP_ADDRESS_1]
Claude's response (to you):
The error for john.smith@acme.com suggests the card
4532-1234-5678-9012 may have insufficient funds...
You see the original data; Claude only ever saw tokens.
Advanced Configuration
Custom Entity Types
Define additional patterns to detect:
{
"mcpServers": {
"anonym-legal": {
"command": "npx",
"args": ["-y", "@anthropic/mcp-server-anonym-legal"],
"env": {
"ANONYM_API_KEY": "your-api-key",
"CUSTOM_PATTERNS": "JIRA-[0-9]+,TICKET-[A-Z0-9]+"
}
}
}
}
Allowlist Specific Data
Some data shouldn't be anonymized (public company names, product names):
{
"env": {
"ANONYM_API_KEY": "your-api-key",
"ALLOWLIST": "Anthropic,Claude,anonym.legal"
}
}
Disable Specific Entity Types
If you need certain types to pass through:
{
"env": {
"ANONYM_API_KEY": "your-api-key",
"DISABLED_ENTITIES": "PHONE_NUMBER,URL"
}
}
Verification
Test that anonymization is working:
- Open Claude Desktop
- Paste text with obvious PII: "Contact John Smith at john@example.com"
- Check the MCP server logs (visible in Claude Desktop's developer tools)
- The log should show: "Anonymized: 2 entities (PERSON, EMAIL_ADDRESS)"
Security Considerations
Where Processing Happens
| Component | Location |
|---|---|
| MCP Server | Your machine (local) |
| PII Detection API | anonym.legal servers (Germany) |
| AI Model | Anthropic/OpenAI servers |
The MCP server itself runs locally. Only the detection request (with hashed/anonymized data) goes to anonym.legal's API.
Data Retention
anonym.legal does not store your prompts or responses. The API:
- Receives text for analysis
- Returns entity positions
- Immediately discards the input
See our privacy policy for details.
Comparison: Without vs. With MCP Server
| Aspect | Without | With MCP Server |
|---|---|---|
| PII in prompts | Sent to AI provider | Replaced with tokens |
| Data in AI logs | Contains real PII | Contains only tokens |
| Breach exposure | Full PII leaked | Only anonymized data |
| Workflow change | None | None (transparent) |
Pricing
MCP Server usage is included in all anonym.legal plans:
| Plan | Tokens/month | Price |
|---|---|---|
| Free | 200 | €0 |
| Basic | 2,000 | €3/month |
| Pro | 10,000 | €15/month |
| Business | 50,000 | €29/month |
Most developers stay on Basic (€3/month) with typical usage.
Conclusion
AI assistants are essential for modern development, but they don't need to see your customers' data.
The MCP Server integration:
- Requires no workflow changes
- Protects PII automatically
- Works with Claude Desktop, Cursor, and VS Code
- Costs €3/month for most developers
Set it up once, and forget about it—your data is protected by default.
Get started:
Sources: