MastraAdapter converts MCP tools into the format expected by the Mastra framework.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
🎉 v2.0.0 is out! Please note that the API may contain breaking changes. See the migration guide and changelog for details.
Convert MCP tools into Mastra-compatible tool definitions with MastraAdapter so your Mastra agents can call any MCP server through one client.
MastraAdapter converts MCP tools into the format expected by the Mastra framework.
npm install @mcp-ts/sdk zod
import { MultiSessionClient } from '@mcp-ts/sdk/server';
import { MastraAdapter } from '@mcp-ts/sdk/adapters/mastra';
const client = new MultiSessionClient('user_123');
await client.connect();
const adapter = new MastraAdapter(client);
const tools = await adapter.getTools();
// Use with Mastra agent
const agent = new Agent({
tools,
// ...
});
Was this page helpful?
