API Reference agentsea_mcp v#0.1.0

Copy Markdown

Modules

Model Context Protocol integration: connect to an MCP server and expose its tools to an AgentSea agent.

An MCP client: performs the initialize handshake over a transport, caches the server's tool list, and calls tools. Transport-agnostic (see AgentSea.MCP.Transport).

Request/response transport for the MCP JSON-RPC protocol. The client is transport-agnostic; real transports (stdio over a Port, streamable HTTP/SSE over Req) and the in-process AgentSea.MCP.Transport.Function all implement this one callback.

A transport backed by a 2-arity function (method, params) -> {:ok, result} | {:error, reason}. Handy for in-process MCP servers, tests, and demos. The client's ref is the function itself.

MCP "Streamable HTTP" transport. Each request is a JSON-RPC POST to the server endpoint; the response is parsed from either an application/json body or a text/event-stream (SSE) body.

MCP stdio transport: spawns an MCP server subprocess and speaks newline- delimited JSON-RPC 2.0 over its stdin/stdout.