Skip to main content
New in version 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

Use mount() to add another server’s components to your server:

Mounting External Servers

Mount remote HTTP servers or subprocess-based MCP servers using create_proxy():

Mounting npm/uvx Packages

For npm packages or Python tools, use the config dict format:
Or use explicit transport classes:
For advanced configuration, see Proxying.

Namespacing

New in version 3.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

With mount(), changes to the subserver are immediately reflected:

Static Importing

With import_server(), components are copied once at import time:

Direct vs Proxy Mounting

New in version 2.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

The as_proxy parameter is deprecated. Mounted servers now always have their lifespan and middleware invoked. To create a proxy server explicitly, use create_proxy() from fastmcp.server.
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 version 3.0.0 Parent server tag filters apply recursively to mounted servers:

Performance Considerations

When using live mounting, operations like list_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
If low latency is critical, consider:
  • Using import_server() for static composition
  • Implementing caching strategies
  • Limiting mounting depth

Custom Routes

New in version 2.4.0 Custom HTTP routes defined with @server.custom_route() are also forwarded when mounting:

Conflict Resolution

New in version 3.0.0 When mounting multiple servers with the same namespace (or no namespace), the most recently mounted server takes precedence for conflicting component names: