What this thread does
Do first: Create a parent FastMCP and call main.mount(child, namespace="api") for each child, choosing a distinct namespace.
Short answer
Mounting exposes child tools, resources and prompts through a live link. Later child registrations become visible through the parent. Base composition dates to 2.2.0; current namespace and conflict behavior dates to 3.0.0.
What to do
from fastmcp import FastMCP
main = FastMCP("Main")
main.mount(weather, namespace="weather")
main.mount(calendar, namespace="calendar")
Here weather and calendar are existing child servers.
| Control / component | Current behavior |
|---|---|
namespace="api" | Tool my_tool → api_my_tool; prompt my_prompt → api_my_prompt |
| Resource / template | data://info → data://api/info; data://{id} → data://api/{id} |
URI without :// | urn:example:config remains unchanged; namespace cannot isolate its collisions |
| External server | Import create_proxy from fastmcp.server; pass its result to mount() |
| Local script | create_proxy(Path("./my_server.py")), with Path from pathlib |
| Package subprocess | Config dict uses mcpServers → default → command and args; explicit alternatives are NpxStdioTransport and UvxStdioTransport from fastmcp.client.transports |
Tag filtering, 3.0.0 | Parent enable(tags={"production"}, only=True) filters mounted children recursively |
Custom routes, 2.4.0 | @server.custom_route() routes are forwarded; /health with methods=["GET"] stays /health, without a namespace prefix |
Local provider extensions, 4.1.0 | Bundled extensions follow mounted components; explicit parent settings control them |
A remote HTTP URL can be passed directly to create_proxy(). For packages, the source examples use command="npx", args=["-y", "@modelcontextprotocol/server-github"] or command="uvx", args=["mcp-server-sqlite", "--db", "data.db"]. Mount those proxy objects under distinct namespaces.
Limits and open questions
For a shared identifier, the highest component version wins; equal versions or unversioned ties go to the first registered provider. Compose providers requiring new extensions before the parent starts; later additions can use already registered root extensions. Parent list_tools() latency depends on all mounted servers: the page cites 300–400ms for HTTP versus 1–2ms for local tools. It gives no mount-count limit or release dates for the feature versions.
Not for: FastMCP 2.x examples that predate the 3.0.0 namespace and conflict rules.
Sources
Checked
2026-11-17; read Composing Servers; Composing Servers (input URL); Composing Servers (HTML); no command was run.
Started from a post by @FastMCP, packaged by the editor. Original post