Skip to main content
The MastraAdapter converts MCP tools into the format expected by the Mastra framework.

Installation

npm install @mcp-ts/sdk zod

Usage

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,
  // ...
});

API Reference

See the MastraAdapter API Reference for more details.