Cursor
MCP Server Setup Guide
Cursor connects to anonym.legal over HTTP — no installation, no Node.js. Add the endpoint URL and your API key to .cursor/mcp.json and you're done.
Prerequisites
- Cursor — version 0.40+ for MCP support. Download at cursor.sh
- anonym.legal API key — Pro or Business plan (required for MCP access). Get one at anonym.legal
- No Node.js, no npm, no local install — anonym.legal's MCP server runs entirely over HTTP. There is nothing to download or run locally.
Installation
Create the MCP config file
Create .cursor/mcp.json in your project root (per-project) or ~/.cursor/mcp.json (global, applies to all projects):
{
"mcpServers": {
"anonym-legal": {
"url": "https://anonym.legal/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}
Reload Cursor
Press Cmd/Ctrl+Shift+P → Developer: Reload Window. Or restart Cursor completely.
Verify in Cursor Settings
Go to Cursor Settings → Features → MCP (or the MCP panel in the sidebar). You should see anonym-legal listed as an active server with 7 tools.
Using Environment Variables (Recommended)
Keep your API key out of the config file using a .env file or Cursor's env expansion:
{
"mcpServers": {
"anonym-legal": {
"url": "https://anonym.legal/mcp",
"headers": {
"Authorization": "Bearer ${ANONYM_LEGAL_API_KEY}"
}
}
}
}
ANONYM_LEGAL_API_KEY=your_actual_api_key_here
⚠ Important: Add .cursor/mcp.json to .gitignore if it contains your API key directly. Never commit secrets to version control.
Available Tools (7)
free
tokens
free
free
free
free
free
Operators (6)
John Smith → [CLIENT] or [PERSON]
john@acme.com → (removed)
John Smith → a3f9b1...
4111-xxxx → enc:U2FsdGVkX1...
john@acme.com → jo**@****.com
John Smith → John Smith (tracked)
Using with Cursor Agent
In Cursor's Agent mode (Cmd+I or the Agent panel), MCP tools are available automatically. You can use them directly in your conversation:
Before sending this to the API, use anonym_legal_anonymize_text to redact all emails and replace all person names with [USER]. "Send a welcome email to Hans Mueller (hans@example.de) and CC his manager Lisa Schneider (lisa@company.de)."
1. Read the file customer_data.json 2. Use anonym_legal_analyze_text to identify all PII fields 3. Use anonym_legal_anonymize_text with redact for emails, replace for names 4. Write the anonymized version to customer_data_anon.json 5. Show me a summary of what was removed
Project vs Global Scope
- Only active in this workspace
- Can use project-specific API key
- Good for team projects (with .gitignore)
- Committed to repo (env vars only!)
- Active in all Cursor projects
- Single config to maintain
- Good for personal use
- Stored in home directory
Troubleshooting
MCP server not showing in Cursor settings
Check JSON syntax — Cursor silently ignores invalid JSON. Validate at jsonlint.com. Also ensure the file is at .cursor/mcp.json (not .cursorrules).
Connection failed to https://anonym.legal/mcp
Verify your API key is correct and on Pro/Business plan. Test directly: curl -H "Authorization: Bearer YOUR_KEY" https://anonym.legal/mcp — should return an MCP manifest.
Tools appear but calls fail with 402
You've run out of tokens. Check balance with anonym_legal_get_balance or top up at anonym.legal.
401/403 from the MCP endpoint
Double-check the Authorization header is exactly Bearer YOUR_API_KEY (note the space after "Bearer") and that the key hasn't been revoked or rotated in your anonym.legal account.
Server not found / no tools listed
Confirm your plan includes MCP access — the Free and Basic tiers do not. Check your tier with anonym_legal_get_balance or in your account dashboard.