MCP Server
The Expunct MCP server (@pii-redactor/mcp) exposes all redaction capabilities as tools for Claude Code, Claude Desktop, and any MCP-compatible client.
Package: @pii-redactor/mcp on npm
Quick Setup
Add the following to .mcp.json in your project root, or to ~/.claude/.mcp.json for global access:
{
"mcpServers": {
"pii-redactor": {
"command": "npx",
"args": ["@pii-redactor/mcp"],
"env": {
"PII_REDACTOR_API_KEY": "pk_live_...",
"PII_REDACTOR_BASE_URL": "https://api.pii-redactor.dev"
}
}
}
}For Claude Desktop, add the same configuration to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows).
Configuration
| Environment Variable | Required | Default | Description |
|---|---|---|---|
PII_REDACTOR_API_KEY | Yes | — | API key (pk_live_... or pk_test_...) |
PII_REDACTOR_BASE_URL | No | https://api.pii-redactor.dev | API endpoint URL |
Available Tools
| Tool | Description | Sync |
|---|---|---|
pii_redactor_sanitize_text | Redact PII from text (27+ entity types) | Yes |
pii_redactor_sanitize_file | Submit file/URI for async redaction | No |
pii_redactor_sanitize_batch | Batch redact 1-100 URIs | No |
pii_redactor_check_status | Poll job progress | Read-only |
pii_redactor_list_entity_types | List all supported entity types | Read-only |
pii_redactor_get_findings | Get detected PII for a completed job | Read-only |
Example Usage in Claude Code
> Redact PII from this text: "John Smith lives at 123 Main St"
Claude will use pii_redactor_sanitize_text and return:
"[PERSON] lives at [ADDRESS]"For file-based redaction, Claude will automatically use the async workflow — submitting the file with pii_redactor_sanitize_file, then polling with pii_redactor_check_status until the job completes.
Troubleshooting
- “Tool not found” errors — Make sure the MCP server is running. Check
npx @pii-redactor/mcpruns without errors. - Authentication failures — Verify your API key starts with
pk_live_orpk_test_and is valid. - Connection refused — If self-hosting, confirm
PII_REDACTOR_BASE_URLpoints to your running instance.