fastmcp.utilities.components
Functions
get_fastmcp_metadata
fastmcp namespace and the legacy _fastmcp
namespace for compatibility with older FastMCP servers.
public_result_meta
meta carries private entries under the fastmcp namespace
(e.g. _internal.visibility) that must never reach the wire. Listings
already filter these via FastMCPComponent.get_meta(); results that
carry component meta (resource contents, prompt results) need the same
treatment.
Returns None when nothing public remains, so components without user
metadata keep an absent _meta rather than an empty object.
Classes
FastMCPMeta
FastMCPComponent
Base class for FastMCP tools, prompts, resources, and resource templates.
Methods:
make_key
identifier: The raw identifier (name for tools/prompts, uri for resources)
- A prefixed key like “tool:name” or “resource:uri”
key
.key over ad-hoc name or uri or uri_template logic for any
cross-component identity work (dedupe, grouping, collision detection,
lookup tables). It encodes type, identifier, and version, so variants
of the same component don’t falsely collide with each other, and
cross-type identifiers (e.g. a tool and a resource both named “foo”)
can’t clash.
get_meta
fastmcp key containing:
tags: sorted list of component tagsversion: component version (only if set)
_) are stripped from the fastmcp namespace.

