# Mastra Deploy

> Mastra Deployment and Server guide - server adapters, authentication, middleware, client SDK, cloud providers, and production deployment. Covers registerApiRoute custom endpoints, server middleware, CORS config, MastraClient calls from Next.js/React frontends, auth providers, and cloud/serverless targets (Vercel, Cloudflare, AWS, Azure).

- Skill: `artsmc-claude-dev-agents/mastra-deploy` (Agent Skill, multi-file: 4 files)
- Install (CLI): `npx skillmds@latest add artsmc-claude-dev-agents/mastra-deploy`
- Raw SKILL.md: https://api.skillmd.com/api/skills/artsmc-claude-dev-agents/mastra-deploy/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Web & Frontend
- Author: artsmc (https://skillmd.com/u/artsmc-claude-dev-agents)
- Updated: 2026-09-10
- Page: https://skillmd.com/skills/artsmc-claude-dev-agents/mastra-deploy

---


# Mastra Deployment and Server Configuration

Comprehensive guide for deploying Mastra applications. Covers MastraServer with adapter packages (@mastra/express, @mastra/hono, @mastra/fastify, @mastra/koa), authentication providers, custom API routes, middleware, MastraClient SDK, and cloud deployment (Vercel, Cloudflare, Netlify, AWS, Azure, Digital Ocean).

## Usage

```bash
/mastra-deploy
```

Provides context for:
- `MastraServer` from adapter packages (not `createServer`)
- Server adapters: Express, Hono, Fastify, Koa
- Auth: `MastraAuthBetterAuth`, `MastraAuthClerk`, `MastraAuthSupabase`
- `registerApiRoute()` with Hono-style context
- `MastraClient` SDK (`getAgent()`, `getWorkflow()`)
- Cloud deployers: `VercelDeployer`, `CloudflareDeployer`, `NetlifyDeployer`
- Middleware and request context patterns

