Repository avatar
Monitoring
v0.1.0
active

opami-protect-mcp

io.github.opamiai/opami-protect-mcp

Hide private and sensitive data in text and local text files with Opami Protect pseudonymisation.

Documentation

opami-protect-mcp

npm

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

Add it to your client

Claude Code

claude mcp add opami-protect -e OPAMI_API_KEY=YOUR_OPAMI_API_KEY -- npx -y opami-protect-mcp

Run 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: inputs text, optional exclude (at most 50), output ("placeholders" by default, or "replace") and return_map. Returns the text with placeholders such as [PERSON_1] and a map_id. output: "replace" puts fake data in instead. It works in 7 languages, costs twice as much and cannot be restored.
  • protect_file: inputs path and optional exclude. 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 use protect_text.
  • detect_pii: inputs text and optional exclude. Returns each detection's text, type, start, end (UTF-16 indices) and entity_id, plus usage. The detections include the real values.
  • restore_text: inputs text and map_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_map is 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

NPM
opami-protect-mcp
Install Command
npm install opami-protect-mcp