URL: https://gofastmcp.com/servers/transforms/namespace
Title: Namespace Transform - FastMCP

Documentation Index
Fetch the complete documentation index at:
/llms.txt
Use this file to discover all available pages before exploring further.
Skip to main content
Meet
Prefect Horizon
, the enterprise MCP gateway built by the team behind FastMCP
FastMCP
home page
v3
Prefect Horizon
PrefectHQ/fastmcp
25,596
PrefectHQ/fastmcp
25,596
Search...
Navigation
Working with Tools
Namespace Transform
Search the docs...
Ctrl
K
Documentation
Get Started
Welcome!
Installation
Quickstart
Servers
Overview
Core Components
Working with Tools
Overview
Tool Transformation
Code Mode
NEW
Tool Search
NEW
Namespace
Visibility
NEW
Resources as Tools
NEW
Prompts as Tools
NEW
Tool Fingerprinting
MCP Providers
Interactivity
Extensibility
Auth
Deployment
Apps
Overview
Quickstart
NEW
FastMCPApp
NEW
Interactive Tools
NEW
Generative UI
NEW
Custom HTML
Reference
Clients
Overview
Client-Only Package
Transports
fastmcp-remote
Operations
UPDATED
Authentication
UPDATED
Integrations
Auth
Web Frameworks
AI Assistants
AI SDKs
MCP.json
More
Settings
CLI
Upgrading
Development
What's New
FAQ
Working with Tools
Namespace Transform
Copy page
Prefix component names to prevent conflicts
Copy page
New in version
3.0.0
The
Namespace
transform prefixes all component names, preventing conflicts when composing multiple servers.
Tools and prompts receive an underscore-separated prefix. Resources and templates receive a path-segment prefix in their URIs.
Component
Original
With
Namespace("api")
Tool
my_tool
api_my_tool
Prompt
my_prompt
api_my_prompt
Resource
data://info
data://api/info
Template
data://{id}
data://api/{id}
The most common use is through the
mount()
method’s
namespace
parameter.
from
fastmcp
import
FastMCP
weather
=
FastMCP
(
"
Weather
"
)
calendar
=
FastMCP
(
"
Calendar
"
)
@
weather
.
tool
def
get_data
()
->
str
:
return
"
Weather data
"
@
calendar
.
tool
def
get_data
()
->
str
:
return
"
Calendar data
"
# Without namespacing, these would conflict
main
=
FastMCP
(
"
Main
"
)
main
.
mount
(
weather
,
namespace
=
"
weather
"
)
main
.
mount
(
calendar
,
namespace
=
"
calendar
"
)
# Clients see: weather_get_data, calendar_get_data
You can also apply namespacing directly using the
Namespace
transform.
from
fastmcp
import
FastMCP
from
fastmcp
.
server
.
transforms
import
Namespace
mcp
=
FastMCP
(
"
Server
"
)
@
mcp
.
tool
def
greet
(
name
:
str
)
->
str
:
return
f
"Hello,
{
name
}
!"
# Namespace all components
mcp
.
add_transform
(
Namespace
(
"
api
"
))
# Tool is now: api_greet
Tool Search
Previous
Component Visibility
Next
Ctrl
+I
discord
github
website
x
Powered by
This documentation is built and hosted on Mintlify, a developer documentation platform
Assistant
Responses are generated using AI and may contain mistakes.
\n\n
\n
\n \n
\n
