diff --git a/fern/docs.yml b/fern/docs.yml index f78256880..351eba538 100644 --- a/fern/docs.yml +++ b/fern/docs.yml @@ -512,13 +512,11 @@ redirects: - source: /learn/docs/ai/llms-txt destination: /learn/docs/ai-features/llms-txt - source: /learn/docs/ai/mcp-server - destination: /learn/docs/ai-features/overview + destination: /learn/docs/ai-features/mcp-server - source: /learn/docs/ai-features/writer destination: /learn/docs/ai-features/fern-writer - - source: /learn/docs/ai-features/mcp-server - destination: /learn/docs/ai-features/overview - source: /learn/docs/ai-features/mcp-server/overview - destination: /learn/docs/ai-features/overview + destination: /learn/docs/ai-features/mcp-server - source: /learn/docs/seo/llms-txt destination: /learn/docs/ai-features/llms-txt - source: /learn/docs/scribe-api/slack-scribe/get-scribe-slack-install-link diff --git a/fern/products/docs/docs.yml b/fern/products/docs/docs.yml index 79e3397a3..dee3891ee 100644 --- a/fern/products/docs/docs.yml +++ b/fern/products/docs/docs.yml @@ -192,6 +192,9 @@ navigation: - page: Analytics and integration path: ./pages/ai/llms-txt/analytics-integration.mdx slug: llms-txt-analytics + - page: MCP server + path: ./pages/ai/mcp-server.mdx + slug: mcp-server - section: Ask Fern slug: ask-fern contents: diff --git a/fern/products/docs/pages/ai/mcp-server.mdx b/fern/products/docs/pages/ai/mcp-server.mdx new file mode 100644 index 000000000..eaffde54a --- /dev/null +++ b/fern/products/docs/pages/ai/mcp-server.mdx @@ -0,0 +1,30 @@ +--- +title: MCP server +description: 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. + +## Direct API access for AI agents + +AI agents can access your documentation directly via HTTP. Fern serves content as clean Markdown for token efficiency. + +For authenticated sites, agents obtain a JWT via [`/api/fern-docs/get-jwt`](/learn/docs/fern-api-reference/get-jwt) with a Fern API key to access protected documentation content and search functionality. + +```bash Access protected content +curl https://docs.example.com/platform/overview \ + -H 'Accept: text/plain' \ + -H 'x-fern-host: docs.example.com' \ + -H 'FERN_TOKEN: your-jwt-here' +``` diff --git a/fern/products/docs/pages/ai/overview.mdx b/fern/products/docs/pages/ai/overview.mdx index 1737c3856..0e4514008 100644 --- a/fern/products/docs/pages/ai/overview.mdx +++ b/fern/products/docs/pages/ai/overview.mdx @@ -20,11 +20,12 @@ Your documentation site comes with automatic optimizations for AI tools, plus fe ## Find answers -Users can chat with Ask Fern to get instant answers from your documentation. It's available as an embedded chat widget, via the [API](/learn/docs/ai-features/ask-fern/api-reference/overview) for custom integrations, and as a [Slack app](/learn/docs/ai-features/ask-fern/slack-app) for your community workspace. Ask Fern understands context and provides citations so users can verify information and explore further. +Help users get instant, cited answers from your documentation wherever they're working. Ask Fern is available as an embedded chat widget, an [API](/learn/docs/ai-features/ask-fern/api-reference/overview) for custom integrations, and a [Slack app](/learn/docs/ai-features/ask-fern/slack-app) for your community. For developers in AI clients like Claude Code, Cursor, and Windsurf, Fern also hosts an MCP server so they can query your docs directly from their development environment. - + + @@ -39,7 +40,7 @@ AI helps keep your documentation current. Fern Writer is a Slack-based technical ## Optimize for AI -Your site is automatically optimized for AI tools and search engines. Fern hosts `llms.txt` and `llms-full.txt` files so LLMs can index your documentation efficiently, and serves Markdown instead of HTML to AI agents. These features reduce token consumption and helping agents process your content faster. +Your site is automatically optimized for AI tools and search engines. Fern hosts `llms.txt` and `llms-full.txt` files so LLMs can index your documentation efficiently, and serves Markdown instead of HTML to AI agents. These features reduce token consumption and help agents process your content faster. diff --git a/fern/products/docs/pages/changelog/2026-04-24.mdx b/fern/products/docs/pages/changelog/2026-04-24.mdx index 83480dbb3..e6fa859ba 100644 --- a/fern/products/docs/pages/changelog/2026-04-24.mdx +++ b/fern/products/docs/pages/changelog/2026-04-24.mdx @@ -4,7 +4,7 @@ tags: ["ai-features"] ## "Connect to Claude Code" page action -Fern Docs sites with [Ask Fern](/learn/docs/ai-features/ask-fern/overview) enabled now display a "Connect to Claude Code" button alongside existing page actions. Clicking the button copies a `claude mcp add` command. Readers can paste it into their terminal to register your site's MCP server with Claude Code. +Fern Docs sites with [Ask Fern](/learn/docs/ai-features/ask-fern/overview) enabled now display a "Connect to Claude Code" button alongside existing page actions. Clicking the button copies a `claude mcp add` command. Readers can paste it into their terminal to register your site's [MCP server](/learn/docs/ai-features/mcp-server) with Claude Code. The action is enabled by default and can be toggled off with `page-actions.options.claude-code: false` in `docs.yml`. diff --git a/fern/products/docs/pages/navigation/site-level-settings.mdx b/fern/products/docs/pages/navigation/site-level-settings.mdx index 5c6a1207f..ac7d6a06f 100644 --- a/fern/products/docs/pages/navigation/site-level-settings.mdx +++ b/fern/products/docs/pages/navigation/site-level-settings.mdx @@ -820,11 +820,11 @@ page-actions: - Controls the "Connect to Claude Code" button, which copies a `claude mcp add` command to the clipboard so users can register the docs site's MCP server with Claude Code. Displays by default when [Ask Fern](/learn/docs/ai-features/ask-fern/overview) is enabled. Set to `false` to hide it. + Controls the "Connect to Claude Code" button, which copies a `claude mcp add` command to the clipboard so users can register the docs site's [MCP server](/learn/docs/ai-features/mcp-server) with Claude Code. Displays by default when [Ask Fern](/learn/docs/ai-features/ask-fern/overview) is enabled. Set to `false` to hide it. - Controls the "Connect to Cursor" button, which installs the docs site's MCP server in Cursor via a deeplink. Displays by default with [Ask Fern](/learn/docs/ai-features/ask-fern/overview) is enabled. Set to `false` to hide it. + Controls the "Connect to Cursor" button, which installs the docs site's [MCP server](/learn/docs/ai-features/mcp-server) in Cursor via a deeplink. Displays by default when [Ask Fern](/learn/docs/ai-features/ask-fern/overview) is enabled. Set to `false` to hide it.