Skip to content

client

diapason.mcp.client

MCP Client — connects to MCP servers and discovers/calls tools.

MCPClient

Client that communicates with an MCP server via a transport.

Parameters

transport: The transport layer to use for communication.

call_tool(name, arguments=None)

Call a tool on the server.

Returns the result dictionary with content and isError fields.

close()

Close the transport connection.

initialize()

Perform the MCP initialize handshake.

Sends the required client info and protocol version, then confirms with a notifications/initialized notification as required by the MCP specification.

Returns the server capabilities.

list_tools()

Discover available tools from the server.

Returns a list of ToolSpec objects.

notify(method, params=None)

Send a JSON-RPC notification (no response expected).

Per JSON-RPC 2.0 spec, notifications omit the id field entirely.