# AI and MCP

Let coding agents look up components through the bundled MCP server.

The package ships an MCP server, `rax-mcp`, so coding agents can look components up instead of guessing. It reads the `DESIGN.md` of the installed version, runs locally over stdio and needs no network. Tools: `list_components`, `get_component` (import line, rules and docs link for one component), `search_components`, `get_design_rules` (the whole file or one section, e.g. "Setup").

Always name the package with `-p`: npx then uses the project's copy when `@a31labs/rax` is installed (so the rules match your version) and fetches the release otherwise. Never run a bare `npx rax-mcp`, because the unscoped name on npm does not belong to Rax.

Claude Code:

```sh
claude mcp add rax -- npx -y -p @a31labs/rax rax-mcp
```

Project config for Claude Code (`.mcp.json`) and Cursor (`.cursor/mcp.json`):

```json
{ "mcpServers": { "rax": { "command": "npx", "args": ["-y", "-p", "@a31labs/rax", "rax-mcp"] } } }
```

VS Code (`.vscode/mcp.json`):

```json
{ "servers": { "rax": { "type": "stdio", "command": "npx", "args": ["-y", "-p", "@a31labs/rax", "rax-mcp"] } } }
```

Agents without MCP can read https://rax.a31.at/llms.txt (an index of every page as markdown) or https://rax.a31.at/llms-full.txt (all of it in one file).

Page: https://rax.a31.at/foundations/mcp
