Registry / ai-ml / fastmcp-extensions

fastmcp-extensions

JSON →
library0.22.0pypypi✓ verified 27d ago

fastmcp-extensions is an unofficial extension library for FastMCP, providing patterns, practices, and utilities to enhance FastMCP server development. It currently supports FastMCP v3 and includes features like dynamic tool filtering and a helper for MCP server credential resolution. The library is actively maintained by AirbyteHQ and undergoes periodic releases.

pip install fastmcp-extensions
INSTALL
IMPORT
SIG · FASTMCP-EXTENSIONS
F
fastmcp-extensions
ai-mlpythonv0.22.0
Install
13.3s avg
Import
5401ms
Disk
125MB
Pass rate
8/ 10
Env Coverage8 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v0.22.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✓ —
✓ 15s
py 3.11
✓ —
✓ 14.4s
py 3.12
✓ —
✓ 11.6s
py 3.13
✓ —
✓ 12.1s
py 3.9
✕ build_error
✕ build_error
125MB installed
● package 125MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

mcp_server
✓ from fastmcp_extensions.server import mcp_server
Based on release notes; specific modules for other extensions like dynamic tool filtering may vary.
FastMCP
✓ from fastmcp import FastMCP
The core FastMCP object, which fastmcp-extensions extends.

This quickstart demonstrates how to initialize a FastMCP server and conceptually integrate features provided by `fastmcp-extensions`, such as the `mcp_server` helper for server setup and credential resolution, and a placeholder for dynamic tool filtering. Due to the lack of specific examples in public documentation, some imports and usages are illustrative based on the library's stated features. Users should consult the library's source for precise API details.

import os from fastmcp import FastMCP # Assuming mcp_server helper is directly exposed in a 'server' module # Exact import path for specific extensions may vary based on internal structure. try: from fastmcp_extensions.server import mcp_server from fastmcp_extensions.filters import dynamic_filter_policy # Hypothetical import except ImportError: print("Warning: fastmcp-extensions specific imports not found. Using FastMCP core only.") mcp_server = None # Placeholder dynamic_filter_policy = None # Placeholder def run_extended_mcp_server(): mcp = FastMCP(name="MyExtendedMCPServer") @mcp.tool def hello(name: str = "World") -> str: """Greets the given name.""" return f"Hello, {name}! This is an extended FastMCP server." # Example of integrating an extension, if 'mcp_server' exists if mcp_server: # The mcp_server helper likely takes a FastMCP instance and applies configurations. # This is a hypothetical usage based on 'built-in server info and credential resolution'. print("Applying fastmcp-extensions mcp_server helper...") # mcp_server might take parameters for credential resolution, e.g., via env vars. # For example, os.environ.get('MCP_SERVER_SECRET_KEY', 'default_key') configured_mcp = mcp_server(mcp, credentials_env_var='FASTMCP_API_KEY') else: configured_mcp = mcp # If dynamic_filter_policy exists, it would likely be applied to the server if dynamic_filter_policy: print("Applying dynamic tool filtering policy...") # configured_mcp.add_filter(dynamic_filter_policy()) print(f"Running {configured_mcp.name} with stdio transport...") # In a real scenario, you'd run the server (e.g., in a __main__ block) # configured_mcp.run(transport="stdio") print("Server setup complete (not actually running in this snippet).") print("Available tools on the server:") for tool_name, tool_obj in configured_mcp._tools.items(): print(f"- {tool_name}: {tool_obj.description}") if __name__ == "__main__": # Set a dummy environment variable if needed for hypothetical credential resolution os.environ['FASTMCP_API_KEY'] = 'fake_api_key_123' run_extended_mcp_server()
Debug
Known issues
breakingVersion 0.3.0 of `fastmcp-extensions` upgrades its core dependency `fastmcp` from v2 to v3. Projects upgrading to `fastmcp-extensions` v0.3.0 must also ensure their `fastmcp` installation is v3 or higher and that their server code is compatible with `FastMCP` v3's API changes.
fix
Upgrade `fastmcp` to a compatible v3.x version (e.g., `pip install 'fastmcp>=3.0.0'`) and review FastMCP v3 migration guides for any breaking changes in your server implementation.
affects: >=0.3.0
gotcha`fastmcp-extensions` is described as an 'unofficial extension library'. This may imply potential for API instability, differing design philosophies, or slower updates compared to official `FastMCP` core developments. Relying heavily on specific extension implementations may introduce tighter coupling.
fix
Regularly review the `fastmcp-extensions` GitHub repository for updates and breaking changes. Be prepared to adapt your code if upstream `FastMCP` changes impact the extension library. Consider the long-term maintenance implications for critical applications.
affects: All versions
gotchaThe `mcp_server()` helper includes 'built-in server info and credential resolution'. Incorrect configuration or missing environment variables for credentials can lead to authentication failures or security vulnerabilities if defaults are inadvertently used.
fix
Thoroughly understand how `mcp_server()` resolves credentials (e.g., via specific environment variables or configuration files). Ensure all required credentials are securely provided and documented for your deployment environment.
affects: >=0.2.0
gotchaThe 'dynamic tool filtering with intelligent default filtering policy' feature can unexpectedly hide or expose tools if the filtering logic is not fully understood. This could lead to functional gaps for LLM agents or unintended access to sensitive tools.
fix
Carefully review the default filtering policies and customize them as needed for your specific use case. Implement robust testing to verify that only the intended tools are available under various contexts and user roles.
affects: >=0.2.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'fastmcp'
The core 'fastmcp' library, a necessary dependency for 'fastmcp-extensions', is not installed in the current Python environment or the active virtual environment is incorrect.
fix
Ensure 'fastmcp' is installed by running `pip install fastmcp`. If 'fastmcp-extensions' specifies a version, use `pip install "fastmcp>=3.0.0"` to ensure compatibility with FastMCP v3.
ImportError: cannot import name 'mcp' from 'fastmcp'
The `FastMCP` server class is named `FastMCP` (PascalCase), not `mcp` (lowercase), leading to an incorrect import attempt.
fix
Correct the import statement to `from fastmcp import FastMCP` and then instantiate it, e.g., `mcp = FastMCP("Server Name")`.
AttributeError: module 'fastmcp.settings' has no attribute 'mask_error_details'
This error often occurs when running a FastMCP server, particularly with OAuth in a debugger (like VS Code), because the `fastmcp.settings` module is incorrectly resolved as the module itself rather than an instantiated `Settings` object during module initialization.
fix
Try running the FastMCP server directly from the command line instead of through a debugger. If interacting with settings directly, ensure you explicitly instantiate the `Settings` class, or use environment variables for global configuration.
ModuleNotFoundError: No module named 'fastmcp.utilities.lifespan'
This indicates that a specific module or its path, such as `lifespan` within `fastmcp.utilities`, has either been moved, renamed, or removed in a particular version of the 'fastmcp' library, causing the import to fail.
fix
Verify that your installed `fastmcp` version is compatible with the `fastmcp-extensions` library's requirements. If upgrading FastMCP, check the release notes for changes to module structure and update your import statements accordingly.
Upgrade
Version history
0.22.0latest on PyPI · released Aug 27, 2026
Audit
Dependencies
fastmcprequiredCore dependency; v0.3.0 of fastmcp-extensions requires FastMCP v3+.
Agent activity
31 hits · last 30 days
node
26
OpenAI (training)
2
Resources
fastmcp-extensions — pip install fastmcp-extensions · libregistry