fastmcp.server.providers.local_provider.local_provider
LocalProvider for locally-defined MCP components.
This module provides the LocalProvider class that manages tools, resources,
templates, and prompts registered via decorators or direct methods.
LocalProvider can be used standalone and attached to multiple servers:
Classes
LocalProvider
Provider for locally-defined components.
Supports decorator-based registration (@provider.tool, @provider.resource,
@provider.prompt) and direct object registration methods.
When used standalone, LocalProvider uses default settings. When attached
to a FastMCP server via the server’s decorators, server-level settings
like _tool_serializer and _support_tasks_by_default are injected.
Methods:
remove_tool
name: The tool name.version: If None, removes ALL versions. If specified, removes only that version.
KeyError: If no matching tool is found.
remove_resource
uri: The resource URI.version: If None, removes ALL versions. If specified, removes only that version.
KeyError: If no matching resource is found.
remove_template
uri_template: The template URI pattern.version: If None, removes ALL versions. If specified, removes only that version.
KeyError: If no matching template is found.
remove_prompt
name: The prompt name.version: If None, removes ALL versions. If specified, removes only that version.
KeyError: If no matching prompt is found.

