FastAPI MCP Production Kit
Provides a safety kit for turning internal FastAPI HTTP APIs into controlled MCP tools, with features like per-tool scopes, quotas, audit events, and web-access boundaries.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
FastAPI MCP Production Kit
A local-first FastAPI and MCP safety kit for turning internal HTTP APIs into controlled MCP tools.
Most MCP examples show how to expose a tool. This repo focuses on what teams need before agents can use those tools safely: local credentials, per-tool scopes, quota checks, audit events, web-access boundaries, fallback decisions, and a quickstart that works without paid services.
This kit helps you answer:
Which FastAPI capabilities should become MCP tools?
How do tool calls prove identity before doing work?
How do different tools get different scopes?
How do quotas and audit events work before remote deployment?
How do web-access tools default to deny instead of arbitrary outbound access?
Ships today:
FastAPI app factory with
/healthz, tool discovery, demo token, and tool-call endpointsLocal MCP-style tool dispatcher with three tools
HMAC-signed local demo tokens
Per-tool scope checks
Deterministic in-memory quotas
Structured audit events and JSONL fixture generation
Default-deny web-access fixture boundary
Provider fallback decision record helper
Pytest coverage for auth, scopes, quotas, audit, boundaries, fallback, and tool calls
Public boundary scan script
Production docs map for security, scopes, audit, quotas, deployment, web access, fallback, observability, and troubleshooting
Quickstart
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -e '.[dev]'
pytest
python examples/local-only-demo/demo_client.pyRun the FastAPI app:
uvicorn prodkit_mcp.app:app --reloadList available tools:
curl -s http://127.0.0.1:8000/toolsCreate a demo token:
curl -s http://127.0.0.1:8000/demo/token \
-H 'content-type: application/json' \
-d '{"subject_id":"local-developer","scopes":["project:read","docs:search","web:fetch"]}'Call a tool:
curl -s http://127.0.0.1:8000/tools/read_project_status \
-H "authorization: Bearer $ACCESS_TOKEN" \
-H 'content-type: application/json' \
-d '{"arguments":{}}'Generate audit fixtures:
python scripts/generate_audit_fixtures.pyRun the public boundary scan:
python scripts/scan_public_boundary.pyRelated MCP server: mcp-auth-kit
Tool Model
Tool | Scope | Purpose |
|
| Reads a synthetic project status record |
|
| Searches bundled documentation fixtures |
|
| Fetches only reviewed safe page fixtures |
What This Is Not
This is not a hosted MCP platform, a broad server directory, a production security review, or an arbitrary web-access tool. It is a local reference kit for making MCP tool exposure easier to reason about before remote deployment.
Production Guides
Optional MCP SDK Adapter
The default quickstart uses the local dispatcher so the safety path is easy to
test in CI. If you install the optional mcp extra, prodkit_mcp.mcp_server
can create a FastMCP server wrapper around the same tools.
python -m pip install -e '.[mcp,dev]'License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Host any HTTP API as MCP tools with a tamper-evident cross-agent settlement ledger.
Open-source MCP gateway with per-agent tool permissions, call approvals and tool-change review.
AgentGuard — 20-tool AI safety MCP: policy preflight, risk scoring, audit logging, rate limits.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables LLM-powered agents to securely communicate with and orchestrate downstream microservices via FastAPI endpoints exposed as MCP tools.-
- AlicenseNot gradedqualityBmaintenanceA production-minded MCP server kit that provides OAuth 2.1/PKCE authentication, rate limiting, scope-gated tools, and two-phase confirmation for building secure MCP servers with custom tools, identity, and storage.8 npmMIT
- AlicenseNot gradedqualityDmaintenanceAn enterprise MCP server scaffold that provides secure, governed access to internal tools through RBAC, audit logging, rate limiting, and prompt-injection boundaries, with a FastAPI control plane and OpenTelemetry observability.MIT
- AlicenseNot gradedqualityBmaintenanceTurns existing FastAPI routes (or any OpenAPI spec) into owner-approved MCP tools served from one governed endpoint, keeping tools hidden until an owner reviews a diff and enables them. Agents get incremental discovery via meta-tools, response field projection, per-caller API-key policy, PII redaction, and a JSON-lines audit log.37 PyPI1MIT