IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).

Using AI coding assistants

This page describes how you can accelerate your MAX development with popular AI coding assistants (Cursor, Claude Code, GitHub Copilot, Windsurf, and others). Mojo language documentation is hosted separately at mojolang.org; use Mojo AI skills for Mojo-specific context. This page covers resources available on docs.modular.com:

  • MAX skills: Reusable AI agent skills that follow the Agent Skills Standard, equipping coding agents with standard workflows to build MAX projects, bring up new model architectures, and profile and benchmark model performance.

  • Documentation files (llms.txt): Raw text files that AI tools use for website navigation hints and direct access to up-to-date API documentation.

  • Docs MCP server: A hosted Model Context Protocol server that gives your assistant live, queryable access to the docs: search, API symbol lookup, code examples, and import validation.

  • Project context files (CLAUDE.md and AGENTS.md): Markdown files in your project that provide AI assistants with build commands, coding conventions, and project structure.

  • Cursor project rules (.cursor/rules/): Modular-specific rules that activate based on the files you're editing, providing consistent guidance for MAX development (and Mojo when using rules from the Modular repository).

Install MAX skills

MAX skills are AI agent skills that capture best practices and step-by-step workflows for working with MAX. They allow AI coding agents to become fluent in developing new MAX projects, from model bring-up to benchmarking.

The skills follow the Agent Skills Standard, so any AI coding agent can use them.

Add the Modular plugin marketplace to Claude Code and install the skills plugin:

/plugin marketplace add modular/skills
/plugin install skills@modular

The skills plugin installs both the MAX and Mojo skills. If you want only the MAX-specific skills, install max-skills@modular instead; for only the Mojo skills, install mojo-skills@modular.

With Codex and other agents, install the skills with Node.js:

npx skills add modular/skills

For details on available skills, installation, and usage examples, see the Modular Skills repository.

Giving our docs to your AI assistant

To improve code quality and accuracy from your AI assistant, add Modular's documentation to your AI tool's context. We provide different llms.txt files that are optimized for different use cases:

If you're in Cursor, use the @ syntax in the chat window to reference documentation directly. For example, to insert the MAX Python API documentation, add this to your chat:

@docs.modular.com/llms-python.txt

For all other tools (Claude Code, Copilot, Windsurf, and others), just tell the AI to fetch the documentation:

Read https://docs.modular.com/llms-python.txt for MAX Python API documentation

For more details, see the section below about our llms.txt files.

Connect to the docs MCP server

Connect the docs MCP server to give your AI assistant live access to MAX's documentation. Your assistant can search all of MAX's tutorials, API references, and code examples while it plans, writes, and debugs your code, so its answers stay grounded in the current documentation instead of its training data.

Your assistant can usually set up the MCP server itself with a prompt like this:

Add the MAX docs MCP server at https://mcp.modular.com/mcp/ and verify it
by searching the docs.

Or configure it manually in your tool's settings.

With Claude Code, add the server from the command line:

claude mcp add --transport http max-docs https://mcp.modular.com/mcp/

With Cursor, add the server to ~/.cursor/mcp.json:

{
  "mcpServers": {
    "max-docs": {
      "url": "https://mcp.modular.com/mcp/"
    }
  }
}

Any other client that supports MCP's streamable HTTP transport connects with the same URL. The server indexes both the nightly and stable documentation.

Working in the Modular repository

When you clone the Modular repo, your AI tool will automatically discover project context (either CLAUDE.md or AGENTS.md) files that provide:

  • Build and test commands
  • Project architecture overview
  • Coding conventions and commit message guidelines
  • Common development workflows

Different tools look for different files (either CLAUDE.md or AGENTS.md, which are identical)—for compatibility details, see the section below about Modular context files.

Cursor users: The repository also includes project rules in .cursor/rules/ that activate based on the files you're editing. These rules provide file-specific guidance for Mojo and MAX development. See Modular Cursor rules for the full list.

Starting a new project

For your own MAX projects, the entirety of our CLAUDE.md and AGENTS.md files are probably not useful for your own projects because they're specific to the Modular repository.

However, you might find some parts useful, such as the section about Critical development notes, which you can copy to your own CLAUDE.md or AGENTS.md file.

Cursor users: You also might want to copy the Modular Cursor rules below to your .cursor/rules/ directory.

Resources for AI assistants

Here are all the resources we provide for AI assistants.

Modular llms.txt files

Our documentation supports the llms.txt proposed standard, providing LLM-friendly documentation files:

FileDescriptionBest for
llms.txtCompact index linking to segment filesStarting point for all agents
llms-max-guides.txtMAX guides (develop, serve, deploy)Application development
llms-python.txtMAX Python API indexesPython-based MAX development
llms-accelerator-api.txtMAX accelerator library API indexesKernel and GPU development
llms-c-api.txtMAX C API referenceC API integration
mojolang.org/llms.txtMojo language docs (external)Mojo development

Modular Cursor rules

Copy these rules to your .cursor/rules/ directory for consistent AI assistance with Mojo and MAX development:

  • general_behavior_rules.mdc: General rules for code creation. Emphasizes simplicity, thorough investigation, using existing solutions, descriptive naming, robust error handling, and documentation.

  • git.mdc: Best practices for Git including code organization, commit strategies, branching models, and collaborative workflows.

  • max_development.mdc: Guidelines for MAX development covering project context, task execution, code quality, testing practices, and documentation.

  • mojo.mdc: Mojo coding standards, performance optimizations, and best practices for GPU-accelerated code.

Modular context files

Project context files (CLAUDE.md and AGENTS.md) provide AI coding assistants with essential project information, such as:

  • Build and test commands
  • Project architecture overview
  • Coding conventions and commit message guidelines
  • Common development workflows

Although CLAUDE.md is primarily used for Claude Code, some other AI tools also read it, but perhaps not by default when working in the repository—you might need to explicitly tell your AI to read it.

The AGENTS.md filename is a more generic name that other coding assistants have adopted.

To ensure compatibility with other tools, we provide both CLAUDE.md and AGENTS.md files—our AGENTS.md file is just a symlink to the CLAUDE.md file.

Was this page helpful?