MCP (Model Context Protocol) client over stdio transport.
Launches an MCP server as a subprocess, performs JSON-RPC initialization,
and exposes list_tools/1 and call_tool/3 for protocol interaction.
Examples
{:ok, client} = ADK.MCP.Client.start_link(command: "npx", args: ["-y", "@modelcontextprotocol/server-everything"])
{:ok, tools} = ADK.MCP.Client.list_tools(client)
{:ok, result} = ADK.MCP.Client.call_tool(client, "echo", %{"message" => "hello"})
Summary
Functions
Call a tool on the MCP server.
Returns a specification to start this module under a supervisor.
Stop the client and terminate the subprocess.
List tools available on the MCP server.
Get server info from the initialization response.
Types
@type start_opt() :: {:command, String.t()} | {:args, [String.t()]} | {:env, [{String.t(), String.t()}]} | {:name, GenServer.name()} | {:timeout, pos_integer()}
Functions
@spec call_tool(GenServer.server(), String.t(), map()) :: {:ok, map()} | {:error, term()}
Call a tool on the MCP server.
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec close(GenServer.server()) :: :ok
Stop the client and terminate the subprocess.
@spec list_tools(GenServer.server()) :: {:ok, [map()]} | {:error, term()}
List tools available on the MCP server.
@spec server_info(GenServer.server()) :: {:ok, map()} | {:error, term()}
Get server info from the initialization response.
@spec start_link([start_opt()]) :: GenServer.on_start()