Skip to main content
Glama
MCP Presidio Server

MCP Presidio Server

by apasupul

MCP Presidio Server (Anonymize/Deanonymize)

This project exposes the same functionality via MCP tools and FastAPI endpoints.

Quickstart

python -m venv .venv && source .venv/bin/activate  # on Windows: .venv\Scripts\activate
pip install -r requirements.txt
uvicorn app.main:app --reload

Endpoints

  • POST /session -> { "session_id": "<uuid>" }

  • POST /anonymize body:

{
  "session_id": "uuid",
  "messages": [{"content": "Secret is 123, password=foo"}]
}

returns anonymized messages and stores mapping for the session.

  • POST /deanonymize body:

{
  "session_id": "uuid",
  "text": "<<CUSTOM_TOKEN_0>> is 123, <<pass_pattern_...>>"
}

MCP server

Run the stdio MCP server:

python mcp_server/server.py

Register it in your MCP-compatible client pointing to this command.

Notes

  • Storage uses SQLite at app/data.db with tables sessions and mappings.

  • Custom patterns mirror the code you provided; add more Presidio recognizers as needed.

  • Placeholders look like <<ENTITY_#>> and are reversible per session_id.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      Enables AI assistants to mask sensitive personal data and project directories before sending to AI, then unmask responses to restore original values using configurable swap sessions.
      7
      MIT
    • A
      license
      B
      quality
      B
      maintenance
      Enables local grammar-preserving masking of sensitive content, entities, and code identifiers into synthetic tokens before sending prompts to LLMs, then restores the original text and symbols from responses using session-scoped in-memory mappings.
      5
      2
      Apache 2.0
    • A
      license
      B
      quality
      B
      maintenance
      Enables local, in-memory de-identification of PII, PHI, and credentials with deterministic reversible surrogate tokens before LLM transmission, then restores originals from volatile session mappings and audits for exposures without network egress or disk writes.
      5
      115 npm
      1
      Apache 2.0

    Appeared in Searches