> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/composiohq/composio/llms.txt
> Use this file to discover all available pages before exploring further.

# Mastra Provider

> Use Composio tools with Mastra.ai framework

The Mastra provider wraps Composio tools for use with the Mastra.ai framework.

## Installation

```bash theme={null}
npm install @composio/mastra @mastra/core
```

## Quick Start

```typescript theme={null}
import { Composio } from '@composio/core';
import { MastraProvider } from '@composio/mastra';
import { Mastra } from '@mastra/core';

const composio = new Composio({
  apiKey: 'your-composio-key',
  provider: new MastraProvider()
});

const tools = await composio.tools.get('default', {
  toolkits: ['github']
});

const mastra = new Mastra({ tools });

const result = await mastra.run({
  prompt: 'Create a GitHub issue'
});
```

## Strict Mode

Enable strict mode to remove non-required properties:

```typescript theme={null}
const composio = new Composio({
  apiKey: 'your-key',
  provider: new MastraProvider({ strict: true })
});
```

## Tool Format

Tools are wrapped in Mastra's tool format:

```typescript theme={null}
import { createTool } from '@mastra/core/tools';

// Each tool is wrapped as:
const tool = createTool({
  id: 'GITHUB_CREATE_ISSUE',
  description: 'Create a new GitHub issue',
  inputSchema: zodSchema,
  outputSchema: zodSchema,
  execute: async (input, context) => {
    return result;
  }
});
```

## Tool Collection

Tools are organized in a dictionary:

```typescript theme={null}
interface MastraToolCollection {
  [key: string]: MastraTool;
}
```

## Next Steps

<CardGroup cols={2}>
  <Card title="Vercel AI SDK" icon="bolt" href="/typescript/providers/vercel">
    Alternative framework
  </Card>

  <Card title="Tools API" icon="wrench" href="/typescript/api/tools">
    Learn about tools
  </Card>
</CardGroup>
