Dynamic FastMCP
Dynamic FastMCP extends the Model Context Protocol Python server with context-aware tools that adapt their behavior and descriptions based on user, tenant, and request context.
What is Dynamic FastMCP?
Dynamic FastMCP is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to dynamic fastmcp extends the model context protocol python server with context-aware tools that adapt their behavior and descriptions based on user, tenant, and request context.
Dynamic FastMCP extends the Model Context Protocol Python server with context-aware tools that adapt their behavior and descriptions based on user, tenant, and request context.
This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- Dynamic FastMCP extends the Model Context Protocol Python se
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx dynamic-fastmcpConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Dynamic FastMCP
Dynamic FastMCP is a Python library that extends the FastMCP framework to support context-aware MCP tools — tools whose names, descriptions, and behavior adapt dynamically based on the identity of the caller (user, tenant, or request context). Instead of every user seeing the same static tool list, your MCP server can personalize tool descriptions, guard access by role, or tailor outputs to match the requester's context. It is designed for multi-tenant SaaS platforms and agentic systems where a one-size-fits-all tool interface is insufficient.
Prerequisites
- Python 3.10+ with pip or uv installed
- Familiarity with the FastMCP/MCP Python SDK and async Python
- An MCP client or agent framework to connect to the server
- Optional: an OIDC/OAuth2 identity provider if you want token-based context via AuthSettings
Install the dynamic-fastmcp package
Install the library from PyPI using pip or uv into your project environment.
pip install dynamic-fastmcp
# or with uv:
uv add dynamic-fastmcpCreate your MCP server file
Import DynamicFastMCP and DynamicTool, then instantiate the server. Dynamic tools are defined as classes that implement the DynamicTool protocol.
from dynamic_fastmcp import DynamicFastMCP, DynamicTool
from mcp.server.fastapi import Context
mcp = DynamicFastMCP()Define a context-aware dynamic tool
Implement the DynamicTool protocol: name() returns the tool identifier, handle_description() receives the MCP Context and returns a personalized description, and handle_call() executes the tool logic.
@mcp.tool()
class PersonalizedEcho(DynamicTool):
def name(self) -> str:
return "personalized_echo"
async def handle_description(self, ctx: Context) -> str:
user = ctx.request_context.request.user
return f"Echoes text personalized for {user.username}"
async def handle_call(self, text: str, ctx: Context) -> str:
user = ctx.request_context.request.user
return f"Hello {user.username}: {text}"Run the MCP server
Start the server over stdio (for local MCP clients) or HTTP. The server will expose all registered dynamic tools to connecting clients.
python server.pyConfigure your MCP client
Point your MCP client at the running server. For stdio-based servers, use the command and args fields in your client config.
{
"mcpServers": {
"dynamic-fastmcp": {
"command": "python",
"args": ["/absolute/path/to/server.py"]
}
}
}Dynamic FastMCP Examples
Client configuration
Example MCP client config for a Dynamic FastMCP server running as a local Python script.
{
"mcpServers": {
"dynamic-fastmcp": {
"command": "python",
"args": ["/absolute/path/to/your/server.py"]
}
}
}Prompts to try
Example interactions after connecting an agent to a Dynamic FastMCP server.
- "List all available tools"
- "Use the personalized_echo tool to echo 'hello world'"
- "What tools do I have access to as a premium user?"
- "Run the context-aware search tool with query 'latest sales data'"
- "Show me the description of each available tool"Troubleshooting Dynamic FastMCP
ImportError: cannot import name 'DynamicTool' from 'dynamic_fastmcp'
Ensure you installed the correct package: 'pip install dynamic-fastmcp' (with a hyphen). Run 'pip show dynamic-fastmcp' to confirm the version is installed.
Context object does not contain user/tenant information
Dynamic context requires that your MCP server is configured with a token_verifier or AuthSettings pointing to your identity provider. Without authentication middleware, ctx.request_context.request.user will be empty.
Tool descriptions are not adapting per request
Confirm your tool class implements handle_description(self, ctx) as an async method, not a regular method, and that it is decorated with @mcp.tool(). Static @mcp.tool() function decorators bypass the dynamic description mechanism.
Frequently Asked Questions about Dynamic FastMCP
What is Dynamic FastMCP?
Dynamic FastMCP is a Model Context Protocol (MCP) server that dynamic fastmcp extends the model context protocol python server with context-aware tools that adapt their behavior and descriptions based on user, tenant, and request context. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Dynamic FastMCP?
Follow the installation instructions on the Dynamic FastMCP GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Dynamic FastMCP?
Dynamic FastMCP works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Dynamic FastMCP free to use?
Yes, Dynamic FastMCP is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
Dynamic FastMCP Alternatives — Similar Developer Tools Servers
Looking for alternatives to Dynamic FastMCP? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
★ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
★ 155.8kJava 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发
Gemini CLI
★ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
★ 87.3k⭐ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
★ 86.0kModel Context Protocol Servers
CC Switch
★ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
Browse More Developer Tools MCP Servers
Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Dynamic FastMCP in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Dynamic FastMCP?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.