Skip to content
Thally
Log inGet started
Guide

Published · 8 min read

Learn what an MCP server for documentation does, what to expose to AI tools like Claude and Cursor, and how to keep answers accurate after every merge.

By Published Updated

Illustration of a developer workspace with a laptop, a second monitor and a stack of reference pages.

When a developer asks Claude or Cursor how to authenticate against your API, where does the answer come from? If it comes from stale training data or a half-parsed HTML page, you already know how that ends. An MCP server for documentation gives AI tools a direct, structured way to query your current docs at the moment the question is asked. This guide covers what that server does, what to expose through it, and how to set one up without creating a second copy of your content to maintain.

What an MCP server does for docs

The Model Context Protocol is an open standard that enables developers to build secure, two-way connections between their data sources and AI-powered tools. The architecture is simple: you either expose data through an MCP server, or you build an AI application, called an MCP client, that connects to those servers.

Before MCP, every new data source required its own custom implementation, which made connected systems hard to scale. Now a docs team can build against one protocol instead of maintaining a connector per assistant.

An MCP server for documentation, in plain terms

An MCP server can offer three kinds of things to a client, according to the protocol's architecture overview:

  • Tools: executable functions the AI application can invoke
  • Resources: data sources that provide contextual information
  • Prompts: reusable templates that structure interactions with a model

For docs, tools do most of the work. A client lists the available tools, provides them to the model, and executes the ones the model calls. So when a developer asks a question, the model can call a search tool, get matching pages, fetch the one it needs, and answer from that text.

The exchange runs on a JSON-RPC 2.0 based protocol. The server can sit on the public web next to your docs. Microsoft's Learn MCP Server, for example, is a remote MCP server that uses streamable HTTP.

The standard also looks durable. In December 2025, Anthropic donated MCP to the Agentic AI Foundation, a directed fund under the Linux Foundation, co-founded with Block and OpenAI, and there is now an official, community-driven Registry for discovering available MCP servers.

Why AI tools like Claude, Cursor and Copilot need it

Your readers are already asking assistants about your product. In the Stack Overflow 2025 Developer Survey, 84% of respondents said they use or plan to use AI tools in their development process. Trust is the weak spot: 46% of developers said they don't trust the accuracy of the output from AI tools, up from 31% the previous year.

Documentation is where that accuracy has to come from. The same survey lists technical documentation as the top resource for learning to code, at 68%. Developers still depend on your docs, but more and more often an assistant reads them on the developer's behalf.

Without a structured endpoint, the assistant has two bad ways to read them:

  • Answer from training data, which may describe a version you shipped long ago
  • Fetch your HTML pages and spend context on navigation, scripts, and layout

The second option matters more than it sounds. The llms.txt proposal notes that a coding agent fetches a library's documentation to get an API call right, and that context windows are still too small for most websites in their entirety, with every wasted token costing time and money.

An MCP server fixes both problems. The assistant asks a narrow question, gets a small, clean answer from your current published docs, and moves on. Any client that speaks the protocol can use the same server, so you are not building one integration per tool.

Illustration of a developer's hands on a keyboard beside a laptop with an open chat window.

What to expose: pages, structured JSON, and evidence

Do not expose everything. A few well-described tools serve a model better than a long menu it has to guess at. Start with three layers.

Pages

Expose clean Markdown, not rendered HTML. The minimum useful set is:

  • A search tool that takes a query and returns titles, URLs, and short excerpts
  • A fetch tool that returns one page's full Markdown by URL or ID

This is the same pattern most public docs MCP servers follow, and it covers the majority of "how do I" questions.

Structured JSON

Reference content is where assistants make the costliest mistakes: a wrong parameter name, a missing required field, an endpoint that was renamed. Expose that content as structured data rather than prose so the model does not have to parse a table. That includes:

  • Endpoints, methods, parameters, and types
  • Config options and their defaults
  • Version and deprecation status for each item

Evidence

Can the assistant, and the developer reading its answer, tell where a claim came from? Attach provenance to what you return:

  • The canonical URL of the page
  • When it was last updated
  • The product version it applies to
  • Where possible, the source change that prompted the last edit

Evidence lets a model prefer the current page over an archived one, and it gives the developer a link to verify. Given how many developers distrust AI output, that link matters.

Don't skip llms.txt

MCP and llms.txt complement each other. The MCP server handles queries, and llms.txt is a static index any agent can read without a client connection. The file can sit at the site root or at any path within it, covering the pages under that path. OpenAI (developers.openai.com/llms.txt), Anthropic (platform.claude.com/llms.txt), and Gemini (ai.google.dev/gemini-api/docs/llms.txt) publish llms.txt files for their own developer docs.

Setting it up from one content source

The most common mistake is treating the MCP server as a separate project with its own content. If you do that, you have two things to keep current. Derive the site, the Markdown, the JSON, and the MCP responses from the same files.

That approach also answers a question teams ask a lot: how do you publish machine-consumable docs without forcing writers into a complicated workflow? Writers keep authoring in Markdown or MDX, in Git, with pull request review, and the machine outputs are build artifacts.

A workable sequence:

  • Pick the single source. Use one repository of Markdown or MDX with consistent frontmatter for title, description, version, and last-updated date.
  • Generate every output at build time. Produce the HTML site, per-page Markdown, structured JSON, and llms.txt from that source in one build.
  • Stand up the MCP endpoint. Use an official SDK, which exists for all major programming languages, or a docs engine that ships one. Thally's engine, for example, includes Markdown, JSON and JSON-LD output, discovery files, a documentation MCP endpoint, and a deterministic readiness check.
  • Write tool descriptions for the model. State plainly what each tool returns and when to use it, because the model picks tools from those descriptions.
  • Publish the connection details. Client configuration is usually short. Microsoft's reference shows a server entry with a type of "http" and a URL. Put yours in your docs so developers can copy it.
  • Test in real clients. Ask questions you know the answers to, and check which tool was called and which page was cited.

Two protocol details matter here. Clients should call list tools each time they initialize the server, because the list and the tools may change over time. So keep tool names stable and avoid breaking changes. Also build against the current revision of the spec. Roots and sampling, which are client features, and protocol logging, a server feature, are deprecated as of protocol version 2026-07-28.

On governance, keep the first version read-only. Search and fetch carry little risk. Editing through an assistant is a separate decision with separate review requirements.

Illustration of a laptop connected by cables to a small server box beside stacked folders.

Keeping the answers accurate after every merge

An MCP server returns whatever your docs say, right or wrong. If a merged pull request renamed a flag and the docs did not follow, the assistant will give the old flag with full confidence and cite your page as proof.

So the server is only half the work. The rest is closing the gap between code changes and doc changes. Practical steps:

  • Regenerate reference content from source in CI so it cannot drift by hand
  • Flag docs impact when code merges, while the author still has context
  • Draft the docs change as a pull request, with the diff and its reasoning visible
  • Gate quality with checks for broken links, missing frontmatter, and failed builds
  • Require human approval before anything publishes

GitHub Actions can cover most of this: regenerating references, reminding authors, dispatching merged changes to a docs repository, drafting docs pull requests, and gating docs quality. If you would rather not assemble it yourself, Thally traces each merged pull request to the docs, website, and help center pages it affects and opens an evidence-backed update PR, and nothing publishes without a person approving it.

The measure of success is simple. As one platform guide puts it, the real question is whether your setup keeps documentation accurate after launch, not just whether it makes the first draft look polished. Use one source, generate the outputs from it, and review every change before it ships.

Sources

  1. Introducing the Model Context Protocol (Anthropic)
  2. Donating the Model Context Protocol and establishing the Agentic AI Foundation (Anthropic)
  3. Architecture overview (Model Context Protocol documentation, revision 2026-07-28)
  4. Microsoft Learn MCP Server developer reference
  5. The /llms.txt file (llmstxt.org, Jeremy Howard)
  6. Stack Overflow 2025 Developer Survey press release
  7. Thally vs GitBook for Developer Documentation | Thally
  8. Set Up CI to Trigger Documentation Updates | Thally
  9. Technical Documentation Platforms: How to Choose | Thally

Published under the Thally editorial policy. Technical conformance is defined in the agent-readiness methodology.

Build docs that stay close to your product.

Create a managed site, or use the open-source engine to run Thally yourself.