# Read these docs with an agent

Every page is published as Markdown beside its HTML, with an index of the whole site, and a local MCP server serves the same pages to a coding agent as tools.

A coding agent reads documentation badly through a browser and well through Markdown. Every page on this site, the help centre and the distributor site is published twice: as the page you are reading and as the Markdown it was rendered from. There is an index of each site for an agent to start from, and a small MCP server that serves the same pages as tools.

**Who can use it:** anyone who can reach the documentation. Nothing here needs a platform licence or an API key.

## The Markdown twin of every page

Add `.md` to any documentation path and you get the source of that page.

| What you want | Where it is |
| --- | --- |
| One page as Markdown | The page's path with `.md`, for example `/cookbooks/ask-a-knowledge-graph.md` |
| An index of the site, with a description per page | `/llms.txt` |
| Every page of the site in one file | `/llms-full.txt` |

`llms.txt` is a list of links grouped by section, which is the cheap way for an agent to see what exists before fetching anything. `llms-full.txt` is the whole site in one response, which is the expensive way and is better suited to a one-off ingest than to a question.

The Markdown is the rendered page, so the generated reference pages appear in it with their tables intact, and a page's licence pills appear as a line of feature names under the title.

## The docs MCP server

The same pages, as tools a coding agent can call rather than files it has to fetch. The server is in the documentation repository and runs beside your checkout over stdio.

```bash
pnpm build                       # the server reads the built Markdown
node tools/docs-mcp/server.mjs   # speaks MCP on stdin and stdout
```

Point a client at it the way you point it at any stdio MCP server:

```json
{
  "mcpServers": {
    "katonic-docs": {
      "command": "node",
      "args": ["tools/docs-mcp/server.mjs"],
      "cwd": "/path/to/katonic-docs-platform"
    }
  }
}
```

| Tool | What it does |
| --- | --- |
| `search_docs` | Finds the pages containing every word of a query, best first, each with a snippet and a path. Takes `query`, and optionally `site` and `limit` |
| `get_page` | Returns one page as Markdown, exactly as published. Takes the `path` from a search result |
| `list_pages` | Lists paths and titles, optionally filtered by `site` and by a path `prefix` |

A session usually goes search, then read: `search_docs` with the question, then `get_page` on the path that looks right. `list_pages` with a prefix such as `/cookbooks/` is the quickest way to see one section whole.

## What the search does and does not do

The search is lexical. It requires every meaningful word of the query to appear on the page, weighs a word in the title far above a word in the body, and damps long pages so that a generated reference page does not outrank the guide that answers the question. It does not embed anything, so a question phrased in words the documentation never uses will find nothing rather than finding something close.

When a search returns nothing, drop to the distinctive noun: `rerank`, `agent_type`, `no_models_for_requested_tier`. Those are the words the pages actually contain.

## Limits

- The server reads the built Markdown, so it answers from the last `pnpm build` rather than from the working tree. Rebuild after editing a page.
- It is a local server against a checkout. There is no hosted endpoint, and it holds no credentials and reads nothing but the built files.
- Search covers the pages of all three sites at once. Pass `site` when you want only one; a question about the public API can otherwise match a help centre page that uses the same words.
- Stop words are dropped from a query, so a search for "how do I" alone matches nothing.
- The `.md` twin and `llms.txt` come from the site build, which means they exist wherever the site is served from, including a local `pnpm serve`.

## Next steps

  - [Katonic MCP Server](https://docs.katonic.ai/developers/libraries/mcp-server/): The platform's own MCP server, which exposes the public API as tools rather than the documentation.
  - Build a coding agent on the harness: Give an agent the platform's coding preamble and your own retrieval.
  - [Katonic CLI](https://docs.katonic.ai/developers/libraries/cli): The other tool that runs beside a checkout.

## Related

- [Key terms](/developers/key-terms)
- API overview
- Authentication

Source: https://docs.katonic.ai/developers/libraries/docs-for-agents
