Build with AI - Accessing Mastra Documentation for AI Agents

Trust: ★★★☆☆ (0.90) · 0 validations · developer_reference

Published: 2026-05-10 · Source: crawler_authoritative

Tình huống

Guide for configuring AI agents to access current Mastra documentation, patterns, and best practices using Skills, MCP Docs Server, or embedded package docs.

Insight

Mastra provides multiple methods for AI agents to access up-to-date documentation. Mastra Skills are folders containing setup instructions, best practices, and scripts that agents can discover and use for accurate code generation. The MCP Docs Server provides additional tools including migration capabilities and access to the Mastra 101 course. Mastra packages ship embedded documentation in dist/docs containing SKILL.md files following the skills standard, a references/ folder with package-specific documentation, and an assets/SOURCE_MAP.json file linking public exports to their node_modules location. Context files include a root /llms.txt providing an overview of all documentation pages, plus individual page-specific llms.txt files accessible by adding /llms.txt to any docs URL or .md extension. Each docs page also features a ‘Copy markdown’ button for streamlined markdown versions and a dropdown menu to open pages in GitHub, ChatGPT, Claude, and other AI platforms.

Hành động

Install Mastra Skills using your package manager: npx skills add mastra-ai/skills (npm), pnpm dlx skills add mastra-ai/skills (pnpm), yarn dlx skills add mastra-ai/skills (Yarn), or bun x skills add mastra-ai/skills (Bun). Access context files by appending /llms.txt or .md to any documentation URL (e.g., /docs/llms.txt or /docs.md). AI agents can read embedded documentation directly from node_modules in each installed Mastra package’s dist/docs folder. Use the MCP Docs Server when you need its tools like the migration tool; otherwise prefer Skills for better performance.

Kết quả

AI agents gain direct access to current Mastra documentation, enabling accurate code generation and faster development with up-to-date API patterns and best practices.

Điều kiện áp dụng

Mastra Skills installation requires Node.js-compatible package manager (npm, pnpm, Yarn, or Bun)


Nội dung gốc (Original)

Build with AI

AI agents may not have up-to-date knowledge about Mastra’s APIs, patterns, and best practices. These resources give your AI tools direct access to current Mastra documentation, enabling them to generate accurate code and help you build faster.

Mastra skills

Agent Skills are folders of instructions, scripts, and resources that agents can discover and use to do things more accurately and efficiently. Mastra Skills contain setup instructions, best practices, and instructions on how to fetch up-to-date information from Mastra’s documentation.

npm:

npx skills add mastra-ai/skills

pnpm:

pnpm dlx skills add mastra-ai/skills

Yarn:

yarn dlx skills add mastra-ai/skills

Bun:

bun x skills add mastra-ai/skills

Read the dedicated Mastra Skills guide to learn more about installation options and available skills.

Tip: If you’re interested in giving your agent access to Mastra’s documentation, we recommend using Skills. While the MCP Docs Server also provides this information, Skills will perform better. Use the MCP Docs Server when you need its tools, e.g. the migration tool.

MCP docs server

In addition to documentation access, the MCP Docs Server also provides tools to help you migrate to newer versions of Mastra or follow the Mastra 101 course.

Learn how to use the MCP Docs Server.

Embedded package docs

Mastra packages ship with embedded documentation in dist/docs. When you install a Mastra package, your AI agent can read these files directly from node_modules to understand the package’s APIs and patterns.

Each dist/docs includes:

  • SKILL.md: A skill file following the skills standard
  • references/: A folder with documentation files relevant to the package
  • assets/SOURCE_MAP.json: A source map file linking public exports to their location in node_modules

Context files

Mastra provides a root llms.txt file that contains an overview of all available documentation pages.

Each documentation page also has its own llms.txt file. These files are streamlined markdown files. At the end of each docs page you’ll find a link to the corresponding llms.txt file.

Add /llms.txt to any Mastra docs URL to access it. You can also request it by adding a .md extension to the end of the URL.

Examples for the introduction page:

Mastra’s documentation

In addition to the context files each documentation page also features a “Copy markdown” button at the top of the page. It’ll copy the streamlined markdown version to your clipboard. Beside it, you’ll find a dropdown menu to open the page on GitHub, in ChatGPT, Claude, and others.

Liên kết

Xem thêm: