FPE Demo MCP

FPE Demo MCP

FF3 Format Preserving Encryption with authentication patterns for secure data protection in LLM workflows.

0
Stars
1
Forks
2
Releases

Overview

FPE Demo MCP is a lightweight MCP (Model Context Protocol) server that demonstrates authentication and format-preserving encryption using FF3 over decimal digits in a clear, readable implementation. The server exposes two tools via MCP JSON-RPC: fpe_encrypt, which takes a numeric string and returns a ciphertext payload prefixed with ENC_FPE:, and fpe_decrypt, which reverses it. FF3 FPE operates on radix-10 digits; input is normalized to digits before encryption and the resulting ciphertext is returned with a visually obvious ENC_FPE: prefix for logs and demos. The server supports multiple authentication modes: authless and debug for quick testing; test mode accepts either a shared secret or JWT; production mode requires JWT only. JWT signing uses HS256 by default, with optional issuer and audience validation. FPE configuration is provided via environment variables (FPE_KEY and FPE_TWEAK). The server can run via stdio (local) or HTTP transports, enabling use with local LLM clients or web-based playgrounds. A quick deploy flow is provided for DigitalOcean App Platform, giving a public URL for testing with web-based LLMs, while the local testing instructions show how to run the stdio and HTTP servers. The demo emphasizes learning, prototyping, and understanding MCP authentication and FF3 FPE integration.

Details

Owner
Horizon-Digital-Engineering
Language
TypeScript
License
Other
Updated
2025-12-07

Features

FF3 FPE over digits (radix-10)

Format-preserving encryption over decimal digits using FF3.

MCP authentication modes

Supports authless, debug, test (shared secret or JWT), and production (JWT only).

ENC_FPE prefix

Encrypted outputs are prefixed with ENC_FPE: for clear visibility in logs and demos.

MCP endpoints fpe_encrypt and fpe_decrypt

Exposes two tools via MCP JSON-RPC: fpe_encrypt and fpe_decrypt.

Multiple transports

Supports stdio (local) and HTTP transports for MCP communication.

Input normalization

Normalizes input to digits (radix-10) before encryption.

Configurable FPE keys

FPE configuration via environment: FPE_KEY and FPE_TWEAK.

Deployment ready (DigitalOcean)

Includes quick deploy workflow to DigitalOcean App Platform with HTTPS and a public MCP URL.

Audience

LLM developersSecurely call external tools via MCP in local or remote workloads.
Security researchersStudy FF3 FPE integration with MCP and authentication models in practice.
EducatorsTeach MCP concepts with hands-on encryption, authentication modes, and transport testing.
DevOpsDeploy and test MCP in local or cloud environments easily.

Tags

FF3 FPEdigitsradix-10MCPauthenticationJSON-RPCstdioHTTPencryptionlogsJWT