OptionalserverOptionalparams: unknowntools/call, flattened: text items joined by newlines, anything else as JSON. A result marked isError throws so the model sees { error }.
Optionalargs: Record<string, string>The server's tools, paginated to the end.
The server's tools as Tool[]: the server's own JSON Schema, and an execute that calls tools/call and flattens the result to text.
StaticconnectConnects and runs the initialize handshake. Pass url for Streamable HTTP, or transport (e.g. from ./mcp-stdio).
Any JSON-RPC method; the raw
result. A JSON-RPC error becomes anAIErrorwith codeMCP_ERRORandproviderCodeset to the RPC code.