IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/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. /max/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 mojolang.org/llms.txt for Mojo-specific AI context. This page covers resources available on docs.modular.com:

  • 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).

  • Modular skills: Reusable AI agent skills that follow the Agent Skills Standard, equipping coding agents with standard workflows to build Mojo projects, write optimized GPU kernels, profile model performance, and bring new model architectures to MAX.

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-kernels.txtMAX AI kernels API (package indexes)Kernel and GPU development
llms-c-api.txtMAX C API referenceC API integration
llms-glossary.txtGlossary terms (full content)Terminology lookup
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.

Skills

Modular skills are official AI agent skills that encapsulate modern best-practices for working with the Modular Platform, including MAX and Mojo. They allow AI coding agents to become fluent in developing new Mojo projects, writing correct Mojo syntax, programming GPUs, profiling model performance, evaluating model accuracy, and importing new model architectures into MAX.

To get started, install the skills:

npx skills add modular/skills

The skills are structured to follow the Agent Skills Standard.

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

Was this page helpful?