connect() returns the application’s tool set, already checked. Spend it one of
two ways, depending on whether something in your stack already speaks MCP.
Hand the endpoint to a framework
If your framework brings its own MCP client (the OpenAI Agents SDK, the Claude Agent SDK, LangChain, Mastra), all the SDK contributes is a checked URL and its headers:Or translate the tools for a model call
When you call a provider’s API directly there is no MCP client in the picture.toolkit() translates the tools into that provider’s function-calling dialect,
and execute() runs the calls the model asked for, every one of them back
through the gateway:
The SDK depends on no provider package:
tools and what execute() returns are
plain objects in the provider’s shape. In TypeScript, name the types at the call
to get them checked: agent.toolkit<OpenAI.Responses.Tool, OpenAI.Responses.ResponseInputItem>(…).
A toolkit is two halves of one translation. What tools changed on the way out,
execute() undoes on the way back, so use the pair from the same call.
Strict schemas
strict closes every schema so the model cannot invent an argument. Tools whose
schema cannot be made strict are listed in warnings rather than dropped:
Call one tool directly
call_tool() (callTool() in TypeScript) runs one tool without a model in the
loop. The server prefix is optional: list_issues reaches linear_list_issues
while Linear is the only server of the application that serves it.
Long-running processes
An admin owns the tool set and can change it under a running agent. A process that stays up re-reads it withrefresh() rather than trusting the list it took
at startup. A tool that left in between fails with
ToolNotFoundError.
refresh_connections() (refreshConnections()) re-reads the application’s
upstream accounts the same way: what it still owes before it can call every
server.