Guides: Hub Claude Desktop Cursor VS Code Windsurf Continue Cline Compare
⚡ Cursor — AI-First Code Editor

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.

HTTP + stdio .cursor/mcp.json per-project or global
Transport
HTTP (recommended)
Config key
mcpServers
Config file
.cursor/mcp.json
Scope
project or global

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)

1

Create the MCP config file

Create .cursor/mcp.json in your project root (per-project) or ~/.cursor/mcp.json (global, applies to all projects):

.cursor/mcp.json — HTTP methodjson
{
  "mcpServers": {
    "anonym-legal": {
      "url": "https://anonym.legal/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
  }
}
HTTP advantage: No local subprocess, no Node.js version issues. The connection goes directly to anonym.legal's MCP endpoint with TLS 1.3.
2

Reload Cursor

Press Cmd/Ctrl+Shift+PDeveloper: Reload Window. Or restart Cursor completely.

3

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:

.cursor/mcp.json — stdio methodjson
{
  "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:

.cursor/mcp.json — env referencejson
{
  "mcpServers": {
    "anonym-legal": {
      "url": "https://anonym.legal/mcp",
      "headers": {
        "Authorization": "Bearer ${ANONYM_LEGAL_API_KEY}"
      }
    }
  }
}
.env (gitignored)
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)

anonym_legal_analyze_text
free
Scan text and return all detected PII entities with type, position, and confidence score — without modifying anything.
anonym_legal_anonymize_text
tokens
Replace PII with reversible tokens using configurable operators per entity type. Returns anonymized text + session token map.
anonym_legal_detokenize_text
free
Restore original PII values from session tokens. Used to de-anonymize AI responses.
anonym_legal_get_balance
free
Returns your current token balance, plan tier, and next reset date.
anonym_legal_estimate_cost
free
Preview token cost for a text before anonymizing it. No tokens consumed.
anonym_legal_list_sessions
free
List all active tokenization sessions with creation time, entity count, and expiry.
anonym_legal_delete_session
free
Delete a session and all stored tokens — for GDPR right-to-erasure compliance.

Operators (6)

replace
Substitute with custom text or entity type label.
John Smith → [CLIENT] or [PERSON]
redact
Remove entirely — no trace left in the text.
john@acme.com → (removed)
hash
SHA-256 or SHA-512 — deterministic, one-way. Enables deduplication across documents.
John Smith → a3f9b1...
encrypt
AES-256 with your personal key — reversible only by key holder.
4111-xxxx → enc:U2FsdGVkX1...
mask
Partial replacement — configurable chars from start or end.
john@acme.com → jo**@****.com
keep
Detect but pass through unchanged. Useful to audit without modifying.
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:

in Cursor Agent chat
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)."
automated workflow in Cursor Agent
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

Project (.cursor/mcp.json)
  • Only active in this workspace
  • Can use project-specific API key
  • Good for team projects (with .gitignore)
  • Committed to repo (env vars only!)
Global (~/.cursor/mcp.json)
  • 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".

🇩🇪