Skip to content

WoutVanHemelrijck/Placeholder

Repository files navigation

PromptSafetyMCP

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.

What it does

  1. Scans text for names, emails, phone numbers, SSNs, credit cards, addresses, passwords, and account numbers
  2. Shows a side-by-side original vs. redacted preview
  3. Waits for your explicit approval before sending anything externally
  4. Sends only the redacted text to OpenAI GPT-4
  5. Logs every approval to a local audit trail

Requirements

Installation

1. Add to Claude Desktop config

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.

2. Restart Claude Desktop

Quit and reopen Claude Desktop. You should see a hammer icon indicating 4 tools are available.

Tools

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

Usage

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.

Configuration

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

Windows

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors