Skip to main content
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 (langchain-mcp-adapters), Mastra), all the SDK contributes is a checked URL and its headers:
There is no adapter per framework, because the framework already is one.

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. Use the full name from tools/list. A short name is accepted only when exactly one listed tool ends in _<name>: list_issues reaches linear_list_issues. When several do, the SDK asks which you mean. When none do, the name is sent unchanged: the gateway accepts the listed name or, for now, a spelling from before the current naming (see Tool names), and an unknown name fails with ToolNotFoundError. A short name does not reach a tool that gained a collision suffix or was cut to 64 characters. In TypeScript, a handle from forEndUser() does not match short names: pass callTool() the full name from tools.

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 with refresh() 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.