2.2.0
Mounting lets you combine multiple FastMCP servers into one. When you mount a server, all its components become available through the parent. Under the hood, FastMCP uses FastMCPProvider (v3.0.0+) to source components from the mounted server.
Why Mount Servers
Large applications benefit from modular organization. Rather than defining all components in one massive file, create focused servers for specific domains and combine them:- Modularity: Break down applications into smaller, focused servers
- Reusability: Create utility servers and mount them wherever needed
- Teamwork: Different teams can work on separate servers
- Organization: Keep related functionality grouped together
Basic Mounting
Usemount() to add another server’s components to your server:
Mounting External Servers
Mount remote HTTP servers or subprocess-based MCP servers usingcreate_proxy():
Mounting npm/uvx Packages
For npm packages or Python tools, use the config dict format:Namespacing
New in version3.0.0
When mounting multiple servers, use namespaces to avoid naming conflicts:
How Namespacing Works
Namespacing uses transforms under the hood.
Mounting vs Importing
FastMCP offers two ways to combine servers:Live Mounting
Withmount(), changes to the subserver are immediately reflected:
Static Importing
Withimport_server(), components are copied once at import time:
Direct vs Proxy Mounting
New in version2.2.7
FastMCP supports two mounting modes:
Direct Mounting (Default)
The parent server directly accesses the mounted server’s objects in memory:- No client lifecycle events on mounted server
- Mounted server’s lifespan is not executed
- Communication via direct method calls
Proxy Mounting
Previously, the parent server could treat the mounted server as a separate entity with its own lifecycle. This behavior is now the default for all mounted servers:- Full client lifecycle events on mounted server
- Mounted server’s lifespan is executed
- Communication via in-memory Client transport
Tag Filtering
New in version3.0.0
Parent server tag filters apply recursively to mounted servers:
Performance Considerations
When using live mounting, operations likelist_tools() on the parent server are affected by the performance of all mounted servers. This is particularly noticeable with:
- HTTP-based mounted servers (300-400ms vs 1-2ms for local tools)
- Mounted servers with slow initialization
- Deep mounting hierarchies
- Using
import_server()for static composition - Implementing caching strategies
- Limiting mounting depth
Custom Routes
New in version2.4.0
Custom HTTP routes defined with @server.custom_route() are also forwarded when mounting:
Conflict Resolution
New in version3.0.0
When mounting multiple servers with the same namespace (or no namespace), the most recently mounted server takes precedence for conflicting component names: