Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions fern/products/docs/pages/ai/mcp-server.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ This is the server your readers connect to, and it serves your content. To point

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).

## How the MCP server works

The server exposes one tool, `searchDocs`. A client calls it with a natural-language query and gets back the passages of your documentation that answer it, each with the URL of the page it came from. The client's own model turns those passages into an answer. The tool returns passages rather than whole pages, so a client that needs a complete page fetches its [Markdown over HTTP](/learn/docs/ai-features/markdown).

`searchDocs` queries the same index [Ask Fern](/learn/docs/ai-features/ask-fern/overview) uses, so retrieval is semantic: a query matches content by meaning instead of by keyword, and anything you add as an [additional content source](/learn/docs/ai-features/ask-fern/content-sources) is searchable alongside your pages. On [authenticated sites](#authenticated-sites), results are limited to the content the caller's `FERN_TOKEN` grants access to.

Because the server runs on the Ask Fern backend, every `searchDocs` call counts as an Ask Fern message against your plan's monthly [AI credit](/learn/docs/ai-features/overview#ai-credits) allowance. One reader question can produce several calls, as AI clients often search more than once to gather context.

## Connect to your MCP server

For Claude Code and Cursor, [page action](/learn/docs/configuration/site-level-settings#page-actions-configuration) buttons let users connect in one click:
Expand Down
Loading