fastmcp-extensions
Unofficial extension library for FastMCP 3.x with patterns, practices, and utilities
What it is and what it does
FastMCP Extensions is a library that sits on top of FastMCP 3.x and encodes common patterns for shipping production MCP servers. Instead of reinventing auth, filtering, telemetry, and documentation scaffolding for each new server, you inherit them from a single opinionated base. The library provides factories for assembling auth verifiers (OIDC for browsers, JWT for machines, token introspection), tool filtering based on MCP annotations (read-only mode, destructive-operation gating, modality checks), and integration with Sentry and Segment for structured telemetry. It also includes a server factory that wires up server-info resources, credential resolution from HTTP headers or environment variables, and optional asset discovery.
The library is designed around a philosophy that a CLI and an MCP server should share the same tool implementations, not drift into separate code paths. It provides decorators for deferred tool and resource registration, test utilities to measure tool-list size and call tools programmatically, and auto-generated Markdown documentation. Telemetry and auth are wired once and inherited by every server built on the library, reducing the surface for misconfiguration and making it easier to apply security hardening uniformly across a fleet of servers.
Use it for:
- Build an MCP server with OIDC and JWT auth already wired, so each new server inherits the same verifier logic without hand-rolling auth middleware.
- Implement tool filtering (read-only mode, no-destructive mode) by annotating tools and letting the library enforce the filters across all clients automatically.
- Measure tool-list size before deployment to catch context-window truncation that would break agent interactions.
- Share tool implementations between a CLI and an MCP HTTP server using the same decorators and registration functions, eliminating code duplication.
- Integrate Sentry and Segment telemetry across both CLI and MCP paths without per-tool wiring; telemetry becomes a no-op if keys are not supplied.
- Generate Markdown documentation for your tool surface automatically, with per-tool URLs for sharing with stakeholders.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides hardened patterns and utilities for building Model Context Protocol servers on top of FastMCP, including auth factories, tool filtering, telemetry integration, and server scaffolding.
Yes, with conditions. Install if you are building multiple MCP servers or a production MCP deployment where auth, filtering, telemetry, and documentation consistency matter. The library is actively maintained, has low install friction, and is permissively licensed. However, it is still in Beta (Development Status 4), the auth factory's production readiness is not explicitly confirmed, and the ecosystem around FastMCP itself is young. Suitable for teams standardizing on MCP; less critical for a single throwaway server.
Install
fastmcp-extensions on PyPI
pip
pip install fastmcp-extensionsuv
uv add fastmcp-extensionspoetry
poetry add fastmcp-extensionsInstalling fastmcp-extensions
Before you install
Low friction; pure Python wheel with no compiled dependencies. Active maintenance as of 2026-08-14 with recent release. Depends on 10 runtime packages including fastmcp, httpx, pydantic, and telemetry sinks (Sentry, Segment), all standard ecosystem choices.
License in practice
Apache License 2.0 is permissive; you may use, modify, and distribute this package and derivative works freely, provided you include the license and attribution notices. No restrictions on commercial use.
Quickstart
pip install fastmcp-extensions
from fastmcp_extensions import mcp_server, mcp_tool, register_mcp_tools
app = mcp_server(name="my-server", package_name="my-package")
@mcp_tool(read_only=True)
def list_items() -> list[str]:
return ["item1", "item2"]
register_mcp_tools(app)
Requires Python 3.10 or later; fastmcp must be installed as a runtime dependency.
Verify before relying
- Whether the auth factory's OIDC and JWT modes are production-ready or still in beta.
- Performance characteristics when filtering large tool lists or handling high request volume.
- Compatibility guarantees across FastMCP 3.x minor versions and upgrade path to 4.x.
- Whether Sentry and Segment telemetry truly remain no-ops when keys are not supplied.
Package facts
| License | Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 10 — fastmcp, httpx, mcp, msgspec, py-key-value-aio, pydantic, segment-analytics-python, sentry-sdk, starlette, uvicorn |
| Maintenance | actively maintained — 0 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 152,514/month — #10,899 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: fastmcp_extensions-0.21.0-py3-none-any.whl
Keywords: extensions, fastmcp, mcp, model-context-protocol, utilities
Tags
More Application Frameworks packages
FastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
textualTextual is a Python framework for building…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
mcpBuild and connect to Model Context Protocol…
permissive · top 1,000 on PyPI
WerkzeugWerkzeug is a WSGI utility library providing…
permissive · top 1,000 on PyPI
fastmcpFastMCP is a Python framework for building…
permissive · top 1,000 on PyPI
django-mcp-serverExposes Django models and custom logic as Model…
permissive · top 15,000 on PyPI
fastmcp-slimFastMCP exposes Python functions as Model…
permissive · top 1,000 on PyPI
jupyter-server-mcpExposes Python functions as tools to MCP…
permissive · top 15,000 on PyPI
mcpadaptAdapts MCP (Model Context Protocol) servers…
permissive · top 15,000 on PyPI
tilt-mcpTilt MCP Server exposes Tilt development…
permissive · top 15,000 on PyPI
astro-airflow-mcpProvides AI assistants with programmatic access…
unclear · top 15,000 on PyPI
mcp-typesProvides the wire types and protocol message…
permissive · top 5,000 on PyPI
mcp-server-appwriteExposes Appwrite's backend-as-a-service…
unclear · top 15,000 on PyPI