MCP Integration

Last Updated: 2026-02-11 MCP Server Version: 2.3.1


Table of Contents#

  1. Overview
  2. What is MCP?
  3. Setup
  4. Available Tools
  5. Image Anonymization via MCP
  6. Entity Groups
  7. Custom Recognizers
  8. Troubleshooting

Overview#

cloak.business provides an MCP (Model Context Protocol) server that lets AI tools like Claude Desktop, Cursor, and other MCP-compatible clients anonymize text and images directly within your AI workflow.

Key capabilities:

  • Analyze text for PII entities
  • Anonymize text with replacements, hashing, masking, or encryption
  • Reversible tokenization with session-based deanonymization
  • Image PII detection and redaction via OCR
  • 48 languages, 390+ entity types across 75+ countries, 317 pattern recognizers
  • Custom ad-hoc recognizers for domain-specific entities

What is MCP?#

The Model Context Protocol (MCP) is an open standard that allows AI assistants to interact with external tools and data sources. When you connect cloak.business via MCP, your AI assistant gains the ability to detect and remove personally identifiable information from text and images without leaving your editor or chat interface.


Setup#

Option 1: Streamable HTTP (Cursor, Web Clients)#

No installation required — just add the server URL to your client configuration.

Cursor:

Open Cursor Settings > MCP, then add:

{
  "mcpServers": {
    "cloak-business": {
      "url": "https://cloak.business/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
  }
}

Option 2: stdio Transport (Claude Desktop)#

Claude Desktop uses the stdio transport, running a local process that communicates with the cloak.business API.

Configuration file locations:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Add to your configuration:

{
  "mcpServers": {
    "cloak-business": {
      "command": "npx",
      "args": ["-y", "cloak-business-mcp-server"],
      "env": {
        "cloak_business_API_KEY": "your-api-key-here"
      }
    }
  }
}

After saving, restart Claude Desktop. The cloak.business tools will appear in the tools menu.

Getting Your API Key#

  1. Sign in at cloak.business
  2. Go to Dashboard > API Keys
  3. Create a new API key
  4. Copy and paste into your MCP configuration

Available Tools#

All tool names are prefixed with cloak_business_ for namespace clarity. The MCP server exposes 9 tools:

Text Tools#

ToolDescriptionCost
cloak_business_analyze_textDetect PII entities in textTokens
cloak_business_anonymize_textReplace, hash, mask, or encrypt PIITokens
cloak_business_detokenize_textRestore original values from tokenized textTokens

Image Tools#

ToolDescriptionCost
cloak_business_analyze_imageDetect PII in images via OCR (bounding boxes)Tokens
cloak_business_redact_imageRedact PII from images and return redacted imageTokens

Account Tools#

ToolDescriptionCost
cloak_business_get_balanceCheck token balanceFree
cloak_business_list_sessionsList active tokenization sessionsFree
cloak_business_delete_sessionDelete a tokenization sessionFree

Analyze Text#

Detect PII without modifying the text.

{
  "text": "Contact John Doe at john@example.com, SSN 123-45-6789",
  "language": "en",
  "entity_groups": ["UNIVERSAL", "NORTH_AMERICA"],
  "output": "summary"
}

Anonymize Text#

Replace PII with placeholders or reversible tokens.

{
  "text": "John Doe, email: john@example.com",
  "mode": "redact",
  "operators": {
    "PERSON": { "type": "replace", "new_value": "[REDACTED]" },
    "EMAIL_ADDRESS": { "type": "hash", "hash_type": "SHA256" }
  }
}

Detokenize Text#

Restore original values from a previous tokenization session.

{
  "text": "<<PERSON_abc123>> sent an email from <<EMAIL_ADDRESS_def456>>",
  "sessionId": "session-id-from-anonymize-response"
}

Image Anonymization via MCP#

The MCP server provides two image tools for OCR-based PII detection and redaction.

Analyze Image#

Detect PII entities and return their bounding box positions.

{
  "image": "<base64-encoded-image>",
  "image_format": "png",
  "language": "en"
}

Response:

{
  "entities": [
    { "entity_type": "PERSON", "score": 0.85, "left": 24, "top": 31, "width": 159, "height": 35 },
    { "entity_type": "EMAIL_ADDRESS", "score": 1.0, "left": 25, "top": 81, "width": 284, "height": 35 }
  ],
  "entities_found": 2,
  "tokens_charged": 3
}

Redact Image#

Detect and redact PII, returning a base64-encoded redacted image.

{
  "image": "<base64-encoded-image>",
  "image_format": "png",
  "language": "en",
  "fill_color": "black"
}

Response:

{
  "redacted_image": "<base64-encoded-png>",
  "redacted_image_format": "png",
  "tokens_charged": 3
}

Supported Formats#

PNG, JPEG, BMP, and TIFF. Maximum file size: 10 MB.

OCR Languages#

37 languages are supported for OCR text extraction. Set the language parameter to an ISO 639-1 code (e.g., "de" for German, "ja" for Japanese). See the Image Anonymization guide for the full list.


Entity Groups#

Use entity_groups to detect regional entity sets without listing individual types:

GroupCovers
UNIVERSALPERSON, EMAIL, PHONE, LOCATION, URL, IP, DATE_TIME
FINANCIALCREDIT_CARD, IBAN, SWIFT, CRYPTO
DACHGermany, Austria, Switzerland IDs and tax numbers
FRANCEFrench NIR, CNI, Belgian and Luxembourg IDs
SPAIN_LATAMSpain, Mexico, Argentina, Chile, Colombia IDs
ITALYItalian fiscal code, VAT, driver license, health card
PORTUGAL_BRAZILPortuguese and Brazilian IDs
NORDICDenmark, Finland, Sweden, Norway, Iceland IDs
POLANDPESEL, NIP, REGON, passport
UK_IRELANDNHS, NINO, PPS, UK passport
NORTH_AMERICAUS SSN, US passport, Canadian SIN
ASIA_PACIFICJapan, China, Singapore, Australia, India IDs
MIDDLE_EASTUAE, Saudi, Israel IDs
HEALTHCAREMedical license, NRP, health insurance ID

Custom Recognizers#

Define ad-hoc pattern recognizers for domain-specific entities:

{
  "text": "Employee ID: EMP-12345, Badge: B-9876",
  "ad_hoc_recognizers": [
    {
      "entity_type": "EMPLOYEE_ID",
      "patterns": [{ "regex": "EMP-\\d{5}", "score": 0.9 }],
      "context": ["employee", "staff"]
    },
    {
      "entity_type": "BADGE_NUMBER",
      "patterns": [{ "regex": "B-\\d{4}", "score": 0.85 }]
    }
  ]
}

Custom recognizers are processed alongside the built-in 317 pattern recognizers. The backend enforces per-request limits: max 50 ad-hoc recognizers, 10 patterns per recognizer, and 200 total ad-hoc patterns. Use the GET /limits endpoint to discover current limits programmatically.


Troubleshooting#

Common Issues#

ProblemSolution
"Unauthorized" errorCheck your API key is valid and correctly set in the configuration
Tools not appearing in Claude DesktopRestart Claude Desktop after saving config. Check config file path.
"Feature not available" errorImage redaction requires a Basic plan or above
Slow image processingLarge images take longer. Keep images under 5 MB for faster results.
"Invalid base64" errorEnsure the image is base64-encoded without the data:image/...;base64, prefix

Verifying Your Setup#

Ask your AI assistant to run cloak_business_get_balance — if it returns your token balance, the connection is working.

Support#


Document maintained by cloak.business