MCPClient or MultiSessionClient and translate them into the tool format expected by each AI framework. You do not need every adapter — install only the peer dependency for the framework you are using, and import the corresponding adapter class from its dedicated entry point.
Available adapters
Vercel AI SDK
Use MCP tools with
streamText, generateText, and useChat from the Vercel AI SDK.LangChain
Expose MCP tools as
DynamicStructuredTool instances for LangChain and LangGraph agents.Mastra
Supply MCP tools directly to Mastra
Agent instances with Zod-validated schemas.AG-UI
Bridge MCP tools with remote Python agents (LangGraph, AutoGen) using the AG-UI protocol.
Adapter reference
| Adapter | Framework | Import path | Peer dependency |
|---|---|---|---|
AIAdapter | Vercel AI SDK | @mcp-ts/sdk/adapters/ai | ai |
LangChainAdapter | LangChain | @mcp-ts/sdk/adapters/langchain | @langchain/core, zod |
MastraAdapter | Mastra | @mcp-ts/sdk/adapters/mastra | zod |
AguiAdapter | AG-UI | @mcp-ts/sdk/adapters/agui-adapter | @ag-ui/client, rxjs |
Common patterns
Single client vs. multi-session
Every adapter accepts either a singleMCPClient or a MultiSessionClient. When you pass a MultiSessionClient, the adapter fetches tools from all connected servers and merges them into a single tool set.
Avoiding tool name collisions
When you connect to more than one MCP server, tool names can conflict. Pass aprefix option to namespace every tool from that adapter instance.
Graceful handling of disconnected clients
All adapters return an empty result — an empty object{} or an empty array [] — when the underlying client is not connected. Your application will not throw at the point of tool collection; failures surface only when a tool is actually called.
Static convenience method
Every adapter exposes a staticgetTools method so you can retrieve a tool set in a single expression without instantiating the class yourself.