> ## Documentation Index
> Fetch the complete documentation index at: https://docs.heylua.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Add the docs MCP server to your coding assistant

> Connect Claude Code, Claude, Cursor, or Windsurf to these docs over MCP so your assistant searches and reads the published pages instead of guessing

After this guide, your coding assistant can search and read this documentation through the MCP server at `https://docs.heylua.ai/mcp`, so answers about `lua-cli` come from the published pages rather than from training data. The server is read-only and needs no account. In Claude Code, the [plugin](/build-with-ai/claude-code-plugin) registers it for you.

*Verified against lua-cli 3.33.0.*

The server exposes three tools.

| Tool                            | What it does                                                                                                                                                                                           |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `search_lua_cli`                | Semantic search across the docs; returns matching passages with page titles and links                                                                                                                  |
| `query_docs_filesystem_lua_cli` | Runs one read-only shell command (`tree`, `ls`, `rg`, `grep`, `find`, `head`, `cat`, `jq`, and similar) against an in-memory filesystem that holds every page as `/<path>.mdx`; each call is stateless |
| `submit_feedback`               | Reports a page that is wrong, outdated, confusing, or incomplete to the docs team                                                                                                                      |

**Before you begin**

* A client that supports MCP over HTTP: Claude Code, claude.ai or the Claude desktop app, Cursor, or Windsurf. For a client that only supports stdio, see [Options you may need](#options-you-may-need).

<Steps>
  <Step title="Add the server">
    Register the server once; its tools are available in every conversation afterwards.

    <Tabs>
      <Tab title="Claude Code">
        Add it for the current project, or add `--scope user` to make it available in every project.

        ```bash theme={null}
        claude mcp add --transport http lua-docs https://docs.heylua.ai/mcp
        ```
      </Tab>

      <Tab title="Claude">
        In claude.ai or the Claude desktop app, select **Customize**, then **Connectors**, select **+** and **Add custom connector**, enter `https://docs.heylua.ai/mcp`, and select **Add**; the server needs no sign-in, so leave the OAuth fields empty. On Team and Enterprise plans an owner adds it under **Organization settings**; the Free plan allows one custom connector.
      </Tab>

      <Tab title="Cursor">
        Add the server to `.cursor/mcp.json` in the project, or to `~/.cursor/mcp.json` for every project.

        ```json .cursor/mcp.json theme={null}
        {
          "mcpServers": {
            "lua-docs": {
              "url": "https://docs.heylua.ai/mcp"
            }
          }
        }
        ```
      </Tab>

      <Tab title="Windsurf">
        Add the server to `~/.codeium/windsurf/mcp_config.json`.

        ```json ~/.codeium/windsurf/mcp_config.json theme={null}
        {
          "mcpServers": {
            "lua-docs": {
              "serverUrl": "https://docs.heylua.ai/mcp"
            }
          }
        }
        ```
      </Tab>
    </Tabs>
  </Step>

  <Step title="Verify">
    Ask a question only the docs can answer and check which tool the assistant calls.

    ```text theme={null}
    What input does `lua test webhook` expect, and what does exit code 9 mean?
    ```

    In Claude Code, `/mcp` lists `lua-docs` as connected with three tools, and the answer cites results from `search_lua_cli` or `query_docs_filesystem_lua_cli`. An assistant that uses the server well searches first, reads a page with `head -80 /<path>.mdx`, and uses `rg -il "<term>" /` for exact identifiers.
  </Step>
</Steps>

## Options you may need

### Read the docs without MCP

The site publishes plain-text indexes any tool can fetch: `https://docs.heylua.ai/llms.txt` lists every page with a one-line description, `https://docs.heylua.ai/llms-full.txt` holds the full text of every page in one file, and any page is available as Markdown when you append `.md` to its URL.

### Clients that only support stdio

Bridge the HTTP server with [`mcp-remote`](https://www.npmjs.com/package/mcp-remote) in any client that accepts a command-based server definition.

```json theme={null}
{
  "mcpServers": {
    "lua-docs": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://docs.heylua.ai/mcp"]
    }
  }
}
```

## If it isn't working

<Accordion title="Claude Code doesn't list lua-docs">
  `claude mcp list` shows every configured server with its connection status. A server added with the default `--scope local` loads only in the project where you added it; add it again with `--scope user`, or open `/mcp` to read the connection error.
</Accordion>

<Accordion title="The server is listed but the assistant never calls it">
  Ask a question that names a Lua identifier, such as `LuaJob` or `lua version promote`; a generic question may be answered from memory. In Cursor and Windsurf, restart the editor if the server doesn't appear after you edit the config file.
</Accordion>

## Next steps

<Columns cols={2}>
  <Card title="Build with a coding assistant" href="/build-with-ai/overview">
    The exports, commands, exit codes, and compile rules to give the assistant.
  </Card>

  <Card title="Build with the Claude Code plugin" href="/build-with-ai/claude-code-plugin">
    Slash commands and a production gate on top of the same CLI and this server.
  </Card>

  <Card title="SDK reference" href="/reference/sdk/overview">
    One page per export, the pages the assistant reads most.
  </Card>

  <Card title="CLI reference" href="/reference/cli/overview">
    Every command, flag, and exit code.
  </Card>
</Columns>
