An MCP server for Claude Desktop that detects PII in text, shows a redacted preview for your approval, then sends the sanitized content to an external LLM.
- Scans text for names, emails, phone numbers, SSNs, credit cards, addresses, passwords, and account numbers
- Shows a side-by-side original vs. redacted preview
- Waits for your explicit approval before sending anything externally
- Sends only the redacted text to OpenAI GPT-4
- Logs every approval to a local audit trail
- Claude Desktop
- Node.js v18 or later
- An OpenAI API key
Open ~/Library/Application Support/Claude/claude_desktop_config.json (create it if it doesn't exist) and add:
{
"mcpServers": {
"prompt-safety": {
"command": "npx",
"args": ["-y", "prompt-safety-mcp"],
"env": {
"OPENAI_API_KEY": "sk-your-key-here"
}
}
}
}Replace sk-your-key-here with your actual OpenAI API key.
Quit and reopen Claude Desktop. You should see a hammer icon indicating 4 tools are available.
| Tool | Description |
|---|---|
detect_pii |
Scan text and return found PII entities |
preview_redaction |
Show original vs. redacted side-by-side table |
submit_approved |
Send redacted text to GPT-4, log the approval |
get_audit_log |
View recent approval history |
Paste text containing sensitive data into Claude Desktop and ask it to check for PII. Claude will walk you through detection, preview, and approval before sending anything to an external service.
All configuration is via environment variables in the Claude Desktop config:
| Variable | Default | Description |
|---|---|---|
OPENAI_API_KEY |
required | Your OpenAI API key |
LLM_MODEL |
gpt-4 |
OpenAI model to use |
AUDIT_LOG_PATH |
<package>/audit.jsonl |
Path for the audit log file |
On Windows, use this config instead:
{
"mcpServers": {
"prompt-safety": {
"command": "cmd",
"args": ["/c", "npx", "-y", "prompt-safety-mcp"],
"env": {
"OPENAI_API_KEY": "sk-your-key-here"
}
}
}
}