Skip to main content

Zero-egress PII protection for Mistral Le Chat workflows via MCP stdio

Project description

Ocultar PII Refinery — Mistral Le Chat MCP Extension

Zero-egress PII protection for Mistral Le Chat workflows. Runs entirely in your infrastructure — no data ever leaves your environment.

Optimised for French and EU compliance: SIRET/SIREN, IBAN, RGPD Article 25, CNIL requirements.

Tools

Tool Description
refine_text Redacts PII / DCP before sending text to Le Chat. Returns clean text + token map.
reveal_tokens De-tokenizes tokens back to plaintext (auditor-only, requires OCULTAR_AUDITOR_TOKEN).

Prerequisites

  • Ocultar Refinery running locally:
    docker compose -f docker-compose.community.yml up
    
  • Python 3.10+

Installation

pip install ocultar-mistral-mcp

Or with uvx (no install needed):

uvx ocultar-mistral-mcp

Mistral Le Chat Configuration

In Mistral Le Chat, open Settings → Tools → MCP Servers and add:

{
  "mcpServers": {
    "ocultar-pii": {
      "command": "ocultar-mistral-mcp",
      "env": {
        "OCULTAR_URL": "http://localhost:8080",
        "OCULTAR_API_KEY": "your-api-key"
      }
    }
  }
}

Or with uvx (no prior install required):

{
  "mcpServers": {
    "ocultar-pii": {
      "command": "uvx",
      "args": ["ocultar-mistral-mcp"],
      "env": {
        "OCULTAR_URL": "http://localhost:8080",
        "OCULTAR_API_KEY": "your-api-key"
      }
    }
  }
}

Environment Variables

Variable Required Description
OCULTAR_URL Yes URL of your local Ocultar Refinery (default: http://localhost:8080)
OCULTAR_API_KEY No Bearer token for Refinery auth
OCULTAR_AUDITOR_TOKEN No Enables reveal_tokens — must match OCU_AUDITOR_TOKEN on the server

Usage

Once connected, Le Chat will automatically call refine_text before processing sensitive data. You can also invoke it explicitly:

"Avant de traiter ce texte, filtre les DCP : Jean Dupont, jean.dupont@banque.fr, IBAN FR76 3000 6000 0112 3456 7890 189"

Le Chat returns:

{
  "cleanText": "[NAME_a1b2c3d4], [EMAIL_9c8f7a1b], IBAN [IBAN_7f3e9a2b]",
  "tokenMap": {
    "[NAME_a1b2c3d4]": "NAME",
    "[EMAIL_9c8f7a1b]": "EMAIL",
    "[IBAN_7f3e9a2b]": "IBAN"
  }
}

For authorized workflows that need to restore PII after AI processing:

"Reveal these tokens: [EMAIL_9c8f7a1b], [IBAN_7f3e9a2b]"

This call is recorded in the immutable Ed25519-signed audit log.

Why This Matters for French Enterprises

Sending customer data to any external AI API — including Mistral's cloud — without redaction constitutes a RGPD violation under Article 25 (Privacy by Design). The CNIL has issued enforcement guidance specifically targeting AI pipeline data flows.

Ocultar ensures that:

  • No raw PII ever reaches Le Chat's API endpoint
  • SIRET, SIREN, IBAN, and French address formats are detected and tokenized
  • Every vault access is logged in a tamper-evident, Ed25519-signed audit trail
  • You remain the data controller — Ocultar is a local processor under your full control

Security Model

  • refine_text is safe to expose to any Le Chat session
  • reveal_tokens requires OCULTAR_AUDITOR_TOKEN and every call is logged with actor, timestamp, and Ed25519 signature
  • The Refinery vault uses AES-256-GCM with HKDF-SHA256 key derivation — tokens are useless without the master key
  • If the Refinery is unreachable, both tools fail closed — raw PII is never forwarded

License

Apache 2.0 — see LICENSE

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ocultar_mistral_mcp-0.1.0.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ocultar_mistral_mcp-0.1.0-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file ocultar_mistral_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: ocultar_mistral_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.5 cpython/3.14.4 HTTPX/0.28.1

File hashes

Hashes for ocultar_mistral_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 054317bf56a2d745d98d061ecd889534a79301adebabfe4e7ff3e3444d993591
MD5 afc5b0a4bfc8fe32829cfb88b9d3092d
BLAKE2b-256 af2a6744bddaaf7aac214161b016ca6e6afedcca41e40d5fa76ba87a51605a3a

See more details on using hashes here.

File details

Details for the file ocultar_mistral_mcp-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ocultar_mistral_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a9d22d4a7bf5658bcfbf3938590e513b114f16964ee7ec64d9802bec4fe9a4aa
MD5 127f2c6fa612f0c71a0ba535a092a1b7
BLAKE2b-256 26dbd4bea042274b6eaccf3ac7900777553215aa38ed8c16e287ef47beda4578

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page