pii-mcp
MCP (Model Context Protocol) server that exposes pii-protect as native toolsfor Claude Desktop, Cursor, and any MCP-compatible client.
Tools exposed
| Tool | Description |
|---|---|
anonymize_text |
Anonymize PII, returns anonymized text + context_id |
deanonymize_text |
Restore original using context_id |
list_pii_types |
List all detectable PII types |
Connect it to your Pseudora account
- Sign in at pseudora.cloud and openCloud → Customer keys (
/cloud/customer-keys). - Create a key. It is displayed once — copy it straight away.
- Point the server at the hosted API:
pip install -r requirements.txt
cp .env.example .env
PII_API_URL=https://pseudora.cloud
PII_API_KEY=pk_live_…
The key travels as an X-Api-Key header. Your Pseudora plan decides the ratelimit and the monthly credit pool, both shared with every other client on thesame account — the browser extension, the VS Code extension and this server alldraw from the same pool. A key belonging to an account with no activesubscription is refused with 402 subscription_expired.
To run against a self-hosted engine instead, set PII_API_URL to your owninstance (for example http://localhost:15500) and use a service or admin key.
One-shot setup
bash setup.sh
It prompts for the key and registers the server with Claude Desktop.
Claude Desktop configuration
Edit ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"pii-protect": {
"command": "python",
"args": ["/Users/you/Progetti/pii/pii-mcp/server.py"],
"env": {
"PII_API_URL": "https://pseudora.cloud",
"PII_API_KEY": "your-customer-api-key"
}
}
}
}
Restart Claude Desktop. The tools appear automatically in the tool menu.
Cursor configuration
Edit .cursor/mcp.json in your project (or global ~/.cursor/mcp.json):
{
"mcpServers": {
"pii-protect": {
"command": "python",
"args": ["/Users/you/Progetti/pii/pii-mcp/server.py"],
"env": {
"PII_API_URL": "https://pseudora.cloud",
"PII_API_KEY": "your-customer-api-key"
}
}
}
}
Without the mcp SDK
server.py includes a pure JSON-RPC 2.0 fallback that works without the mcp package.The mcp SDK is optional but recommended for full protocol compatibility.
# With SDK (recommended)
pip install mcp
# Without SDK (fallback mode)
pip install httpx python-dotenv
Usage example (Claude Desktop)
After connecting, ask Claude:
"Anonymize this text before I share it with you: Mario Rossi, CF RSSMRA80A01H501U, tel 333-1234567"
Claude will call anonymize_text and work only with the anonymized version.