CloakLLM MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@CloakLLM MCP ServerSanitize this text to remove PII: 'Contact John Doe at john.doe@email.com'"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
CloakLLM MCP Server
MCP server that wraps CloakLLM's Python SDK as tools for Claude Desktop and other MCP-compatible clients.
Important: MCP does not protect your initial prompt. MCP tools are called by the LLM — your prompt is sent to the LLM provider first, then the LLM decides to invoke tools. This means the raw prompt (including any PII) reaches the provider before CloakLLM can sanitize it. The MCP server is useful for sanitizing data that the LLM processes during a conversation (documents, files, tool outputs), but it cannot prevent your prompt from reaching the provider.
To protect prompts before they leave your infrastructure, use the SDK middleware instead:
Python:
enable_openai(client)orcloakllm.enable()(LiteLLM)JavaScript:
cloakllm.enable(client)
Tools
Tool | Description |
| Detect & cloak PII, return sanitized text + token map ID + entity_details. Pass |
| Restore original values using a token map ID |
| Detect PII without cloaking (pure analysis) |
Related MCP server: Agent Guardrail MCP
Install
cd cloakllm-mcp
pip install -e .Claude Desktop Configuration
Add to your claude_desktop_config.json:
{
"mcpServers": {
"cloakllm": {
"command": "python",
"args": ["/path/to/cloakllm-mcp/server.py"],
"env": {
"CLOAKLLM_LOG_DIR": "./cloakllm_audit",
"CLOAKLLM_LLM_DETECTION": "false"
}
}
}
}Or using uvx:
{
"mcpServers": {
"cloakllm": {
"command": "uvx",
"args": ["mcp", "run", "/path/to/cloakllm-mcp/server.py"]
}
}
}Usage Examples
Sanitize text before sending to an LLM
Tool call: sanitize
{
"text": "Email john@acme.com about the meeting with Sarah Johnson at 742 Evergreen Terrace",
"model": "claude-sonnet-4-20250514",
"token_map_id": "optional-id-for-multi-turn"
}Multi-turn: Pass the
token_map_idfrom a previoussanitizeresponse to reuse the same token map across conversation turns. The same PII will always map to the same token.
Response:
{
"sanitized": "Email [EMAIL_0] about the meeting with [PERSON_0] at 742 Evergreen Terrace",
"token_map_id": "a1b2c3d4-...",
"entity_count": 2,
"categories": {"EMAIL": 1, "PERSON": 1},
"entity_details": [
{"category": "EMAIL", "start": 6, "end": 19, "length": 13, "confidence": 0.95, "source": "regex", "token": "[EMAIL_0]"},
{"category": "PERSON", "start": 42, "end": 56, "length": 14, "confidence": 0.85, "source": "spacy", "token": "[PERSON_0]"}
]
}Restore original values
Tool call: desanitize
{
"text": "I've drafted an email to [EMAIL_0] regarding [PERSON_0]'s request.",
"token_map_id": "a1b2c3d4-..."
}Response:
{
"restored": "I've drafted an email to john@acme.com regarding Sarah Johnson's request."
}Analyze text for PII (no cloaking)
Tool call: analyze
{
"text": "Contact john@acme.com, SSN 123-45-6789"
}Response:
{
"entity_count": 2,
"entities": [
{"text": "john@acme.com", "category": "EMAIL", "start": 8, "end": 21, "confidence": 0.95, "source": "regex"},
{"text": "123-45-6789", "category": "SSN", "start": 27, "end": 38, "confidence": 0.95, "source": "regex"}
]
}Environment Variables
Variable | Default | Description |
|
| Audit log directory |
|
| Enable/disable audit logging |
|
| spaCy model for NER |
|
| Enable LLM-based detection |
|
| Ollama model for LLM detection |
|
| Ollama endpoint |
Testing
# Test with MCP inspector
python -m mcp dev server.py
# Or run directly
python server.pySee Also
CloakLLM Hub — project overview, architecture, and links
CloakLLM Python SDK — Python library with spaCy NER + OpenAI / LiteLLM middleware
CloakLLM JS SDK — JavaScript library with OpenAI + Vercel AI middleware
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Security & DLP proxy for MCP: tool-poisoning scans, PII redaction on tool args/results. Beta.
Connect MCP clients to 2,000+ AI models without managing provider API keys.
Stateless PII redaction over MCP/REST. Free ≤1000 words or $0.01/call; file upload supported.
Redact PII from text before it reaches a model. Nothing stored, no third-party AI.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceAn MCP proxy that pseudo-anonymizes PII before data reaches external AI providers like Claude, ChatGPT, or Gemini.18MIT
- AlicenseAqualityDmaintenanceProvides prompt injection detection, PII/secrets redaction, and an audit trail for AI agents via MCP tools.4MIT
- AlicenseNot gradedqualityCmaintenanceEnables PII detection and anonymization using Microsoft Presidio with tools, resources, and prompts via MCP.MIT
- AlicenseAqualityAmaintenanceLocal pseudonymisation MCP server that detects PII in text, replaces it with opaque tokens before sending to cloud LLMs, and restores tokens afterward.2106 npm2MIT