anonym.legal
Back to BlogTechnical

How to Use Claude and ChatGPT Without Leaking Company Secrets

A developer's guide to using AI assistants securely. Set up MCP Server integration for transparent PII protection in Claude Desktop, Cursor, and VS Code.

February 22, 20267 min read
MCP ServerClaude DesktopCursor IDEsecure AIdeveloper tools

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:

  1. Intercepts your prompts before they reach the AI
  2. Detects and anonymizes PII automatically
  3. Sends only anonymized data to the AI
  4. 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

  1. Sign up at anonym.legal/auth/signup
  2. Navigate to Settings → API Tokens
  3. Generate a new token
  4. 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:

CategoryExamples
PersonalNames, emails, phone numbers, DOB
FinancialCredit cards, bank accounts, IBANs
GovernmentSSNs, passport numbers, driver's licenses
TechnicalIP addresses, API keys, tokens
HealthcareMRNs, patient IDs, insurance numbers
CorporateEmployee 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:

  1. Open Claude Desktop
  2. Paste text with obvious PII: "Contact John Smith at john@example.com"
  3. Check the MCP server logs (visible in Claude Desktop's developer tools)
  4. The log should show: "Anonymized: 2 entities (PERSON, EMAIL_ADDRESS)"

Security Considerations

Where Processing Happens

ComponentLocation
MCP ServerYour machine (local)
PII Detection APIanonym.legal servers (Germany)
AI ModelAnthropic/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

AspectWithoutWith MCP Server
PII in promptsSent to AI providerReplaced with tokens
Data in AI logsContains real PIIContains only tokens
Breach exposureFull PII leakedOnly anonymized data
Workflow changeNoneNone (transparent)

Pricing

MCP Server usage is included in all anonym.legal plans:

PlanTokens/monthPrice
Free200€0
Basic2,000€3/month
Pro10,000€15/month
Business50,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:

Ready to protect your data?

Start anonymizing PII with 285+ entity types across 48 languages.