CloakLLM MCP Server
CloakLLM MCP 서버
Claude Desktop 및 기타 MCP 호환 클라이언트를 위한 도구로서 CloakLLM의 Python SDK를 래핑하는 MCP 서버입니다.
중요: MCP는 초기 프롬프트를 보호하지 않습니다. MCP 도구는 LLM에 의해 호출됩니다. 즉, 프롬프트가 먼저 LLM 제공업체로 전송된 후 LLM이 도구 호출 여부를 결정합니다. 따라서 CloakLLM이 데이터를 삭제하기 전에 원본 프롬프트(PII 포함)가 제공업체에 도달하게 됩니다. 이 MCP 서버는 LLM이 대화 중에 처리하는 데이터(문서, 파일, 도구 출력)를 삭제하는 데 유용하지만, 프롬프트가 제공업체에 도달하는 것을 막을 수는 없습니다.
프롬프트가 인프라를 떠나기 전에 보호하려면 대신 SDK 미들웨어를 사용하세요:
Python:
enable_openai(client)또는cloakllm.enable()(LiteLLM)JavaScript:
cloakllm.enable(client)
도구
도구 | 설명 |
| PII를 탐지 및 마스킹하고, 마스킹된 텍스트 + 토큰 맵 ID + entity_details를 반환합니다. 되돌릴 수 없는 PII 제거를 위해 |
| 토큰 맵 ID를 사용하여 원래 값을 복원합니다 |
| 마스킹 없이 PII를 탐지합니다(순수 분석) |
Related MCP server: Presidio MCP Server
설치
cd cloakllm-mcp
pip install -e .Claude Desktop 설정
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"
}
}
}
}또는 uvx 사용:
{
"mcpServers": {
"cloakllm": {
"command": "uvx",
"args": ["mcp", "run", "/path/to/cloakllm-mcp/server.py"]
}
}
}사용 예시
LLM에 보내기 전 텍스트 마스킹
도구 호출: 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"
}멀티 턴: 이전
sanitize응답에서 받은token_map_id를 전달하여 대화 턴 전체에서 동일한 토큰 맵을 재사용하세요. 동일한 PII는 항상 동일한 토큰으로 매핑됩니다.
응답:
{
"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]"}
]
}원래 값 복원
도구 호출: desanitize
{
"text": "I've drafted an email to [EMAIL_0] regarding [PERSON_0]'s request.",
"token_map_id": "a1b2c3d4-..."
}응답:
{
"restored": "I've drafted an email to john@acme.com regarding Sarah Johnson's request."
}PII에 대한 텍스트 분석(마스킹 없음)
도구 호출: analyze
{
"text": "Contact john@acme.com, SSN 123-45-6789"
}응답:
{
"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"}
]
}환경 변수
변수 | 기본값 | 설명 |
|
| 감사 로그 디렉토리 |
|
| 감사 로깅 활성화/비활성화 |
|
| NER을 위한 spaCy 모델 |
|
| LLM 기반 탐지 활성화 |
|
| LLM 탐지를 위한 Ollama 모델 |
|
| Ollama 엔드포인트 |
테스트
# Test with MCP inspector
python -m mcp dev server.py
# Or run directly
python server.py참고 항목
CloakLLM Hub — 프로젝트 개요, 아키텍처 및 링크
CloakLLM Python SDK — spaCy NER + OpenAI / LiteLLM 미들웨어가 포함된 Python 라이브러리
CloakLLM JS SDK — OpenAI + Vercel AI 미들웨어가 포함된 JavaScript 라이브러리
라이선스
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Scan prompts for injection attacks, redact PII, and audit LLM SDK usage from any MCP client
Detect and redact PII and secrets before text reaches an LLM, with reversible placeholders.
Detect and redact PII and secrets (API keys, tokens) in text, HTML or PDF before it reaches an LLM.
Security & DLP proxy for MCP: tool-poisoning scans, PII redaction on tool args/results. Beta.
Related MCP Servers
- AlicenseAqualityDmaintenanceProvides prompt injection detection, PII/secrets redaction, and an audit trail for AI agents via MCP tools.4MIT
- AlicenseNot gradedqualityDmaintenanceEnables PII detection and anonymization using Microsoft Presidio with tools, resources, and prompts via MCP.MIT
- AlicenseAqualityBmaintenanceLocal pseudonymisation MCP server that detects PII in text, replaces it with opaque tokens before sending to cloud LLMs, and restores tokens afterward.2140 npm2MIT
- AlicenseNot gradedqualityDmaintenanceProvides MCP tools for prompt injection detection and content sanitization, safeguarding LLM pipelines. Also enables Japanese PII scanning and masking for secure data handling.MIT