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

## When to use

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

## How to use

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

### Docs

- [Fine-Grained Authorization (FGA)](references/docs-auth-fga.md) - Configure Mastra Fine-Grained Authorization for resource-level permissions that map routes to actions and scope stored resources for enterprise users.
- [MCP](references/docs-connections-mcp.md) - Connect Mastra agents to remote MCP servers, expose Mastra tools through MCPServer, manage approvals, and build interactive MCP Apps for Studio.
- [Connections](references/docs-connections-overview.md) - Connect Mastra to remote agents, coding agents, SDK runtimes, MCP servers, and external tools by choosing the protocol that fits your application.
- [MCP authentication and authorization](references/docs-guides-mcp-authentication-authorization.md) - Choose credentials for MCP connections, protect a Mastra MCP server, and separate delegated access from tool and data permissions.

### Reference

- [Reference: Tool configuration](references/reference-editor-tools.md) - Configure Editor agent tools from Mastra, MCP, workspace, and provider sources, including descriptions, display conditions, and resolution order.
- [Migration: @mastra/mcp v1 to v2](references/reference-migrations-mcp-v2.md) - Migrate @mastra/mcp to v2, which serves only the MCP 2026-07-28 revision and replaces elicitation with suspend/resume. Clients still connect to older servers.
- [MCP](references/reference-migrations-upgrade-to-v1-mcp.md) - MCP (Model Context Protocol) tool execution context has been reorganized, and deprecated client classes have been removed.
- [Reference: MCPClient](references/reference-tools-mcp-client.md) - The MCPClient class provides a way to manage multiple MCP server connections and their tools in a Mastra application.
- [Reference: MCPServer](references/reference-tools-mcp-server.md) - The MCPServer class provides the functionality to expose your existing Mastra tools and Agents as a Model Context Protocol (MCP) server.


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