fastmcp.server.server
default_lifespan
server
: The server instance this lifespan is managingadd_resource_prefix
uri
: The original resource URIprefix
: The prefix to addValueError
: If the URI doesn’t match the expected protocol://path formatremove_resource_prefix
uri
: The resource URI with a prefixprefix
: The prefix to removeprefix_format
: The format of the prefix to removeValueError
: If the URI doesn’t match the expected protocol://path formathas_resource_prefix
uri
: The resource URI to checkprefix
: The prefix to look forValueError
: If the URI doesn’t match the expected protocol://path formatFastMCP
settings
name
instructions
run_async
transport
: Transport protocol to use (“stdio”, “sse”, or “streamable-http”)run
transport
: Transport protocol to use (“stdio”, “sse”, or “streamable-http”)add_middleware
get_tools
get_tool
get_resources
get_resource
get_resource_templates
get_resource_template
get_prompts
get_prompt
custom_route
path
: URL path for the route (e.g., “/oauth/callback”)methods
: List of HTTP methods to support (e.g., [“GET”, “POST”])name
: Optional name for the route (to reference this route with
Starlette’s reverse URL lookup feature)include_in_schema
: Whether to include in OpenAPI schema, defaults to Trueadd_tool
tool
: The Tool instance to registerremove_tool
name
: The name of the tool to removeNotFoundError
: If the tool is not foundadd_tool_transformation
remove_tool_transformation
tool
tool
tool
name_or_fn
: Either a function (when used as @tool), a string name, or Nonename
: Optional name for the tool (keyword-only, alternative to name_or_fn)description
: Optional description of what the tool doestags
: Optional set of tags for categorizing the tooloutput_schema
: Optional JSON schema for the tool’s outputannotations
: Optional annotations about the tool’s behaviorexclude_args
: Optional list of argument names to exclude from the tool schemameta
: Optional meta information about the toolenabled
: Optional boolean to enable or disable the tooladd_resource
resource
: A Resource instance to addadd_template
template
: A ResourceTemplate instance to addadd_resource_fn
fn
: The function to register as a resourceuri
: The URI for the resourcename
: Optional name for the resourcedescription
: Optional description of the resourcemime_type
: Optional MIME type for the resourcetags
: Optional set of tags for categorizing the resourceresource
uri
: URI for the resource (e.g. “resource://my-resource” or “resource://”)name
: Optional name for the resourcedescription
: Optional description of the resourcemime_type
: Optional MIME type for the resourcetags
: Optional set of tags for categorizing the resourceenabled
: Optional boolean to enable or disable the resourceannotations
: Optional annotations about the resource’s behaviormeta
: Optional meta information about the resourceadd_prompt
prompt
: A Prompt instance to addprompt
prompt
prompt
run_stdio_async
run_http_async
transport
: Transport protocol to use - either “streamable-http” (default) or “sse”host
: Host address to bind to (defaults to settings.host)port
: Port to bind to (defaults to settings.port)log_level
: Log level for the server (defaults to settings.log_level)path
: Path for the endpoint (defaults to settings.streamable_http_path or settings.sse_path)uvicorn_config
: Additional configuration for the Uvicorn servermiddleware
: A list of middleware to apply to the appstateless_http
: Whether to use stateless HTTP (defaults to settings.stateless_http)run_sse_async
sse_app
path
: The path to the SSE endpointmessage_path
: The path to the message endpointmiddleware
: A list of middleware to apply to the appstreamable_http_app
path
: The path to the StreamableHTTP endpointmiddleware
: A list of middleware to apply to the apphttp_app
path
: The path for the HTTP endpointmiddleware
: A list of middleware to apply to the apptransport
: Transport protocol to use - either “streamable-http” (default) or “sse”run_streamable_http_async
mount
server
: The FastMCP server to mount.prefix
: Optional prefix to use for the mounted server’s objects. If None,
the server’s objects are accessible with their original names.as_proxy
: Whether to treat the mounted server as a proxy. If None (default),
automatically determined based on whether the server has a custom lifespan
(True if it has a custom lifespan, False otherwise).tool_separator
: Deprecated. Separator character for tool names.resource_separator
: Deprecated. Separator character for resource URIs.prompt_separator
: Deprecated. Separator character for prompt names.import_server
server
: The FastMCP server to importprefix
: Optional prefix to use for the imported server’s objects. If None,
objects are imported with their original names.tool_separator
: Deprecated. Separator for tool names.resource_separator
: Deprecated and ignored. Prefix is now
applied using the protocol://prefix/path formatprompt_separator
: Deprecated. Separator for prompt names.from_openapi
from_fastapi
as_proxy
backend
argument can be either an existing fastmcp.client.Client
instance or any value accepted as the transport
argument of
fastmcp.client.Client
. This mirrors the convenience of the
fastmcp.client.Client
constructor.
from_client
MountedServer