Skip to main content

fastmcp.server.middleware.tool_injection

A middleware for injecting tools into the MCP server context.

Functions

list_prompts

List prompts available on the server.

get_prompt

Render a prompt available on the server.

list_resources

List resources available on the server.

read_resource

Read a resource available on the server.

Classes

ToolInjectionMiddleware

A middleware for injecting tools into the context. Methods:

on_list_tools

Inject tools into the response.

on_call_tool

Intercept tool calls to injected tools.

PromptToolMiddleware

A middleware for injecting prompts as tools into the context.

ResourceToolMiddleware

A middleware for injecting resources as tools into the context.