Cursor
MCP Server Setup Guide
Cursor supports both HTTP and stdio transport for MCP. HTTP is recommended — it connects to the anonym.legal cloud endpoint and requires no local Node.js subprocess.
Prerequisites
- Cursor — version 0.40+ for MCP support. Download at cursor.sh
- anonym.legal API key — Pro or Business plan. Get one at anonym.legal
- Node.js 18+ — only required for stdio transport (HTTP method doesn't need it)
Installation — HTTP (Recommended)
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.
Installation — stdio (Alternative)
Use this if you need to run the server locally or offline:
{
"mcpServers": {
"anonym-legal": {
"command": "npx",
"args": ["-y", "@anthropic-ai/mcp-server-anonym-legal"],
"env": {
"ANONYM_LEGAL_API_KEY": "YOUR_API_KEY"
}
}
}
}
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.
stdio method: "command not found: npx"
Cursor may not inherit your PATH. Use the full path: find it with which npx (macOS/Linux) or where npx (Windows) and use the absolute path in "command".