Smith::MCP::Client
Inherits Reference < Object
A single MCP server connection: handshake, tool list, tool calls.
One reader fiber owns the stream and hands each response to whoever is waiting on that id. Nothing else may read from the transport โ requests overtake each other routinely, and matching by arrival order instead of by id is exactly the bug that produces silently swapped tool results.
Constants
DEFAULT_TIMEOUT = 60.seconds
STARTUP_TIMEOUT = 10.seconds
The handshake gets its own, shorter deadline. A command that is not an
MCP server at all โ a typo, a plain cat โ never answers, and the whole
session start would otherwise wait out the full call timeout for it.
Constructors
new(name : String, transport : Transport, timeout : Time::Span = DEFAULT_TIMEOUT, startup_timeout : Time::Span = STARTUP_TIMEOUT)
SourceInstance methods
call_tool(tool : String, arguments : JSON::Any) : ToolResult
Sourceclose
Sourcename
Sourceserver_info
Sourcestart
Sourcetools
Source