opami-protect-mcp
OfficialClick on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@opami-protect-mcp protect the personal data in this client email before I forward it"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
opami-protect-mcp
An MCP server that lets Claude Code, Cursor, Codex and other MCP clients use Opami Protect to hide private and sensitive data in text and local text files. It runs locally over stdio.
Before you start
Node.js 22 or newer.
An API key from the console: https://console.opami.ai
Related MCP server: CloakLLM MCP Server
Add it to your client
Claude Code
claude mcp add opami-protect -e OPAMI_API_KEY=YOUR_OPAMI_API_KEY -- npx -y opami-protect-mcpRun it in the project folder; add --scope user (before --) to use it in every project.
Cursor
Put this in .cursor/mcp.json:
{
"mcpServers": {
"opami-protect": {
"command": "npx",
"args": ["-y", "opami-protect-mcp"],
"env": { "OPAMI_API_KEY": "YOUR_OPAMI_API_KEY" }
}
}
}Put the same block in ~/.cursor/mcp.json to use it in every project, and never commit a file that holds your key.
Codex
Put this in ~/.codex/config.toml:
[mcp_servers.opami-protect]
command = "npx"
args = ["-y", "opami-protect-mcp"]
env = { OPAMI_API_KEY = "YOUR_OPAMI_API_KEY" }After adding it, the client lists four tools: protect_text, protect_file, detect_pii, restore_text.
Tools
protect_text: inputstext, optionalexclude(at most 50),output("placeholders"by default, or"replace") andreturn_map. Returns the text with placeholders such as[PERSON_1]and amap_id.output: "replace"puts fake data in instead. It works in 7 languages, costs twice as much and cannot be restored.protect_file: inputspathand optionalexclude. Reads a UTF-8 text file of up to 1 MB inside the workspace folders the client shares. Paths outside them are refused, including through symlinks. PDF, DOCX and other binary files are refused. The file's content never enters the model's context. If the client shares no workspace folders, every path is refused, so useprotect_text.detect_pii: inputstextand optionalexclude. Returns each detection'stext,type,start,end(UTF-16 indices) andentity_id, plus usage. The detections include the real values.restore_text: inputstextandmap_id. Puts the real values back from the map the server kept. Runs locally, with no network call.
Privacy
Text (and file text) is sent to the Opami Protect API, which keeps nothing.
Placeholders are pseudonymisation, not anonymisation: they can be reversed.
The placeholder map (the real values) stays in the server's memory for the session and is never written to disk. It is returned to the agent only when
return_mapis true. A restart drops every map.The server logs no text, detections, placeholders or keys, and sends no telemetry.
Errors
Failures come back as tool errors with the API error code, message, request id and, when there is one, the time to wait before retrying.
Links and licence
MIT, see
LICENSE.
Available Tools
4 toolsdetect_piiA
Finds private and sensitive data (names, emails, phone numbers and similar) in a text and returns each one with its type and position, without changing the text. The text is sent to the Opami Protect API, which keeps nothing. Each detection includes the real value, so the result shows the private data to you; use protect_text instead to avoid seeing it. start and end are UTF-16 code units, as JavaScript string indices, so text.slice(start, end) gives the value. exclude takes at most 50 entries.
Inputs: text (required), exclude. Returns: usage, detections, request_id
protect_fileA
Hides private and sensitive data (names, emails, phone numbers and similar) in a local UTF-8 text file without putting the file's content in your context. Pass the file's path inside the workspace folders your client shares. The server reads the file itself and sends its text to the Opami Protect API, which keeps nothing. It returns the text with placeholders such as [PERSON_1] and a short map_id. This is pseudonymisation, and it can be reversed: the server keeps the placeholder map in its own memory for this session, and restore_text with that map_id puts the real values back. The real values stay in the server: protect_file has no return_map, so they and the map are never in the result. Text files of up to 1 MB only; PDF, DOCX and other binary files are refused. Files outside the workspace folders are refused, including through symlinks.
Inputs: path (required), exclude. Returns: usage, map_id, request_id, placeholder_text, +1 more
protect_textA
Hides private and sensitive data (names, emails, phone numbers and similar) in a text by replacing them with placeholders such as [PERSON_1]. The text is sent to the Opami Protect API, which keeps nothing. This is pseudonymisation, and it can be reversed: the server keeps the placeholder map in its own memory for this session and returns a short map_id, and restore_text with that map_id puts the real values back. The real values stay in the server and out of the result unless return_map is true. output: "replace" swaps in fake data instead; it works in 7 languages, costs twice as much and cannot be restored.
Inputs: text (required), output, exclude, return_map. Returns: usage, map_id, output, request_id, +4 more
restore_textARead-onlyIdempotent
Puts the real details back into a text that holds placeholders, using the placeholder map the server kept for a map_id from protect_text or protect_file. It runs locally: no network call and no API key. The result contains the real private and sensitive data, so call it only when you need them. Placeholders that are not in this map (for example from another map_id, or edited) stay as written. The result gives restored_count and not_found_count, so check not_found_count before you use the text. The maps live only in this server's memory: after a restart the map is gone, so protect the text again.
Inputs: text (required), map_id (required). Returns: restored_text, restored_count, not_found_count
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool has a clearly distinct action: protect_text and protect_file differ only by input source and the descriptions make that boundary explicit, while restore_text and detect_pii are unambiguous opposites (reverse vs. read-only inspection). No two tools could be mistaken for one another.
All four names follow the same snake_case verb_noun pattern (protect_text, protect_file, restore_text, detect_pii) with verbs that accurately reflect the action. Consistent throughout.
Four tools form a tight, complete little surface for a pseudonymisation server: detect, protect (text and file variants), and restore. Every tool earns its place and nothing looks like filler.
The core lifecycle (detect, pseudonymise, restore) is fully covered, including a file variant and an irreversible fake-data mode. Minor gaps remain: no way to list or discard live map_ids, no batch/multi-file operation, and protect_file is limited to UTF-8 text, but agents can work around these.
Related MCP Connectors
Detect and redact PII and secrets before text reaches an LLM, with reversible placeholders.
MCP server for detecting and redacting PII (Personally Identifiable Information) in PDF documents.
Mask, restore and black out personal data in text and files, processed in the EU.
Stateless PII redaction over MCP/REST. Free ≤1000 words or $0.01/call; file upload supported.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables anonymization and deanonymization of sensitive data in text using Microsoft Presidio. Supports session-based storage to reversibly replace sensitive information like passwords and secrets with placeholder tokens.-
- AlicenseNot gradedqualityBmaintenanceWraps CloakLLM's Python SDK to provide tools for PII detection, cloaking, and restoration within MCP-compatible clients. It enables users to sanitize sensitive data before sending it to an LLM and restore original values using unique token map IDs.56 PyPIMIT
- AlicenseNot gradedqualityDmaintenanceEnables PII detection and anonymization using Microsoft Presidio with tools, resources, and prompts via MCP.MIT
- AlicenseAqualityCmaintenanceLocal pseudonymisation MCP server that detects PII in text, replaces it with opaque tokens before sending to cloud LLMs, and restores tokens afterward.2127 npm2MIT