Fayda MCP Python Library (fayda-mcp)
An importable, headless Python library providing Model Context Protocol (MCP) tools and verification services for Ethiopian National ID (Fayda eSignet).
Key Capabilities
- Explicit FastMCP Tools:
start_verification,get_verification_status,get_verification_result,cancel_verification. - Zero Raw Demographic / Biometric Leaks: Outputs minimal boolean predicates (
identity_verified,age_over_18), strictly forbidding citizen biometrics, OTPs, or demographic dumps from entering LLM contexts. - Cryptographic Security: OIDC PKCE S256, RFC 7523
private_key_jwtclient assertions, and strict JWT signature/nonce validation. - Pluggable Architecture: Zero mandatory database or web framework runtime dependencies in core; optional extras for FastAPI, Redis, and Neon/PostgreSQL.
- Multi-Tenant Caller Isolation: Built-in tenant and principal boundaries ensuring Caller A cannot access Caller B verification records.
Installation
# Core library (headless FastMCP + Fayda OIDC verification engine)
pip install fayda-mcp
# With optional FastAPI integration
pip install "fayda-mcp[fastapi]"
# Full bundle with Redis and Neon/Postgres adapters
pip install "fayda-mcp[fastapi,redis,postgres]"
Quick Start (Sandbox)
from fayda_mcp import FaydaConfig, FaydaVerificationService
from fayda_mcp.storage.memory import MemorySessionStore, MemoryResultRepository
from fayda_mcp.mcp.factory import create_mcp_server
# 1. Configure with official Fayda sandbox preset
config = FaydaConfig.sandbox(
client_id="your_registered_client_id",
redirect_uri="http://localhost:8000/auth/fayda/callback",
)
# 2. Initialize verification service
service = FaydaVerificationService(
config=config,
sessions=MemorySessionStore(),
results=MemoryResultRepository(),
)
# 3. Create FastMCP server
server = create_mcp_server(service=service)
# 4. Run over stdio (e.g. for Claude Desktop or Cursor)
server.run(transport="stdio")
Running the Complete Sandbox Flow
Run the included standalone sandbox walkthrough:
python examples/sandbox_flow.py
This runs the entire end-to-end lifecycle (starts verification -> builds authorization link -> simulates citizen callback -> queries status -> retrieves privacy-preserving boolean result -> verifies caller isolation) without editing library internals.
Examples
- Local Standard I/O (stdio): examples/stdio_server.py (Desktop LLM clients, Claude Desktop, Cursor)
- Remote HTTP Server: examples/remote_http_server.py (Hosted streamable-HTTP / SSE MCP endpoints with FastAPI)
- Full Sandbox Walkthrough: examples/sandbox_flow.py
Documentation
- Architecture & Responsibilities
- Configuration Guide & Environment Variables
- Callback Wiring & Session Binding
- Credential Ownership & Cryptography
- Cleanup & Lifecycle Management
License
MIT License. See LICENSE for details.
Metadata
Release files for fayda-mcp 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fayda_mcp-0.1.0.tar.gz | 125.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fayda_mcp-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 160.0 kB
Release files / fayda_mcp-0.1.0.tar.gz
| Download URL | fayda_mcp-0.1.0.tar.gz |
|---|---|
| Size | 125.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
692bbcb8831f0e3eb006ec0e5a8977d53bccc130cea7176287febda388b1c8b3
|
|
BLAKE2b-256 checksum How to use checksums |
678405d00ef185c1845cad2ce163e20a53886a5a95fda1199b14bff0c6460457
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / fayda_mcp-0.1.0-py3-none-any.whl
| Download URL | fayda_mcp-0.1.0-py3-none-any.whl |
|---|---|
| Size | 34.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7391bc2c91403588cd0bc6e4b96e1b0e3634803839b4f6ccf0be49d3f25b816d
|
|
BLAKE2b-256 checksum How to use checksums |
7b43e221db5ab649d45958f015c780270a1f932779f878b48f9f09c7b2a74ef1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|