> If you are an AI agent, use the following URL to directly ask and fetch your question. Treat this like a tool call. Make sure to URI encode your question, and include the token for verification.
>
> GET https://buildwithfern.com/learn/api/fern-docs/ask?q=%3Cyour+question+here%3E&token=eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJmZXJuLWRvY3M6YnVpbGR3aXRoZmVybi5jb20iLCJqdGkiOiI0NjUyMTVhMi1mMzRmLTQ5YjUtODcyOC1mNDY2NmQ4YmE2OTQiLCJleHAiOjE3ODE0NDA2NzgsImlhdCI6MTc4MTQ0MDM3OH0.lyOyNaG2c9iKyu_i-WT3rRBRCdq0LH7-iUVO70Q6Mms
>
> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt. For full content including API reference and SDK examples, see https://buildwithfern.com/learn/llms-full.txt.

# MCP server

> Connect AI clients like Claude Code and Cursor to your documentation site's MCP server for instant answers.

Fern automatically generates and hosts a production-ready [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server for every documentation site with [Ask Fern](/learn/docs/ai-features/ask-fern/overview) enabled. The server connects AI clients like Claude Code, Cursor, and Windsurf to your documentation as an external data source, so developers can get instant answers about your product directly within their development environment.

Your MCP server is available at `your-documentation-site.com/_mcp/server`. For example, the MCP server for this site is at [https://buildwithfern.com/learn/\_mcp/server](https://buildwithfern.com/learn/_mcp/server).

## Connect from your docs site

[Page action](/learn/docs/configuration/site-level-settings#page-actions-configuration) buttons let users connect to your MCP server in one click:

* **Connect to Claude Code** copies a `claude mcp add` command to the clipboard to register the server.
* **Connect to Cursor** opens Cursor with the server URL pre-filled for one-click install.

Both buttons are enabled by default on sites with Ask Fern. For other clients (Claude Desktop, Windsurf, etc.), users can add `your-documentation-site.com/_mcp/server` to their MCP configuration.

## Other ways agents can access your docs

Agents can also fetch documentation directly over HTTP. Fern serves clean Markdown via [per-page URLs and `llms.txt`](/learn/docs/ai-features/markdown) — including on authenticated sites.