---
name: mastra-server
description: Documentation for @mastra/server. Use when working with @mastra/server APIs, configuration, or implementation.
metadata:
  package: "@mastra/server"
  version: "1.45.0"
---

## When to use

Use this skill whenever you are working with @mastra/server to obtain the domain-specific knowledge.

## How to use

Read the individual reference documents for detailed explanations and code examples.

### Docs

- [A2A](references/docs-agents-a2a.md) - Expose and call remote Mastra agents over the Agent-to-Agent protocol.
- [Custom adapters](references/docs-server-custom-adapters.md) - Create a custom server adapter for frameworks other than Hono or Express.
- [Middleware](references/docs-server-middleware.md) - Apply custom middleware functions to intercept requests.

### Reference

- [Reference: createRoute()](references/reference-server-create-route.md) - API reference for createRoute() function used to define type-safe routes with validation and OpenAPI generation.
- [Reference: MastraServer](references/reference-server-mastra-server.md) - API reference for the MastraServer abstract class used to create server adapters.
- [Reference: Server routes](references/reference-server-routes.md) - API reference for HTTP routes registered by Mastra server adapters.


Read [assets/SOURCE_MAP.json](assets/SOURCE_MAP.json) for source code references.