MCP Server
The PII Firewall MCP Server integrates directly with Claude Desktop and AI agent pipelines, providing privacy protection as a native tool.
Coming Soon
@pii-firewall/mcp-server is not yet published to npm. Apply for early access to get notified when it's available.
What is MCP?
Model Context Protocol (MCP) is an open standard by Anthropic that allows AI models to use external tools. The PII Firewall MCP Server exposes 6 tools that Claude can call automatically.
Available Tools
| Tool | Description |
|---|---|
detect_pii | Detect PII types and locations in text |
mask_pii | Mask PII and return a token map |
restore_pii | Restore a single masked token |
restore_all | Restore all tokens in a response |
detect_injection | Detect prompt injection attempts |
store_status | Check session and credit status |
Installation
Claude Desktop
- Install the MCP Server globally:
npm install -g @pii-firewall/mcp-server- Open your Claude Desktop config file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
- Add the PII Firewall server:
{
"mcpServers": {
"pii-firewall": {
"command": "npx",
"args": ["-y", "@pii-firewall/mcp-server"],
"env": {
"PII_FIREWALL_API_KEY": "YOUR_API_KEY",
"PII_FIREWALL_LANG": "en"
}
}
}
}Restart Claude Desktop
You will see a 🔌 icon indicating the MCP Server is connected
Usage in Claude Desktop
Once installed, you can ask Claude to protect your data naturally:
"Mask the PII in this text before we continue: My name is Alice and my email is alice@corp.com"
Claude will automatically call mask_pii and proceed with the masked version.
"Restore the original values in Claude's last response"
Claude will call restore_all to replace tokens with your original data.
Usage in Agent Pipelines
import { MCPClient } from '@modelcontextprotocol/sdk/client'
const client = new MCPClient()
await client.connect(/* your transport */)
// Mask PII before passing to agent
const maskResult = await client.callTool('mask_pii', {
text: userInput,
lang: 'en',
})
// Agent processes masked text
const agentResponse = await runAgent(maskResult.masked)
// Restore PII in agent response
const restoreResult = await client.callTool('restore_all', {
text: agentResponse,
sessionId: maskResult.sessionId,
})Environment Variables
| Variable | Required | Description |
|---|---|---|
PII_FIREWALL_API_KEY | ✅ | Your API key |
PII_FIREWALL_LANG | en or ja (default: en) | |
PII_FIREWALL_BASE_URL | Override API endpoint |
