> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mcp-assistant.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Mastra

> Convert MCP tools into Mastra-compatible tool definitions with MastraAdapter so your Mastra agents can call any MCP server through one client.

The `MastraAdapter` converts MCP tools into the format expected by the [Mastra](https://mastra.ai) framework.

## Installation

```bash theme={null}
npm install @mcp-ts/sdk zod
```

## Usage

```typescript theme={null}
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](/reference/server#adapters) for more details.
