Skip to main content

fastmcp.server.providers.openapi.provider

OpenAPIProvider for creating MCP components from OpenAPI specifications.

Classes

OpenAPIProvider

Provider that creates MCP components from an OpenAPI specification. Components are created eagerly during initialization by parsing the OpenAPI spec. Each component makes HTTP calls to the described API endpoints. Methods:

list_tools

list_tools(self) -> Sequence[Tool]
Return all tools created from the OpenAPI spec.

get_tool

get_tool(self, name: str) -> Tool | None
Get a tool by name.

list_resources

list_resources(self) -> Sequence[Resource]
Return all resources created from the OpenAPI spec.

get_resource

get_resource(self, uri: str) -> Resource | None
Get a resource by URI.

list_resource_templates

list_resource_templates(self) -> Sequence[ResourceTemplate]
Return all resource templates created from the OpenAPI spec.

get_resource_template

get_resource_template(self, uri: str) -> ResourceTemplate | None
Get a resource template that matches the given URI.

list_prompts

list_prompts(self) -> Sequence[Prompt]
Return empty list - OpenAPI doesn’t create prompts.

get_tasks

get_tasks(self) -> Sequence[FastMCPComponent]
Return empty list - OpenAPI components don’t support tasks.