> Documentation index: https://metorial.com/llms.txt. Every page is available as Markdown by adding .md to its URL.

# Use the Metorial docs in Claude Code, Cursor and Codex
URL: https://metorial.com/docs/build/use-docs-in-your-ai-client

Add the Metorial docs MCP server to Claude Code, Cursor or Codex, point agents at llms.txt and the markdown pages, and paste a task list into AGENTS.md.

---

To give your AI client the Metorial docs, add the read-only docs MCP server at `https://metorial.com/docs-api/mcp`. In Claude Code, run `claude mcp add --transport http metorial-docs https://metorial.com/docs-api/mcp`. In Cursor, add the URL under `mcpServers` in `mcp.json`. In Codex, run `codex mcp add metorial-docs --url https://metorial.com/docs-api/mcp`. The server needs no sign-in and has two tools: `search_docs` finds pages, and `read_page` returns a page as markdown. Agents without MCP can read [llms.txt](https://metorial.com/llms.txt) and the `.md` version of any page instead.

**What you'll learn**

* How to add the docs MCP server to Claude Code, Cursor, and Codex
* How agents can read the docs without MCP
* What to put in `AGENTS.md` so agents look things up instead of guessing

## What the docs server does

The docs server covers the guides at metorial.com/docs and the API reference at metorial.com/api. It is public, read-only, and stateless, and it uses the Streamable HTTP transport.

| Tool          | Input                                                                                            | Returns                                                                          |
| ------------- | ------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------- |
| `search_docs` | `query`, and `limit` from 1 to 10 (default 5)                                                    | Matching pages, each with its title, canonical URL, and a snippet                |
| `read_page`   | `url`: a full URL, a path such as `/docs/build/quickstart`, or a slug such as `build/quickstart` | The page as markdown, headed by its title and canonical URL, cut at about 100 KB |

This server only reads documentation. It is not the Magic MCP URL from your portal, which connects your AI client to your integrations. To set that up, see [Which AI clients work with Metorial?](https://metorial.com/docs/platform/clients)

## Add the server to your client

### Claude Code

Run this in a terminal. Add `--scope user` to make the server available in every project, not only the current one.

```bash
claude mcp add --transport http metorial-docs https://metorial.com/docs-api/mcp
```

To share it with everyone who works in a repository, commit a `.mcp.json` at the project root instead:

```json
{
  "mcpServers": {
    "metorial-docs": {
      "type": "http",
      "url": "https://metorial.com/docs-api/mcp"
    }
  }
}
```

Claude Code asks each person to approve project-scoped servers the first time they open the project.

### Cursor

Add the server to `.cursor/mcp.json` in your project, or to `~/.cursor/mcp.json` to use it in every project:

```json
{
  "mcpServers": {
    "metorial-docs": {
      "url": "https://metorial.com/docs-api/mcp"
    }
  }
}
```

### Codex

Run this once. The Codex CLI, IDE extension, and ChatGPT desktop app share the same configuration.

```bash
codex mcp add metorial-docs --url https://metorial.com/docs-api/mcp
```

Or add the server to `~/.codex/config.toml`, or to `.codex/config.toml` in a trusted project:

```toml
[mcp_servers.metorial-docs]
url = "https://metorial.com/docs-api/mcp"
```

### Other clients

Any client that supports remote MCP servers over Streamable HTTP can use the same URL with no authentication.

## Read the docs without MCP

Every page is also published as plain markdown, so an agent that can fetch URLs does not need the server.

| What                                             | Where                                                                             |
| ------------------------------------------------ | --------------------------------------------------------------------------------- |
| Index of every page, grouped by task and section | [metorial.com/llms.txt](https://metorial.com/llms.txt)                            |
| Every page in one file                           | [metorial.com/llms-full.txt](https://metorial.com/llms-full.txt)                  |
| One guide as markdown                            | Add `.md` to its URL, for example `https://metorial.com/docs/build/quickstart.md` |
| One API resource as markdown                     | Add `.md` to its URL, for example `https://metorial.com/api/sessions.md`          |
| Search as JSON                                   | `https://metorial.com/docs/api/v1/pages/search?q=scim`                            |

Requests for a docs or API page that send `Accept: text/markdown` are redirected to the markdown version.

Agents can also start from two short files written for them: [skill.md](https://metorial.com/docs-static/skill.md) explains what Metorial is and which setup path fits a task, and [setup.md](https://metorial.com/docs-static/setup.md) walks an agent through setup with or without a terminal.

## Add Metorial to AGENTS.md or CLAUDE.md

Paste this section into the `AGENTS.md` of a repository that uses Metorial. It names common Metorial tasks and the page that answers each one, so an agent fetches that page before it writes code or config.

```md
## Metorial

This project uses Metorial, an MCP gateway that connects AI clients and agents to tools. Do not answer Metorial questions from memory. Before you write code or config, fetch the page for the task and copy commands, config keys and SDK method names from it. Every docs URL returns markdown when it ends in `.md`.

| Task | Fetch this first |
| --- | --- |
| Connect Claude Code, Cursor, Codex, ChatGPT or Claude to Metorial | https://metorial.com/docs/platform/clients.md links the page for each client, for example https://metorial.com/docs/platform/clients/claude-code.md |
| Add an integration such as GitHub, Slack or Linear | https://metorial.com/docs/platform/integrations/create-integration.md |
| Let each person use their own account (per-user OAuth) | https://metorial.com/docs/platform/guides/per-user-oauth.md for a portal, https://metorial.com/docs/build/sdk/oauth.md in SDK code |
| Start with the SDK | https://metorial.com/docs/build/quickstart.md, then https://metorial.com/docs/build/sdk/javascript.md or https://metorial.com/docs/build/sdk/python.md |
| Call the HTTP API | https://metorial.com/api.md |
| Fix a failed sign-in, missing tool or failed tool call | The Troubleshooting section of the client's page, then https://metorial.com/docs/platform/integrations/review-connection-logs.md. For SDK errors, https://metorial.com/docs/build/sdk/error-handling.md |
| Anything else | https://metorial.com/llms.txt lists every page with a one-line description |

- To search the docs, use the `metorial-docs` MCP server (https://metorial.com/docs-api/mcp) when it is connected. Call `search_docs` with a short description of the task, then `read_page` with a result URL.
- A Magic MCP URL from a Metorial portal is not an API key. The client config holds only the URL, and each person signs in with OAuth.
- Read secret API keys, which start with `metorial_sk_`, from an environment variable such as `METORIAL_API_KEY`. Do not put them in code, committed files or an MCP client config.
```

The same text is published at `https://metorial.com/docs-static/agents.md`. To append it from a terminal, run this in the repository root:

```bash
curl -fsSL https://metorial.com/docs-static/agents.md >> AGENTS.md
```

Claude Code reads `AGENTS.md` only when the repository has no `CLAUDE.md`. If the repository has both files, paste the section into `CLAUDE.md`, or add the line `@AGENTS.md` to `CLAUDE.md` so that Claude Code imports `AGENTS.md`.

Delete the rows for tasks your repository does not involve. The section works without the docs MCP server, because every row points at a URL the agent can fetch.

## Related pages

* [Developer quickstart](https://metorial.com/docs/build/quickstart): Install the SDK and connect your first agent to tools.
* [Supported AI clients](https://metorial.com/docs/platform/clients): Connect Claude Code, Cursor, Codex, and other clients to your integrations.