# Mastra Templates

CreateWithAI Hub page: https://createwithaihub.com/templates/mastra-templates
Latest version of this file: https://createwithaihub.com/templates/mastra-templates.md

- Type: Template · Category: Templates & Starter Kits
- Publisher: Mastra (official)
- Pricing: Free · License: Apache-2.0

Mastra's collection of ready-to-run TypeScript agent, workflow and MCP server projects, scaffolded with create-mastra.

Mastra Templates are complete Mastra projects that you scaffold, add API keys to and open in Mastra Studio. Examples include a deep search research assistant, chat with a database or PDF, a customer refund agent, a GitHub PR code review agent, a browser agent, meeting notes and a starter agent harness. Templates live in the Apache-2.0 Mastra monorepo and are synced to standalone repositories for cloning.

Useful for: Starting a research or customer-support agent in TypeScript from a working example instead of an empty project.

## Key features

- Templates for agents, workflows and MCP servers
- Examples: deep search, chat with PDF/database, text-to-SQL, refund agent, PR review, browser agent
- Scaffold with npx create-mastra@latest --template <name>
- Runs in Mastra Studio at localhost:4111
- Each template ships .env.example and a quickstart README
- Mastra apps deploy with built-in deployers for Vercel, Netlify and Cloudflare, or as a Node.js server anywhere

## Connection

- Stack: TypeScript
- Builds: Agent, MCP server
- Deploys to: Vercel, Cloudflare, Anywhere / self-host

## Before you start

- Node.js
- Model provider API key (OpenAI by default)

## Install steps from the official documentation

Scaffold a template:

```
npx create-mastra@latest --template deep-search
```

Start dev server:

```
npm run dev
```

## Limitations

- Most templates default to OpenAI and need a model provider API key
- Some newer templates depend on Mastra platform services (Gateway, @mastra/connect)

## Official links

- Website: https://mastra.ai/templates
- Source repository: https://github.com/mastra-ai/mastra/tree/main/templates
- Documentation: https://mastra.ai/docs/getting-started/templates
- Source: https://mastra.ai/templates (What templates are, example templates, Studio at localhost:4111, monorepo sync to standalone repos)
- Source: https://mastra.ai/docs/getting-started/templates (Templates are complete projects to clone; listing location; API key env vars)
- Source: https://github.com/mastra-ai/mastra/tree/main/templates (templates/README.md: template list, create-mastra --template quickstart; template-deep-search README; LICENSE.md: Apache-2.0 outside ee/ directories)
- Source: https://mastra.ai/docs/deployment/overview (Deployment options: Mastra server anywhere, Mastra platform, built-in deployers for Vercel, Netlify and Cloudflare)
