MCP Tool Runner • AI Agent SDK
MCPToolRunner: A dedicated thread for running MCP operations.
MCPToolRunner
Defined in the MCP module.
AI Agent
A dedicated thread for running MCP operations.
Constructor
ParamField
AnyNo description available.
ParamField
AnyNo description available.
Methods
run()
Main thread function that processes MCP requests.
read_resource()Read an MCP resource by URI and return its normalised contents.
get_prompt()Fetch an MCP prompt template rendered with `arguments`.
Call an MCP tool and wait for the result.
shutdown()Signal the thread to shut down.
stop()Best-effort teardown for the runner thread.
Source
View on GitHubpraisonaiagents/mcp/mcp.py at line 45