About Lucairn Privacy Gateway
Lucairn Privacy Gateway provides an MCP server and SDKs that detect and replace personal data before requests reach an upstream LLM, then return a signed compliance certificate. It is for agent applications that need an auditable redaction path.
Key features
- 01Detect and replace prompt PII before forwarding
- 02Route to Anthropic or OpenAI by model name
- 03Forward caller-provided upstream keys
- 04Return signed compliance certificates
- 05Provide TypeScript, Python, and Go SDKs
Use cases
- 01Redact user data before an agent calls an LLM
- 02Keep verifiable records of redaction for model requests
- 03Route requests using an own upstream provider key
MCP support
Its MCP server exposes gateway chat through the chat_via_lucairn tool. An MCP client can configure the server to sanitize requests through Lucairn before forwarding them to an upstream LLM.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
npx -y @lucairn/mcp-serverLUCAIRN_API_KEYSecretLucairn gateway API key (lcr_live_*). Issued at https://lucairn.eu/account/keys. Free tier requires BYOK upstream LLM keys (ANTHROPIC_API_KEY or OPENAI_API_KEY).ANTHROPIC_API_KEYSecretUpstream Anthropic API key. Used when the requested model is claude-* / anthropic-*. Required if you call Claude models on the free tier (BYOK).OPENAI_API_KEYSecretUpstream OpenAI API key. Used when the requested model routes to OpenAI. Required if you call OpenAI models on the free tier (BYOK).LUCAIRN_BASE_URLOverride the gateway URL. Defaults to https://gateway.lucairn.eu (production). Set this to point at a self-hosted Lucairn deployment.LUCAIRN_TRANSPORTTransport mode for the MCP server. One of 'direct-http' (default; v1.1+ behavior) or 'stdio-bridge' (v1.2+ opt-in).Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.
Tools
1Saved tool list · updated 2w ago
| Parameter | Type | Required | Description |
|---|---|---|---|
| max_tokens | number | Yes | Maximum tokens to generate in the response. Required by the Anthropic Messages API. |
| messages | array | Yes | Conversation messages. Each item is { role: "user" | "assistant", content: string | array }. |
| model | string | Yes | Model identifier. Routing rules: `claude-*` and `anthropic-*` route to Anthropic via ANTHROPIC_API_KEY; `gpt-*`, `openai-*`, `o1-*`, `o3-*`, and `o4-*` route to OpenAI via OPENAI_API_KEY. Examples: `claude-sonnet-4-6`, `gpt-4o-mini`, `o3-mini`. Set one or both of ANTHROPIC_API_KEY and OPENAI_API_KEY in your MCP client env for BYOK; matching is case-insensitive. |
| system | any | No | Optional system prompt. May be a string or an array of content blocks. Sanitization policy is per-API-key on the gateway side (sanitize or passthrough_audit). |
| temperature | number | No | Optional sampling temperature (0..1). |
Details
From the project READMELucairn SDKs
Official client libraries for Lucairn — an EU-based privacy-preserving AI gateway. Lucairn sits between your application (or AI agent) and the upstream LLM provider you choose, removes personal data from prompts before the model ever sees them, and returns a signed Lucairn Certificate proving what was redacted, when, and by which sanitizer layer.
This monorepo hosts four packages at parity:
@lucairn/mcp-server— Model Context Protocol server (one-linenpxinstall for Claude Desktop, Cursor, Cline, Continue, …)@lucairn/sdk— TypeScript / Node SDKlucairn— Python SDKgithub.com/declade/lucairn-sdks/go— Go SDK
Quick start (MCP)
For most agent use cases, the fastest path is the MCP server. No build step, no install — npx runs it on demand:
npx -y @lucairn/mcp-server
Add it to your MCP client config (Claude Desktop's claude_desktop_config.json, Cursor's mcp.json, Cline's cline_mcp_settings.json, Continue, etc.):
{
"mcpServers": {
"lucairn": {
"command": "npx",
"args": ["-y", "@lucairn/mcp-server"],
"env": {
"LUCAIRN_API_KEY": "<your_lucairn_api_key>",
"ANTHROPIC_API_KEY": "<optional_byok_anthropic_key>",
"OPENAI_API_KEY": "<optional_byok_openai_key>"
}
}
}
}
Restart your client. The chat_via_lucairn tool becomes available immediately. See mcp-server/README.md for full details.
What it does
Each request through any Lucairn SDK follows the same pipeline:
- PII detection runs on every user message in three layers:
- Layer 1 — Known-entity matching (your tenant's named entities)
- Layer 2 — Presidio NER (names, emails, IBANs, addresses, phone numbers, customer IDs, …)
- Layer 3 — GPU-hosted custom-trained PII shield (Enterprise tier only, optionally trained on your domain corpus)
- Detected PII is replaced with placeholders (
[PERSON_1],[EMAIL_2],[IBAN_3], …) before the request reaches the upstream LLM. - The selected upstream model sees only the sanitized text. It never receives raw personal data.
- The response is returned with a signed compliance certificate (Ed25519 witness signature + RFC 3161 timestamp + Sigstore Rekor inclusion proof).
- Response handling depends on tier:
- Developer (free) — placeholders are returned verbatim. Useful for testing the redaction surface.
- Pro / Enterprise — placeholders are re-linked back to the originals on the gateway before the response reaches your application.
For Lucairn-hosted Developer-tier callers, on-gateway pseudonymization happens before your LLM sees the request. Enterprise self-host deployments can run the entire stack inside the customer environment, in which case no raw identity data leaves that environment at all.
Provider routing
The gateway picks the upstream provider from the model parameter you send:
| Model prefix | Upstream provider | BYOK env var |
|---|---|---|
claude-*, anthropic-* | Anthropic | ANTHROPIC_API_KEY |
gpt-*, openai-*, o1-*, o3-*, o4-* | OpenAI | OPENAI_API_KEY |
Cross-provider BYOK shipped in @lucairn/[email protected] — set one or both keys in the same MCP config and the server forwards the matching one as X-Upstream-Key per request, so your provider account is billed directly.
Per-language SDKs
| Language | Package | Version | README |
|---|---|---|---|
| MCP server | @lucairn/mcp-server | 1.2.7 | mcp-server/README.md |
| TypeScript | @lucairn/sdk | 1.1.1 | ts/README.md |
| Python | lucairn | 1.4.1 | python/README.md |
| Go | github.com/declade/lucairn-sdks/go | v1.3.1 | go/README.md |
All SDKs are at parity at the observable level. Cross-language byte-equivalence is locked via shared Go-assembler-generated fixtures, so a certificate signed via one SDK verifies identically via the other two.
Get an API key
Sign up at https://lucairn.eu/account/signup. Free Developer tier: 500 requests/month, no credit card required.
Pro adds response re-linking, programmatic certificate JSON access, audit-event export, and higher quota. Enterprise adds self-host, BYOK with provider-side billing isolation, and the optional custom-trained PII shield (priced per scope).
See https://lucairn.eu/pricing for the full tier comparison.
Verify a response
Every response through any SDK gets a signed Lucairn certificate. Two surfaces:
-
HTML summary — DPO-friendly, available on every tier including Developer (free). Use
getCertificateSummary(TS) /get_certificate_summary(Python) /GetCertificateSummary(Go), or paste the certificate URL into https://lucairn.eu/verify. -
JSON certificate + local Ed25519 verify — Pro tier and above. Use
getCertificate+verifyCertificate(and language equivalents). The verifier is in-tree — seets/src/verify-certificate/,python/src/lucairn/verify_certificate/, and theinternal/verifypackage undergo/. -
Every claim, not only the witness signature —
verifyCertificateChain/verify_certificate_chain/VerifyCertificateChaincheck each claim's own signature against per-service keys you pin, the claim bytes, the typed copies, the signed upstream-request hashes and the unsignedcert_tier. All three return identical results on the shared 98-case corpus intestdata/parity-corpus/. Render and decide only from the returnedverifiedvalues; pass the expected request id so another turn's certificate is refused.
External RFC 3161 + Sigstore Rekor anchor verification is currently surfaced as pass-through metadata; full external anchor verification lands in a follow-up release.
Status
Production packages are versioned independently and tagged per the table above. Cross-language byte-equivalence is locked via shared fixtures. Follow CHANGELOG.md for release notes.
Links
- Main site: https://lucairn.eu
- Sign up (free Developer tier): https://lucairn.eu/account/signup
- Pricing: https://lucairn.eu/pricing
- MCP setup guide: https://lucairn.eu/developer/mcp
- OpenAI SDK setup guide: https://lucairn.eu/developer/openai
- Verify a certificate: https://lucairn.eu/verify
- Glama listing: https://glama.ai/mcp/servers/Declade/lucairn-sdks
- mcp.so listing: https://mcp.so/server/lucairn-privacy-gateway/Declade
- npm —
@lucairn/mcp-server: https://www.npmjs.com/package/@lucairn/mcp-server - npm —
@lucairn/sdk: https://www.npmjs.com/package/@lucairn/sdk - PyPI —
lucairn: https://pypi.org/project/lucairn/
Contributing
See CONTRIBUTING.md. Security reports: SECURITY.md.
License
MIT — see LICENSE.
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.