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
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()
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.
fixEnsure '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.
fixCorrect 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.
fixTry 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.
fixVerify 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+.