MCP server
Every writedocs site can run an MCP server at /mcp. An AI tool connected to it searches and reads your docs directly, always the published version, instead of relying on what it remembers.
It’s on by default. On the WriteDocs platform, /mcp works with nothing to set up. With WriteDocs analytics on for your project, the platform also counts the tools AI agents call, and each query an agent sends to search_docs is recorded in your project’s analytics as an AI search, with the number of pages it found. writedocs dev serves it at http://localhost:4321/mcp while you write.
What an AI tool gets
Three tools, answered from your pages:
list_docs— every page, with its title, URL and description.search_docs— the best-matching pages for a query, optionally only one docs version or language (taken from your navigation’sversionsandlanguages). It returns at most 5 pages, or up to 20 when the tool asks for more.get_doc— a page’s full content as Markdown, or several pages at once. It accepts each page’s path or URL, as the tool or a reader would write it.
Pages read the way they show on the site: imported snippets included, variables filled in, code examples exactly as written. Pages with seo.noindex are left out, as they are from llms.txt.
Connecting
Point the client at your site’s /mcp address:
{
"mcpServers": {
"acme-docs": { "type": "http", "url": "https://docs.example.com/mcp" }
}
}In Claude Code, .mcp.json sits at the root of your project. claude mcp add --transport http acme-docs https://docs.example.com/mcp adds the server from the terminal instead.
In Cursor: Settings → MCP → Add server, and paste the URL. Opening /mcp in a browser shows a short description of the server.
A site served under a path has the server under it too: https://example.com/docs/mcp, and http://localhost:4321/docs/mcp in writedocs dev. The page menu’s Copy MCP server URL and Connect options use that address.
Readers don’t need to find the URL themselves: every page’s contextual menu has Copy MCP server URL, Connect to Cursor and Connect to VS Code - the last two add the server to the editor in one click.
Turning it off
{
"mcp": false
}The site is then built without mcp-index.json, the index the server reads, and /mcp answers 404 - opened in a browser, with the site’s “not found” page.