Skip to main content

A batteries-included framework for building authenticated, scoped, observable MCP servers on top of FastMCP. Tool registration, scoped auth keys, Prometheus/Grafana observability, multi-tenancy. (Module: `import mcp_toolkit`.)

Project description

mcp-toolkit

CI Security PyPI Python License: MIT

Status: pre-release (0.1.0.dev0). API surface is being shaped; not yet on PyPI. See docs/ROADMAP.md.

A Python framework for building authenticated, scoped, observable MCP (Model Context Protocol) servers.

You bring the tools. mcp-toolkit brings:

  • Tool registry — register tools with @toolkit.tool(...), group them, version them.
  • Scoped auth — bearer tokens carry scopes; list_tools is filtered per caller. Tokens never see tools they can't call.
  • One-click observability — Prometheus metrics auto-registered per tool, Grafana dashboards generated from the registry, docker compose up brings the whole stack live.
  • Multi-tenancy — pluggable tenant resolvers (header / subdomain / token-claim). Per-tenant metric labels enforced at registration.
  • Battle-tested harness — Clara architecture, mypy-strict, 80% coverage gate, bandit + pip-audit + gitleaks + CodeQL, branch protection, PR-from-fork model.

Quick taste

from mcp_toolkit import MCPToolkit

toolkit = MCPToolkit(name="my-server")

@toolkit.tool(group="weather", scopes=["read:weather"])
async def get_weather(city: str) -> dict:
    return {"city": city, "temp_c": 21.0}

@toolkit.tool(group="admin", scopes=["admin"])
async def reset_cache() -> None:
    ...

app = toolkit.build_app()  # FastAPI / FastMCP app; uvicorn-ready

Tokens minted with scopes=["read:weather"] discover and call get_weather. They cannot see reset_cache exists.

Why not just FastMCP?

FastMCP gives you the MCP wire protocol and transports. mcp-toolkit gives you the production layer above it: auth-scoped discovery, metric-per-tool, dashboards-from-code, multitenancy. You can use both — mcp-toolkit wraps FastMCP under the hood.

Install

Not yet on PyPI. Track docs/ROADMAP.md for the 0.1.0 release.

# Once published:
uv add mcp-toolkit
# With observability batteries:
uv add 'mcp-toolkit[observability]'

One-click stack

make stack-up      # Prometheus + Grafana + your server, dashboards provisioned
open http://localhost:3000  # Grafana, dashboards already populated

See deploy/observability-stack/README.md.

Deploy

Three deployment surfaces ship in this repo:

Target Manifest When
Knative deploy/knative-serving.yaml You already run Knative Serving.
Vanilla k8s (Helm) deploy/helm/mcp-toolkit/ You run k8s without Knative.
Local dev deploy/observability-stack/ docker compose, Prometheus + Grafana included.

Documentation

Topic Where
AI navigation primer CLAUDE.md
10,000 ft architecture ARCHITECTURE.md
Tool registration src/mcp_toolkit/domains/registry/DOMAIN.md
Auth + scopes src/mcp_toolkit/domains/auth/DOMAIN.md
Metrics + dashboards src/mcp_toolkit/domains/observability/DOMAIN.md
Multi-tenancy src/mcp_toolkit/domains/tenancy/DOMAIN.md
Roadmap docs/ROADMAP.md
Contributing CONTRIBUTING.md
Security policy SECURITY.md

License

MIT — 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

fastmcp_kit-0.1.0.tar.gz (185.8 kB view details)

Uploaded Source

Built Distribution

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

fastmcp_kit-0.1.0-py3-none-any.whl (49.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fastmcp_kit-0.1.0.tar.gz
  • Upload date:
  • Size: 185.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.18

File hashes

Hashes for fastmcp_kit-0.1.0.tar.gz
Algorithm Hash digest
SHA256 94dc1f0d5a845924580e857e1088033144a8d4512a47d86a7067b7f344812c7e
MD5 cbcc3ce6032f69d6232e5304a43c6b0b
BLAKE2b-256 b5c643813394603f0fa281be86b937838bade13a5a772bf38562e18dc1c10b90

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastmcp_kit-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ffb3864d3f0e04bfbf56c675b8fe5003a958f3eb659978a6f2425b7ec39e92f9
MD5 e95201bf01d1aa5dcfe1464b2eedf44b
BLAKE2b-256 5dc85f467caf7164a9ada535de743f94f72bf88719442c4c4276f4fa8d2ea253

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