MCP Server
The Expunct MCP server (@expunct/mcp) exposes all redaction capabilities as tools for Claude Code, Claude Desktop, and any MCP-compatible client.
Package: @expunct/mcp on npm
Quick Setup
Add the following to .mcp.json in your project root, or to ~/.claude/.mcp.json for global access:
{
"mcpServers": {
"expunct": {
"command": "npx",
"args": ["@expunct/mcp"],
"env": {
"EXPUNCT_API_KEY": "pk_live_...",
"EXPUNCT_BASE_URL": "https://api.expunct.ai"
}
}
}
}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 |
|---|---|---|---|
EXPUNCT_API_KEY | Yes | — | API key (pk_live_... or pk_test_...) |
EXPUNCT_BASE_URL | No | https://api.expunct.ai | API endpoint URL |
Available Tools
| Tool | Description | Sync |
|---|---|---|
expunct_sanitize_text | Redact PII from text (27+ entity types) | Yes |
expunct_sanitize_file | Submit file/URI for async redaction | No |
expunct_sanitize_batch | Batch redact 1-100 URIs | No |
expunct_check_status | Poll job progress | Read-only |
expunct_list_entity_types | List all supported entity types | Read-only |
expunct_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 expunct_sanitize_text and return:
"[PERSON] lives at [ADDRESS]"For file-based redaction, Claude will automatically use the async workflow — submitting the file with expunct_sanitize_file, then polling with expunct_check_status until the job completes.
Troubleshooting
- “Tool not found” errors — Make sure the MCP server is running. Check
npx @expunct/mcpruns without errors. - Authentication failures — Verify your API key starts with
pk_live_orpk_test_and is valid. - Connection refused — If self-hosting, confirm
EXPUNCT_BASE_URLpoints to your running instance.