Skip to content

mcp_adapter

diapason.tools.mcp_adapter

MCP tool adapter — wraps external MCP server tools as native BaseTool instances.

MCPToolAdapter

Bases: BaseTool

Wraps a single MCP-hosted tool as a native BaseTool.

This adapter enables tools discovered from external MCP servers to be used seamlessly within Diapason agents via the ToolExecutor.

Parameters

client: The MCPClient connected to the external MCP server. tool_spec: The ToolSpec describing this tool (from MCPClient.list_tools()).

execute(**params)

Execute the remote MCP tool and return a ToolResult.

MCPToolProvider

Discovers tools from an MCP server and returns BaseTool adapters.

Parameters

client: The MCPClient connected to the MCP server.

discover()

Discover available tools and return them as BaseTool adapters.