Skip to main content
Connect to any MCP (Model Context Protocol) server. The provider wraps the server’s tools in a sub-agent, exposing them as query_mcp_<name>.
MCPContextProvider is read-only by default. The tool name includes the server name: query_mcp_github.

Transport Options

Run a local process.

Configuration

ParameterTypeDefaultDescription
server_namestrrequiredName of the MCP server. Used in tool name.
transportstrrequired"stdio", "sse", or "streamable-http".
commandstrNoneCommand to run (stdio transport).
argslist[str]NoneCommand arguments (stdio transport).
urlstrNoneServer URL (sse/http transports).
headersdictNoneHTTP headers (sse/http transports).
envdictNoneEnvironment variables for the subprocess.
timeout_secondsint30Connection timeout.
idstr"mcp_<name>"Tool becomes query_<id>.
modelModelNoneModel for the sub-agent.

Tools Exposed

ToolDescription
query_mcp_<name>Query the MCP server. Sub-agent calls the server’s tools internally.

Lifecycle Management

MCPContextProvider requires explicit setup and teardown:

Resources

MCPTools Reference

MCP tools and server setup

MCP Servers

Available MCP servers