fastmcp.utilities.components

Classes

FastMCPComponent

Base class for FastMCP tools, prompts, resources, and resource templates.

Methods:

key

key(self) -> str

The key of the component. This is used for internal bookkeeping and may reflect e.g. prefixes or other identifiers. You should not depend on keys having a certain value, as the same tool loaded from different hierarchies of servers may have different keys.

with_key

with_key(self, key: str) -> Self

enable

enable(self) -> None

Enable the component.

disable

disable(self) -> None

Disable the component.