Skip to main content

MCP server for CloakLLM — PII cloaking tools for Claude Desktop

Project description

CloakLLM MCP Server

MCP server that wraps CloakLLM's Python SDK as tools for Claude Desktop and other MCP-compatible clients.

Tools

Tool Description
sanitize Detect & cloak PII, return sanitized text + token map ID
desanitize Restore original values using a token map ID
analyze Detect PII without cloaking (pure analysis)

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"
}

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}
}

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
CLOAKLLM_LOG_DIR ./cloakllm_audit Audit log directory
CLOAKLLM_AUDIT_ENABLED true Enable/disable audit logging
CLOAKLLM_SPACY_MODEL en_core_web_sm spaCy model for NER
CLOAKLLM_LLM_DETECTION false Enable LLM-based detection
CLOAKLLM_LLM_MODEL llama3.2 Ollama model for LLM detection
CLOAKLLM_OLLAMA_URL http://localhost:11434 Ollama endpoint

Testing

# Test with MCP inspector
python -m mcp dev server.py

# Or run directly
python server.py

See Also

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cloakllm_mcp-0.1.2.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cloakllm_mcp-0.1.2-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file cloakllm_mcp-0.1.2.tar.gz.

File metadata

  • Download URL: cloakllm_mcp-0.1.2.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.6

File hashes

Hashes for cloakllm_mcp-0.1.2.tar.gz
Algorithm Hash digest
SHA256 d3b47868232b1aebad3e94809092897947a04dd9298e99812c70a3f34cf5832d
MD5 de9be36c585c6bac3dcea8cfb51ec906
BLAKE2b-256 b43f54c169cf950f71ce3ed55c5d25755982a37cad2394543886912603f1a4dd

See more details on using hashes here.

File details

Details for the file cloakllm_mcp-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: cloakllm_mcp-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.6

File hashes

Hashes for cloakllm_mcp-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9d623b9a3e86ed42f379ba1cf2500c851cefd419117a44516600cd2d129708ba
MD5 a7d77d4496bb5045ea9436d04500bd7e
BLAKE2b-256 4eedf77b5d6157ed35fe372902554a0563c5307afb219b9fc15d10b55f3efebb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page