Skip to content

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

ToolDescription
detect_piiDetect PII types and locations in text
mask_piiMask PII and return a token map
restore_piiRestore a single masked token
restore_allRestore all tokens in a response
detect_injectionDetect prompt injection attempts
store_statusCheck session and credit status

Installation

Claude Desktop

  1. Install the MCP Server globally:
bash
npm install -g @pii-firewall/mcp-server
  1. Open your Claude Desktop config file:
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  1. Add the PII Firewall server:
json
{
  "mcpServers": {
    "pii-firewall": {
      "command": "npx",
      "args": ["-y", "@pii-firewall/mcp-server"],
      "env": {
        "PII_FIREWALL_API_KEY": "YOUR_API_KEY",
        "PII_FIREWALL_LANG": "en"
      }
    }
  }
}
  1. Restart Claude Desktop

  2. 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

typescript
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

VariableRequiredDescription
PII_FIREWALL_API_KEYYour API key
PII_FIREWALL_LANGen or ja (default: en)
PII_FIREWALL_BASE_URLOverride API endpoint

Privacy by Design.