CloakLLM MCP Server
Servidor MCP de CloakLLM
Servidor MCP que envuelve el SDK de Python de CloakLLM como herramientas para Claude Desktop y otros clientes compatibles con MCP.
Importante: MCP no protege su prompt inicial. Las herramientas MCP son llamadas por el LLM; su prompt se envía primero al proveedor del LLM y, a continuación, el LLM decide invocar las herramientas. Esto significa que el prompt sin procesar (incluida cualquier PII) llega al proveedor antes de que CloakLLM pueda desinfectarlo. El servidor MCP es útil para desinfectar datos que el LLM procesa durante una conversación (documentos, archivos, resultados de herramientas), pero no puede evitar que su prompt llegue al proveedor.
Para proteger los prompts antes de que salgan de su infraestructura, utilice el middleware del SDK en su lugar:
Python:
enable_openai(client)ocloakllm.enable()(LiteLLM)JavaScript:
cloakllm.enable(client)
Herramientas
Herramienta | Descripción |
| Detecta y oculta PII, devuelve el texto desinfectado + ID de mapa de tokens + entity_details. Pase |
| Restaura los valores originales utilizando un ID de mapa de tokens |
| Detecta PII sin ocultar (análisis puro) |
Related MCP server: Agent Guardrail MCP
Instalación
cd cloakllm-mcp
pip install -e .Configuración de Claude Desktop
Añada a su 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"
}
}
}
}O utilizando uvx:
{
"mcpServers": {
"cloakllm": {
"command": "uvx",
"args": ["mcp", "run", "/path/to/cloakllm-mcp/server.py"]
}
}
}Ejemplos de uso
Desinfectar texto antes de enviarlo a un LLM
Llamada a la herramienta: 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"
}Multiturno: Pase el
token_map_idde una respuesta desanitizeanterior para reutilizar el mismo mapa de tokens a lo largo de los turnos de la conversación. La misma PII siempre se asignará al mismo token.
Respuesta:
{
"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]"}
]
}Restaurar valores originales
Llamada a la herramienta: desanitize
{
"text": "I've drafted an email to [EMAIL_0] regarding [PERSON_0]'s request.",
"token_map_id": "a1b2c3d4-..."
}Respuesta:
{
"restored": "I've drafted an email to john@acme.com regarding Sarah Johnson's request."
}Analizar texto en busca de PII (sin ocultar)
Llamada a la herramienta: analyze
{
"text": "Contact john@acme.com, SSN 123-45-6789"
}Respuesta:
{
"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"}
]
}Variables de entorno
Variable | Predeterminado | Descripción |
|
| Directorio de registros de auditoría |
|
| Habilitar/deshabilitar el registro de auditoría |
|
| Modelo spaCy para NER |
|
| Habilitar detección basada en LLM |
|
| Modelo Ollama para detección por LLM |
|
| Endpoint de Ollama |
Pruebas
# Test with MCP inspector
python -m mcp dev server.py
# Or run directly
python server.pyVer también
CloakLLM Hub — descripción general del proyecto, arquitectura y enlaces
SDK de Python de CloakLLM — biblioteca de Python con spaCy NER + middleware de OpenAI / LiteLLM
SDK de JS de CloakLLM — biblioteca de JavaScript con middleware de OpenAI + Vercel AI
Licencia
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