Skip to main content
Glama

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.
-
security - not tested
F
license - not found
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

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

  1. Quickstart
    1. Endpoints
    2. MCP server
    3. Notes

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/apasupul/mcp_presidio_server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server