MCP server

Connect MCP clients to your per-repo server, learn what the endpoint exposes, and how to disable it.

When an assistant can pull raw MDX from your repository (not a one-time HTML scrape), it answers with the same wording, examples, and structure your team published. docs.page runs a Model Context Protocol (MCP) server for every hosted public repository.

Before you begin

  • A published docs URL you can open in a browser (see Agent-ready docs)
  • A public GitHub repository; private repos return 404 for MCP

MCP is on by default. You only edit docs.json when you want to turn the endpoint off. For server design, tools, and access control detail, see MCP server on Features.


Overview

Each docs.page site gets a read-only MCP endpoint scoped to that repository's owner, name, and optional ref (branch, commit, or pull request):

text
https://docs.page/{owner}/{repo}/mcp

Branch and pull request previews add a ~ref segment before /mcp. Custom domains serve the same path at /mcp on that host.

The server speaks streamable HTTP MCP. There is no write access to your GitHub repo or docs.json.

How it works

Tools agents call

ToolPurpose
list_doc_filesReturns .mdx pages in the current repository context
read_doc_pageFetches raw MDX source for a path such as docs/getting-started.mdx

read_doc_page returns source text (the same files under docs/ that docs.page renders), not pre-rendered HTML. That keeps token use predictable and lets the agent cite exact headings and code blocks.

Resources

Beyond tools, the server advertises MCP resources:

  • docs-page-config-schema: JSON schema for docs.json
  • Agent skills: when your repo includes .agents/skills/**, each SKILL.md is exposed as a markdown resource

A typical agent session

  1. Client connects to your MCP URL
  2. Agent calls list_doc_files to see available pages
  3. Agent calls read_doc_page for paths relevant to the user's question
  4. Agent cites headings and code blocks from the returned source

Use MCP when the agent works in an editor or terminal, should load only relevant pages, or needs skill resources alongside docs. For a one-fetch catalog instead, see llms.txt.

Connect from the live site

Open any page on your published docs site. MCP setup is available from two places in the UI:

Entry pointOptions
Page action menu ( Copy page chevron)Install with MCP (opens dialog), Connect to Cursor, Connect to VSCode
Command palette (Cmd+K / Ctrl+K, empty query)Install MCP (opens the same dialog)

Install with MCP / Install MCP opens a dialog titled Install MCP with your endpoint URL and copy-ready snippets for Cursor, Claude Code, VS Code, and Antigravity.

Connect to Cursor and Connect to VSCode skip the dialog and register the server via a one-click deep link (cursor://… or vscode:mcp/install?…) using the MCP URL for the site you have open.

The command palette shows Install MCP only when MCP is enabled (mcp.enabled is not false). The page menu lists MCP items on every hosted page.

Connect manually

When you cannot use the live site UI, configure a client by hand:

Create or edit .cursor/mcp.json:

json
{
  "mcpServers": {
    "owner-repo": {
      "url": "https://docs.page/owner/repo/mcp"
    }
  }
}

Replace owner, repo, and the URL with your repository values (or copy from Install MCP on the live site).

After connecting, invoke list_doc_files, then read_doc_page with a path from the listing.

Disable MCP (optional)

To keep a public site but block programmatic source access, set mcp.enabled to false in docs.json:

json
{
  "mcp": {
    "enabled": false
  }
}

Commit and publish. The MCP route returns 404, Install MCP disappears from the command palette, and MCP deep links point at an unavailable endpoint. llms.txt exports are unaffected.

Related