doccupine 0.0.158 → 0.0.159
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +51 -1
- package/dist/generator/app-scaffolder.js +11 -3
- package/dist/generator/generated-page-publisher.d.ts +6 -6
- package/dist/generator/generated-page-publisher.js +7 -5
- package/dist/generator/mdx-pass-builder.d.ts +4 -4
- package/dist/generator/mdx-pass-builder.js +8 -1
- package/dist/generator/mdx-reconciliation-coordinator.d.ts +23 -9
- package/dist/generator/mdx-reconciliation-coordinator.js +63 -9
- package/dist/generator/page-catalog.d.ts +2 -4
- package/dist/generator/page-catalog.js +7 -2
- package/dist/generator/page-renderer.d.ts +15 -5
- package/dist/generator/page-renderer.js +38 -11
- package/dist/generator/project-config-repository.d.ts +4 -1
- package/dist/generator/project-config-repository.js +26 -0
- package/dist/generator/public-asset-manager.d.ts +10 -0
- package/dist/generator/public-asset-manager.js +63 -3
- package/dist/generator/section-index-generator.d.ts +10 -1
- package/dist/generator/section-index-generator.js +43 -15
- package/dist/generator/section-resolver.d.ts +8 -0
- package/dist/generator/site-artifacts.d.ts +4 -3
- package/dist/generator/site-artifacts.js +94 -9
- package/dist/generator/watch-coordinator.js +6 -1
- package/dist/lib/generated-artifacts.d.ts +3 -0
- package/dist/lib/generated-artifacts.js +36 -0
- package/dist/lib/layout.d.ts +6 -3
- package/dist/lib/layout.js +107 -4
- package/dist/lib/metadata.d.ts +7 -0
- package/dist/lib/metadata.js +33 -10
- package/dist/lib/structures.js +20 -0
- package/dist/lib/types.d.ts +28 -0
- package/dist/lib/ui-strings.d.ts +44 -0
- package/dist/lib/ui-strings.js +48 -0
- package/dist/lib/variants.d.ts +91 -0
- package/dist/lib/variants.js +411 -0
- package/dist/mdx-to-nextjs-generator.d.ts +22 -5
- package/dist/mdx-to-nextjs-generator.js +89 -10
- package/dist/templates/app/api/mcp/route.d.ts +1 -1
- package/dist/templates/app/api/mcp/route.js +14 -1
- package/dist/templates/app/api/rag/route.d.ts +1 -1
- package/dist/templates/app/api/rag/route.js +13 -2
- package/dist/templates/app/api/search/route.d.ts +1 -1
- package/dist/templates/app/api/search/route.js +16 -1
- package/dist/templates/app/sitemap.d.ts +2 -0
- package/dist/templates/app/sitemap.js +48 -3
- package/dist/templates/components/Chat.d.ts +1 -1
- package/dist/templates/components/Chat.js +40 -12
- package/dist/templates/components/Docs.d.ts +1 -1
- package/dist/templates/components/Docs.js +5 -2
- package/dist/templates/components/DocsSideBar.d.ts +1 -1
- package/dist/templates/components/DocsSideBar.js +3 -1
- package/dist/templates/components/SearchDocs.d.ts +1 -1
- package/dist/templates/components/SearchDocs.js +17 -3
- package/dist/templates/components/SearchModalContent.d.ts +1 -1
- package/dist/templates/components/SearchModalContent.js +22 -14
- package/dist/templates/components/SectionNavProvider.d.ts +1 -1
- package/dist/templates/components/SectionNavProvider.js +32 -20
- package/dist/templates/components/SideBar.d.ts +1 -1
- package/dist/templates/components/SideBar.js +26 -12
- package/dist/templates/components/layout/ActionBar.d.ts +1 -1
- package/dist/templates/components/layout/ActionBar.js +9 -7
- package/dist/templates/components/layout/Code.d.ts +1 -1
- package/dist/templates/components/layout/Code.js +6 -3
- package/dist/templates/components/layout/DocsComponents.d.ts +1 -1
- package/dist/templates/components/layout/DocsComponents.js +38 -5
- package/dist/templates/components/layout/DocsNavigation.d.ts +1 -1
- package/dist/templates/components/layout/DocsNavigation.js +4 -2
- package/dist/templates/components/layout/Dropdown.d.ts +1 -0
- package/dist/templates/components/layout/Dropdown.js +308 -0
- package/dist/templates/components/layout/FocusModeToggle.d.ts +1 -1
- package/dist/templates/components/layout/FocusModeToggle.js +7 -4
- package/dist/templates/components/layout/Footer.d.ts +1 -1
- package/dist/templates/components/layout/Footer.js +4 -2
- package/dist/templates/components/layout/Header.d.ts +1 -1
- package/dist/templates/components/layout/Header.js +18 -8
- package/dist/templates/components/layout/SectionBar.d.ts +1 -1
- package/dist/templates/components/layout/SectionBar.js +16 -10
- package/dist/templates/components/layout/VariantSwitchers.d.ts +1 -0
- package/dist/templates/components/layout/VariantSwitchers.js +313 -0
- package/dist/templates/components/useStrings.d.ts +1 -0
- package/dist/templates/components/useStrings.js +10 -0
- package/dist/templates/components/useVariant.d.ts +1 -0
- package/dist/templates/components/useVariant.js +13 -0
- package/dist/templates/llms/llmsIndex.d.ts +13 -0
- package/dist/templates/llms/llmsIndex.js +18 -3
- package/dist/templates/mdx/ai-assistant.mdx.d.ts +1 -1
- package/dist/templates/mdx/ai-assistant.mdx.js +2 -0
- package/dist/templates/mdx/api-playground.mdx.d.ts +1 -1
- package/dist/templates/mdx/api-playground.mdx.js +2 -0
- package/dist/templates/mdx/commands.mdx.d.ts +1 -1
- package/dist/templates/mdx/commands.mdx.js +1 -1
- package/dist/templates/mdx/fonts.mdx.d.ts +1 -1
- package/dist/templates/mdx/fonts.mdx.js +1 -1
- package/dist/templates/mdx/footer-links.mdx.d.ts +1 -1
- package/dist/templates/mdx/footer-links.mdx.js +1 -1
- package/dist/templates/mdx/index.mdx.d.ts +1 -1
- package/dist/templates/mdx/index.mdx.js +2 -0
- package/dist/templates/mdx/languages.mdx.d.ts +1 -0
- package/dist/templates/mdx/languages.mdx.js +94 -0
- package/dist/templates/mdx/media-and-assets.mdx.d.ts +1 -1
- package/dist/templates/mdx/media-and-assets.mdx.js +1 -1
- package/dist/templates/mdx/model-context-protocol.mdx.d.ts +1 -1
- package/dist/templates/mdx/model-context-protocol.mdx.js +6 -0
- package/dist/templates/mdx/navigation.mdx.d.ts +1 -1
- package/dist/templates/mdx/navigation.mdx.js +2 -0
- package/dist/templates/mdx/platform/ai-assistant.mdx.d.ts +1 -1
- package/dist/templates/mdx/platform/ai-assistant.mdx.js +2 -0
- package/dist/templates/mdx/platform/api-playground.mdx.d.ts +1 -1
- package/dist/templates/mdx/platform/api-playground.mdx.js +2 -0
- package/dist/templates/mdx/platform/file-editor.mdx.d.ts +1 -1
- package/dist/templates/mdx/platform/file-editor.mdx.js +2 -0
- package/dist/templates/mdx/platform/index.mdx.d.ts +1 -1
- package/dist/templates/mdx/platform/index.mdx.js +1 -1
- package/dist/templates/mdx/platform/languages.mdx.d.ts +1 -0
- package/dist/templates/mdx/platform/languages.mdx.js +50 -0
- package/dist/templates/mdx/platform/mcp.mdx.d.ts +1 -1
- package/dist/templates/mdx/platform/mcp.mdx.js +2 -0
- package/dist/templates/mdx/platform/navigation-settings.mdx.d.ts +1 -1
- package/dist/templates/mdx/platform/navigation-settings.mdx.js +2 -0
- package/dist/templates/mdx/platform/publishing.mdx.d.ts +1 -1
- package/dist/templates/mdx/platform/publishing.mdx.js +4 -0
- package/dist/templates/mdx/platform/self-updating-docs.mdx.d.ts +1 -1
- package/dist/templates/mdx/platform/self-updating-docs.mdx.js +2 -0
- package/dist/templates/mdx/platform/versions.mdx.d.ts +1 -0
- package/dist/templates/mdx/platform/versions.mdx.js +33 -0
- package/dist/templates/mdx/sections.mdx.d.ts +1 -1
- package/dist/templates/mdx/sections.mdx.js +1 -1
- package/dist/templates/mdx/theme.mdx.d.ts +1 -1
- package/dist/templates/mdx/theme.mdx.js +1 -1
- package/dist/templates/mdx/versions.mdx.d.ts +1 -0
- package/dist/templates/mdx/versions.mdx.js +78 -0
- package/dist/templates/mdx/what-is-doccupine.mdx.d.ts +1 -1
- package/dist/templates/mdx/what-is-doccupine.mdx.js +1 -1
- package/dist/templates/prettierignore.d.ts +1 -1
- package/dist/templates/prettierignore.js +2 -0
- package/dist/templates/services/mcp/server.d.ts +1 -1
- package/dist/templates/services/mcp/server.js +54 -10
- package/dist/templates/services/mcp/tools.d.ts +1 -1
- package/dist/templates/services/mcp/tools.js +81 -6
- package/dist/templates/services/mcp/types.d.ts +1 -1
- package/dist/templates/services/mcp/types.js +10 -0
- package/dist/templates/services/search.d.ts +1 -1
- package/dist/templates/services/search.js +34 -4
- package/dist/templates/utils/orderNavItems.d.ts +1 -1
- package/dist/templates/utils/orderNavItems.js +2 -0
- package/dist/templates/utils/strings.d.ts +1 -0
- package/dist/templates/utils/strings.js +27 -0
- package/dist/templates/utils/variants.d.ts +1 -0
- package/dist/templates/utils/variants.js +170 -0
- package/package.json +1 -1
|
@@ -45,5 +45,7 @@ Doccupine works with no configuration, but when you're ready to customize, every
|
|
|
45
45
|
- [Navigation](/navigation) - Override the auto-generated sidebar with \`navigation.json\`
|
|
46
46
|
- [Theme](/theme) - Colors, logos, and dark mode palette via \`theme.json\`
|
|
47
47
|
- [Fonts](/fonts) - Google Fonts or local font files via \`fonts.json\`
|
|
48
|
+
- [Languages](/languages) - Translate your docs, one folder per language, via \`languages.json\`
|
|
49
|
+
- [Versions](/versions) - Keep older releases online, one folder per version, via \`versions.json\`
|
|
48
50
|
- [AI Assistant](/ai-assistant) - Enable the built-in chat with your own API key
|
|
49
51
|
- [MCP Server](/model-context-protocol) - Let AI tools search your docs through \`/api/mcp\``;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const languagesMdxTemplate = "---\ntitle: \"Languages\"\ndescription: \"Publish your documentation in several languages from one project, with a language switcher, hreflang tags, and scoped search.\"\ndate: \"2026-09-08\"\ncategory: \"Configuration\"\ncategoryOrder: 2\norder: 4\n---\n# Languages\n\nTranslate your documentation by adding a `languages.json` file and one folder per language. Each language gets its own URL prefix, its own sidebar, a switcher in the sidebar, `hreflang` tags for search engines, and search and AI chat that stay inside the language the reader is looking at.\n\n<Callout type=\"note\">\n Languages are entirely opt-in. Without a `languages.json` file nothing changes: your docs live at the root of the docs folder and publish exactly as before.\n</Callout>\n\n## Configuration\n\nCreate `languages.json` in your project root, next to `doccupine.json`:\n\n```json\n[\n { \"code\": \"en\", \"label\": \"English\", \"default\": true },\n { \"code\": \"de\", \"label\": \"Deutsch\" }\n]\n```\n\n- **code**: a lowercase URL segment (letters, digits, and hyphens, such as `en`, `de`, or `pt-br`). It is the folder name, the URL prefix, and the value of the page's `lang` and `hreflang` attributes.\n- **label**: the name shown in the language switcher.\n- **default**: exactly one entry must be the default. Its pages live at the docs root and keep unprefixed URLs.\n- **strings** (optional): overrides for the site's own interface text in that language. See [Interface strings](#interface-strings).\n\nThe order of the entries is the order of the switcher.\n\n## Folder layout\n\nThe default language lives at the root of the docs folder. Every other language lives in a folder named after its code, mirroring the default layout:\n\n```text\ndocs/\n index.mdx -> /\n guides/\n intro.mdx -> /guides/intro\n de/\n index.mdx -> /de\n guides/\n intro.mdx -> /de/guides/intro\n```\n\nA page is the translation of another when it sits at the same path inside its language folder. Only translated pages exist in a language: a page you have not translated yet returns a 404 under that language's prefix, and the switcher takes readers to that language's home page instead.\n\nA language folder without an `index.mdx` gets a generated home page that redirects to its first page.\n\n## What the generated site does\n\n- **Switcher**: the sidebar footer row, between the focus-mode and theme toggles, shows a language dropdown when at least two languages are configured: a 30px pill carrying the current language that opens a menu of every language above it (the same dropdown the Doccupine platform uses), with the arrow keys, Escape, and a click outside to close it. When a version switcher shares the row, the two pills grow from their labels' widths to fill the sidebar's free width, and on the narrow desktop rail each shows its short form: the language's code and the version's own label. Switching goes to the same page in the chosen language when it exists, otherwise to that language's home.\n- **Sidebar and sections**: the sidebar lists only the pages of the current language. [Sections](/sections) work inside every language; a section tab is hidden in a language that has no pages in it.\n- **Search and AI chat**: results and answers come from the current language only. The MCP server's `search_docs` and `list_docs` tools accept a `language` parameter and default to the default language.\n- **SEO**: every translated page carries `alternates.languages` (`hreflang`) links to its other languages, an `x-default` pointing at the default language, and an Open Graph locale. The sitemap lists the same alternates. The `<main>` element carries the page's `lang` attribute; the `<html lang>` attribute is the default language server-side and is corrected from the URL before the first paint.\n- **Agents**: each language has its own `llms.txt` and `llms-full.txt` under its prefix (`/de/llms.txt`), and the root files link to them.\n\n## Navigation\n\nFrontmatter navigation is built per language automatically. To define a language's sidebar by hand, key `navigation.json` by URL prefix: `\"de\"` for the German root, `\"de/api\"` for the German API section. See [Navigation](/navigation).\n\n## Interface strings\n\nThe generated site's own labels (the search box, \"On this page\", the previous and next links, the action bar, the footer) are English by default. Override any of them per language with a `strings` object:\n\n```json\n[\n { \"code\": \"en\", \"label\": \"English\", \"default\": true },\n {\n \"code\": \"de\",\n \"label\": \"Deutsch\",\n \"strings\": {\n \"searchPlaceholder\": \"Dokumentation durchsuchen...\",\n \"onThisPage\": \"Auf dieser Seite\",\n \"previous\": \"Zur\u00FCck\",\n \"next\": \"Weiter\"\n }\n }\n]\n```\n\nKeys you leave out keep their default. The known keys are `searchButton`, `searchDialog`, `searchPlaceholder`, `searchResults`, `searching`, `noResults`, `resultsAvailable` (with a `{count}` placeholder), `resultAvailable`, `askAi`, `askAiAssistant`, `closeSearch`, `onThisPage`, `previous`, `next`, `openNavigation`, `closeNavigation`, `expandGroup` and `collapseGroup` (both with a `{title}` placeholder), `enterFocusMode`, `exitFocusMode`, `focusMode`, `copyContent`, `copied`, `copyCode`, `codeVariants`, `rss`, `rssFeed`, `viewAsMarkdown`, `toggleView`, `poweredBy`, `githubLink`, `aiAssistant`, `resetChat`, `chatGreeting`, `chatPlaceholder`, `chatInputLabel`, `chatAnswering`, `chatError`, `language`, and `version`. An unknown key is reported when the site is generated and ignored.\n\n## Rules\n\n- A language code must not be the slug of a [section](/sections), the first folder of a section's `directory`, a [version](/versions) slug, or one of the reserved segments `api`, `gate`, `mcp`, and `ingest`. The build stops with a message naming the file when it is.\n- The default language has no folder: a `docs/en/` folder on a site whose default is `en` stops the build.\n- When [versions](/versions) are configured too, the language folder comes first: `docs/de/v1/`.\n- The API reference generated from an OpenAPI spec is published in the default language only.\n";
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
export const languagesMdxTemplate = `---
|
|
2
|
+
title: "Languages"
|
|
3
|
+
description: "Publish your documentation in several languages from one project, with a language switcher, hreflang tags, and scoped search."
|
|
4
|
+
date: "2026-09-08"
|
|
5
|
+
category: "Configuration"
|
|
6
|
+
categoryOrder: 2
|
|
7
|
+
order: 4
|
|
8
|
+
---
|
|
9
|
+
# Languages
|
|
10
|
+
|
|
11
|
+
Translate your documentation by adding a \`languages.json\` file and one folder per language. Each language gets its own URL prefix, its own sidebar, a switcher in the sidebar, \`hreflang\` tags for search engines, and search and AI chat that stay inside the language the reader is looking at.
|
|
12
|
+
|
|
13
|
+
<Callout type="note">
|
|
14
|
+
Languages are entirely opt-in. Without a \`languages.json\` file nothing changes: your docs live at the root of the docs folder and publish exactly as before.
|
|
15
|
+
</Callout>
|
|
16
|
+
|
|
17
|
+
## Configuration
|
|
18
|
+
|
|
19
|
+
Create \`languages.json\` in your project root, next to \`doccupine.json\`:
|
|
20
|
+
|
|
21
|
+
\`\`\`json
|
|
22
|
+
[
|
|
23
|
+
{ "code": "en", "label": "English", "default": true },
|
|
24
|
+
{ "code": "de", "label": "Deutsch" }
|
|
25
|
+
]
|
|
26
|
+
\`\`\`
|
|
27
|
+
|
|
28
|
+
- **code**: a lowercase URL segment (letters, digits, and hyphens, such as \`en\`, \`de\`, or \`pt-br\`). It is the folder name, the URL prefix, and the value of the page's \`lang\` and \`hreflang\` attributes.
|
|
29
|
+
- **label**: the name shown in the language switcher.
|
|
30
|
+
- **default**: exactly one entry must be the default. Its pages live at the docs root and keep unprefixed URLs.
|
|
31
|
+
- **strings** (optional): overrides for the site's own interface text in that language. See [Interface strings](#interface-strings).
|
|
32
|
+
|
|
33
|
+
The order of the entries is the order of the switcher.
|
|
34
|
+
|
|
35
|
+
## Folder layout
|
|
36
|
+
|
|
37
|
+
The default language lives at the root of the docs folder. Every other language lives in a folder named after its code, mirroring the default layout:
|
|
38
|
+
|
|
39
|
+
\`\`\`text
|
|
40
|
+
docs/
|
|
41
|
+
index.mdx -> /
|
|
42
|
+
guides/
|
|
43
|
+
intro.mdx -> /guides/intro
|
|
44
|
+
de/
|
|
45
|
+
index.mdx -> /de
|
|
46
|
+
guides/
|
|
47
|
+
intro.mdx -> /de/guides/intro
|
|
48
|
+
\`\`\`
|
|
49
|
+
|
|
50
|
+
A page is the translation of another when it sits at the same path inside its language folder. Only translated pages exist in a language: a page you have not translated yet returns a 404 under that language's prefix, and the switcher takes readers to that language's home page instead.
|
|
51
|
+
|
|
52
|
+
A language folder without an \`index.mdx\` gets a generated home page that redirects to its first page.
|
|
53
|
+
|
|
54
|
+
## What the generated site does
|
|
55
|
+
|
|
56
|
+
- **Switcher**: the sidebar footer row, between the focus-mode and theme toggles, shows a language dropdown when at least two languages are configured: a 30px pill carrying the current language that opens a menu of every language above it (the same dropdown the Doccupine platform uses), with the arrow keys, Escape, and a click outside to close it. When a version switcher shares the row, the two pills grow from their labels' widths to fill the sidebar's free width, and on the narrow desktop rail each shows its short form: the language's code and the version's own label. Switching goes to the same page in the chosen language when it exists, otherwise to that language's home.
|
|
57
|
+
- **Sidebar and sections**: the sidebar lists only the pages of the current language. [Sections](/sections) work inside every language; a section tab is hidden in a language that has no pages in it.
|
|
58
|
+
- **Search and AI chat**: results and answers come from the current language only. The MCP server's \`search_docs\` and \`list_docs\` tools accept a \`language\` parameter and default to the default language.
|
|
59
|
+
- **SEO**: every translated page carries \`alternates.languages\` (\`hreflang\`) links to its other languages, an \`x-default\` pointing at the default language, and an Open Graph locale. The sitemap lists the same alternates. The \`<main>\` element carries the page's \`lang\` attribute; the \`<html lang>\` attribute is the default language server-side and is corrected from the URL before the first paint.
|
|
60
|
+
- **Agents**: each language has its own \`llms.txt\` and \`llms-full.txt\` under its prefix (\`/de/llms.txt\`), and the root files link to them.
|
|
61
|
+
|
|
62
|
+
## Navigation
|
|
63
|
+
|
|
64
|
+
Frontmatter navigation is built per language automatically. To define a language's sidebar by hand, key \`navigation.json\` by URL prefix: \`"de"\` for the German root, \`"de/api"\` for the German API section. See [Navigation](/navigation).
|
|
65
|
+
|
|
66
|
+
## Interface strings
|
|
67
|
+
|
|
68
|
+
The generated site's own labels (the search box, "On this page", the previous and next links, the action bar, the footer) are English by default. Override any of them per language with a \`strings\` object:
|
|
69
|
+
|
|
70
|
+
\`\`\`json
|
|
71
|
+
[
|
|
72
|
+
{ "code": "en", "label": "English", "default": true },
|
|
73
|
+
{
|
|
74
|
+
"code": "de",
|
|
75
|
+
"label": "Deutsch",
|
|
76
|
+
"strings": {
|
|
77
|
+
"searchPlaceholder": "Dokumentation durchsuchen...",
|
|
78
|
+
"onThisPage": "Auf dieser Seite",
|
|
79
|
+
"previous": "Zurück",
|
|
80
|
+
"next": "Weiter"
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
\`\`\`
|
|
85
|
+
|
|
86
|
+
Keys you leave out keep their default. The known keys are \`searchButton\`, \`searchDialog\`, \`searchPlaceholder\`, \`searchResults\`, \`searching\`, \`noResults\`, \`resultsAvailable\` (with a \`{count}\` placeholder), \`resultAvailable\`, \`askAi\`, \`askAiAssistant\`, \`closeSearch\`, \`onThisPage\`, \`previous\`, \`next\`, \`openNavigation\`, \`closeNavigation\`, \`expandGroup\` and \`collapseGroup\` (both with a \`{title}\` placeholder), \`enterFocusMode\`, \`exitFocusMode\`, \`focusMode\`, \`copyContent\`, \`copied\`, \`copyCode\`, \`codeVariants\`, \`rss\`, \`rssFeed\`, \`viewAsMarkdown\`, \`toggleView\`, \`poweredBy\`, \`githubLink\`, \`aiAssistant\`, \`resetChat\`, \`chatGreeting\`, \`chatPlaceholder\`, \`chatInputLabel\`, \`chatAnswering\`, \`chatError\`, \`language\`, and \`version\`. An unknown key is reported when the site is generated and ignored.
|
|
87
|
+
|
|
88
|
+
## Rules
|
|
89
|
+
|
|
90
|
+
- A language code must not be the slug of a [section](/sections), the first folder of a section's \`directory\`, a [version](/versions) slug, or one of the reserved segments \`api\`, \`gate\`, \`mcp\`, and \`ingest\`. The build stops with a message naming the file when it is.
|
|
91
|
+
- The default language has no folder: a \`docs/en/\` folder on a site whose default is \`en\` stops the build.
|
|
92
|
+
- When [versions](/versions) are configured too, the language folder comes first: \`docs/de/v1/\`.
|
|
93
|
+
- The API reference generated from an OpenAPI spec is published in the default language only.
|
|
94
|
+
`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const mediaAndAssetsMdxTemplate = "---\ntitle: \"Media and assets\"\ndescription: \"Serve static files like images, favicons, fonts, and Open Graph previews from the public directory.\"\ndate: \"2026-02-19\"\nupdated: \"2026-08-04\"\ncategory: \"Configuration\"\ncategoryOrder: 2\norder:
|
|
1
|
+
export declare const mediaAndAssetsMdxTemplate = "---\ntitle: \"Media and assets\"\ndescription: \"Serve static files like images, favicons, fonts, and Open Graph previews from the public directory.\"\ndate: \"2026-02-19\"\nupdated: \"2026-08-04\"\ncategory: \"Configuration\"\ncategoryOrder: 2\norder: 9\n---\n# Media and assets\n\nDoccupine watches a `public` directory in your project root (the same directory where you execute `npx doccupine`) and copies its contents into the generated Next.js `public` directory. Use it to serve static files such as favicons, Open Graph preview images, custom fonts, or any other media your documentation needs.\n\n## The public directory\n\nCreate a `public` directory at your project root. Any file you place inside is automatically synced to the generated site and served from the root URL path.\n\n```text\nmy-docs/\n\u251C\u2500\u2500 public/\n\u2502 \u251C\u2500\u2500 og-image.png\n\u2502 \u251C\u2500\u2500 logo.svg\n\u2502 \u2514\u2500\u2500 fonts/\n\u2502 \u2514\u2500\u2500 custom-font.woff2\n\u251C\u2500\u2500 docs/\n\u2502 \u2514\u2500\u2500 index.mdx\n\u251C\u2500\u2500 config.json\n\u2514\u2500\u2500 theme.json\n```\n\n## How assets are served\n\nFiles in the `public` directory are available at the root of your deployed domain. The path inside `public` maps directly to the URL path.\n\n| File | URL |\n| -------------------------------- | ------------------------------------------------- |\n| `public/og-image.png` | `https://your-domain.com/og-image.png` |\n| `public/logo.svg` | `https://your-domain.com/logo.svg` |\n| `public/fonts/custom-font.woff2` | `https://your-domain.com/fonts/custom-font.woff2` |\n\n## Common use cases\n\n### Favicon\n\nPrefer the icon file convention: drop an `icon.png` (and optionally `icon-dark.png` and `apple-icon.png`) at your project root, next to `config.json`, and Doccupine wires it into every page's metadata with cache-busting URLs. See [Icon files](/globals#icon-files).\n\nIf a legacy tool needs the bare `/favicon.ico` path, drop a `favicon.ico` into the `public` directory and it is served from the root path as-is.\n\n### Open Graph preview image\n\nAdd an image for link previews on social media. Reference it in your `config.json` so Doccupine sets the correct meta tags.\n\n```text\npublic/og-image.png \u2192 https://your-domain.com/og-image.png\n```\n\n### Custom fonts\n\nPlace font files in `public` and reference them from your `fonts.json`. See the **Fonts** page for full configuration details.\n\n```text\npublic/fonts/custom-font.woff2 \u2192 https://your-domain.com/fonts/custom-font.woff2\n```\n\n### Images and other media\n\nAny image or file you want to reference in your MDX pages can live in `public`. Use a root-relative path in your content:\n\n```mdx\n\n```\n\n## Live syncing\n\n<Callout type=\"info\">\n Doccupine watches the `public` directory for changes while running. When you add, update, or remove a file, the generated site is updated automatically.\n</Callout>\n\n<Callout type=\"warning\">\n The `public` directory and everything beneath it must use real files and directories. Doccupine rejects symlinks instead of following or copying them, including links whose targets are inside the project.\n</Callout>\n\n## Tips\n\n- **Keep it flat**: For a small number of files, placing them directly in `public` keeps paths short and simple.\n- **Use subdirectories for organization**: For larger projects, group assets into directories like `public/fonts`, `public/images`, or `public/icons`.\n- **Mind file size**: Optimize images before adding them to keep deployment size and load times low.\n- **Consistent naming**: Use lowercase, hyphen-separated filenames (e.g., `og-image.png`) for predictable URLs.";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const mcpMdxTemplate = "---\ntitle: \"Model Context Protocol\"\ndescription: \"Connect your Doccupine documentation to AI tools with an MCP server for enhanced AI-powered documentation search.\"\ndate: \"2026-02-19\"\nupdated: \"2026-07-31\"\ncategory: \"AI & Integrations\"\ncategoryOrder: 3\norder: 2\n---\n# Model Context Protocol\n\nConnect your documentation to AI tools with a hosted MCP server.\n\nDoccupine automatically generates a Model Context Protocol (MCP) server from your documentation, making your content accessible to AI applications like Claude, Cursor, VS Code, and other MCP-compatible tools. Your MCP server exposes semantic search capabilities, allowing AI tools to query your documentation directly and provide accurate, context-aware answers.\n\n<Callout type=\"warning\">\n Semantic `search_docs` requires the [AI Assistant](/ai-assistant) embedding\n provider to be configured. `get_doc` and `list_docs` can retrieve the generated\n content manifest without an embedding provider.\n</Callout>\n\n## About MCP servers\n\nThe Model Context Protocol (MCP) is an open protocol that creates standardized connections between AI applications and external services, like documentation. Doccupine generates an MCP server from your documentation, preparing your content for the broader AI ecosystem where any MCP client can connect to your documentation.\n\nYour MCP server exposes search and retrieval tools for AI applications to query your documentation. Your users must connect your MCP server to their preferred AI tools to access your documentation.\n\n### How MCP servers work\n\nWhen an AI tool has your documentation MCP server connected, the AI tool can search your documentation directly instead of making a generic web search in response to a user's prompt. Your MCP server provides access to all indexed content from your documentation site.\n\n- The LLM can proactively search your documentation while generating a response, not just when explicitly asked.\n- The LLM determines when to use the search tool based on the context of the conversation and the relevance of your documentation.\n- Each tool call happens during the generation process, so the LLM searches up-to-date information from your documentation to generate its response.\n\n### MCP compared to web search\n\nAI tools can search the web, but MCP provides distinct advantages for documentation.\n\n- **Direct source access**: Web search depends on what search engines have indexed, which may be stale or incomplete. MCP searches your current indexed documentation directly.\n- **Integrated workflow**: MCP allows the AI to search during response generation rather than performing a separate web search.\n- **Semantic search**: MCP uses vector embeddings for semantic similarity search, providing more relevant results than keyword-based web search.\n- **No search noise**: SEO and ranking algorithms influence web search results. MCP goes straight to your documentation content.\n\n## Access your MCP server\n\nDoccupine automatically generates an MCP server for your documentation and hosts it at your documentation URL with the `/api/mcp` path. For example, if your documentation is hosted at `https://example.com`, your MCP server is available at `https://example.com/api/mcp`.\n\nThe MCP server provides both a GET endpoint to discover available tools and a POST endpoint to execute tool calls.\n\n### Authentication\n\nYou can optionally protect your MCP server with an API key by setting the `DOCS_API_KEY` environment variable in your `.env` file:\n\n```bash\nDOCS_API_KEY=your-secret-key\n```\n\nWhen `DOCS_API_KEY` is set, all requests to `/api/mcp` must include an `Authorization` header with a Bearer token:\n\n```text\nAuthorization: Bearer your-secret-key\n```\n\nRequests without a valid token receive a `401 Unauthorized` response. When `DOCS_API_KEY` is not set, the MCP server follows the site's access mode: it is public on a public site and requires the normal gate session when `SITE_PASSWORD` is configured.\n\n<Callout type=\"note\">\n `DOCS_API_KEY` applies to `/api/mcp` and its `/mcp` discovery alias; it does not grant access to the chat, search, or playground APIs. To gate the entire site behind a shared password, see the [Authentication](/authentication) documentation.\n</Callout>\n\n### Rate limiting\n\nTool calls to `POST /api/mcp` are rate limited per client IP when the generated app runs on a recognized platform that supplies a trusted client-address header. Unknown or self-hosted proxy setups use one conservative shared bucket instead of trusting spoofable forwarding headers. When the limit is exceeded, the server responds with `429 Too Many Requests` and a `Retry-After` header indicating how many seconds to wait before retrying.\n\nThe included limiter is intentionally lightweight and scoped to each running server instance. For a globally consistent limit across multiple serverless instances or regions, or accurate per-client limits behind a custom reverse proxy, configure rate limiting at your trusted hosting edge or use a shared external rate-limit store.\n\nRequests are bounded before tool execution: request bodies, protocol batches, tool arguments, search result counts, and serialized responses all have fixed limits. A protocol body may contain at most one `tools/call` message, so one rate-limited request cannot execute multiple paid tools; batches containing only non-tool protocol messages remain compatible. Internal provider errors are logged on the server and returned to clients as generic failures so deployment details are not exposed.\n\n### API Endpoints\n\n#### GET /api/mcp\n\nReturns information about available tools and the current index status.\n\n**Response:**\n\n```json\n{\n \"tools\": [\n {\n \"name\": \"search_docs\",\n \"description\": \"Search through the documentation content using semantic search...\",\n \"inputSchema\": { ... }\n },\n ...\n ],\n \"index\": {\n \"ready\": true,\n \"chunkCount\": 150\n }\n}\n```\n\n#### POST /api/mcp\n\nExecutes an MCP tool call.\n\n**Request Body:**\n\n```json\n{\n \"tool\": \"search_docs\",\n \"params\": {\n \"query\": \"how to deploy\",\n \"limit\": 6\n }\n}\n```\n\n**Response:**\n\n```json\n{\n \"content\": [\n {\n \"path\": \"app/deployment-and-hosting/page.tsx\",\n \"uri\": \"docs://deployment-and-hosting\",\n \"score\": \"0.892\",\n \"text\": \"Deploy your Doccupine site as a Next.js application...\"\n },\n ...\n ]\n}\n```\n\n## Available Tools\n\nYour MCP server exposes three tools for interacting with your documentation:\n\n### search_docs\n\nSearch through the documentation content using semantic search. Returns relevant chunks of documentation based on the query using vector embeddings and cosine similarity.\n\n**Parameters:**\n\n- `query` (required): The search query to find relevant documentation\n- `limit` (optional): Maximum number of results to return (default: 6)\n\n**Example:**\n\n```json\n{\n \"tool\": \"search_docs\",\n \"params\": {\n \"query\": \"how to configure AI assistant\",\n \"limit\": 5\n }\n}\n```\n\n### get_doc\n\nGet the full content of a specific documentation page by its path.\n\n**Parameters:**\n\n- `path` (required): The file path to the documentation page (e.g., `app/getting-started/page.tsx`)\n\n**Example:**\n\n```json\n{\n \"tool\": \"get_doc\",\n \"params\": {\n \"path\": \"app/deployment-and-hosting/page.tsx\"\n }\n}\n```\n\n### list_docs\n\nList all available documentation pages, optionally filtered by directory.\n\n**Parameters:**\n\n- `directory` (optional): Optional directory to filter results (e.g., `components`)\n\n**Example:**\n\n```json\n{\n \"tool\": \"list_docs\",\n \"params\": {\n \"directory\": \"configuration\"\n }\n}\n```\n\n## How it works\n\nDoccupine's MCP server uses semantic search powered by vector embeddings to provide accurate, context-aware search results.\n\n### Indexing Process\n\nDoccupine runs this pipeline at build time and ships the resulting vectors with your site, so the server loads a ready-made index instead of re-embedding your docs on every cold start.\n\n1. **Content Manifest**: During generation, Doccupine writes the source MDX and generated API-reference content to `services/mcp/docs-content.json`.\n2. **Runtime Loading**: The build traces that manifest into the MCP and RAG functions, which read it from one fixed path without inlining the corpus into their JavaScript bundles.\n3. **Chunking**: Large documents are split into chunks of approximately 800 characters with 100 character overlap for better context preservation.\n4. **Embedding Generation**: Each chunk is converted to a vector embedding using your configured LLM provider's embedding model.\n5. **Compaction**: Each vector is truncated to `LLM_EMBEDDING_DIMS` dimensions (default 512) and quantized to int8, keeping the index roughly 20x smaller than raw floats so large doc sets don't stall the chat on cold start.\n6. **Index Building**: The compact embeddings are written to `services/mcp/docs-index.json`, traced into your serverless functions as a data file, and loaded into memory at runtime for fast similarity search.\n\n### Search Process\n\n1. **Query Embedding**: The search query is converted to a vector embedding using the same embedding model.\n2. **Similarity Calculation**: Cosine similarity is calculated between the query embedding and all document chunk embeddings.\n3. **Ranking**: Results are sorted by similarity score (highest first).\n4. **Response**: The top N results (based on the limit parameter) are returned with their paths, URIs, scores, and text content.\n\n<Callout type=\"note\">\n Embeddings are precomputed at build time and shipped as a traced data file, so the server loads the ready-made index into memory on startup instead of re-embedding your docs on every cold start. It only embeds at runtime when the precomputed index is missing or was built with a different provider or model. When you update your documentation, regenerate and rebuild or redeploy your site to refresh both the content manifest and index.\n</Callout>\n\n## Use your MCP server\n\nYour users must connect your MCP server to their preferred AI tools.\n\n1. Make your MCP server URL publicly available.\n2. Users copy your MCP server URL and add it to their tools.\n3. Users access your documentation through their tools.\n\nThese are some of the ways you can help your users connect to your MCP server:\n\n<Tabs>\n <TabContent title=\"Claude\">\n <Steps>\n <Step title=\"Get your MCP server URL.\">\n Your MCP server URL is available at `https://your-domain.com/api/mcp`.\n </Step>\n <Step title=\"Publish your MCP server URL for your users.\">\n Create a guide for your users that includes your MCP server URL and the steps to connect it to Claude.\n 1. Navigate to the [Connectors](https://claude.ai/settings/connectors) page in the Claude settings.\n 2. Select **Add custom connector**.\n 3. Add your MCP server name and URL.\n 4. Select **Add**.\n 5. When using Claude, select the attachments button (the plus icon).\n 6. Select your MCP server.\n </Step>\n </Steps>\n See the [Model Context Protocol documentation](https://modelcontextprotocol.io/docs/tutorials/use-remote-mcp-server#connecting-to-a-remote-mcp-server) for more details.\n </TabContent>\n <TabContent title=\"Claude Code\">\n <Steps>\n <Step title=\"Get your MCP server URL.\">\n Your MCP server URL is available at `https://your-domain.com/api/mcp`.\n </Step>\n <Step title=\"Publish your MCP server URL for your users.\">\n Create a guide for your users that includes your MCP server URL and the command to connect it to Claude Code.\n ```bash\n claude mcp add --transport http <name> <url>\n ```\n </Step>\n </Steps>\n See the [Claude Code documentation](https://docs.anthropic.com/en/docs/claude-code/mcp#installing-mcp-servers) for more details.\n </TabContent>\n <TabContent title=\"Cursor\">\n <Steps>\n <Step title=\"Get your MCP server URL.\">\n Your MCP server URL is available at `https://your-domain.com/api/mcp`.\n </Step>\n <Step title=\"Publish your MCP server URL for your users.\">\n Create a guide for your users that includes your MCP server URL and the steps to connect it to Cursor.\n 1. Use <kbd>Command</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd> (<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd> on Windows) to open the command palette.\n 2. Search for \"Open MCP settings\".\n 3. Select **Add custom MCP**. This opens the `mcp.json` file.\n 4. In `mcp.json`, configure your server:\n ```json\n {\n \"mcpServers\": {\n \"<your-mcp-server-name>\": {\n \"url\": \"<your-mcp-server-url>\"\n }\n }\n }\n ```\n </Step>\n </Steps>\n See the [Cursor documentation](https://docs.cursor.com/en/context/mcp#installing-mcp-servers) for more details.\n </TabContent>\n <TabContent title=\"VS Code\">\n <Steps>\n <Step title=\"Get your MCP server URL.\">\n Your MCP server URL is available at `https://your-domain.com/api/mcp`.\n </Step>\n <Step title=\"Publish your MCP server URL for your users.\">\n Create a guide for your users that includes your MCP server URL and the steps to connect it to VS Code.\n 1. Create a `.vscode/mcp.json` file.\n 2. In `mcp.json`, configure your server:\n ```json\n {\n \"servers\": {\n \"<your-mcp-server-name>\": {\n \"type\": \"http\",\n \"url\": \"<your-mcp-server-url>\"\n }\n }\n }\n ```\n </Step>\n </Steps>\n See the [VS Code documentation](https://code.visualstudio.com/docs/copilot/chat/mcp-servers) for more details.\n </TabContent>\n</Tabs>\n\n## Requirements\n\nTo use the MCP server, you need to have the AI Assistant configured. The MCP server uses the same LLM configuration for generating embeddings.\n\n| Variable | Required | Description |\n| -------------- | -------- | ------------------------------------------------------------ |\n| `LLM_PROVIDER` | Yes | Your LLM provider (`openai`, `anthropic`, or `google`) |\n| `DOCS_API_KEY` | No | When set, requires Bearer token authentication on `/api/mcp` |\n\n<Callout type=\"warning\">\n The `search_docs` tool requires an LLM provider for query embeddings. Configure\n the AI Assistant with a valid API key before using semantic search.\n</Callout>\n\nSee the [AI Assistant documentation](/ai-assistant) for configuration details.\n\n## Content indexing\n\nDoccupine builds a `services/mcp/docs-content.json` manifest from your source MDX and generated API-reference pages. The deployed MCP and RAG routes load that traced data file at runtime, so the documentation corpus is not inlined into the server function's JavaScript bundle and the server never scans user-controlled paths.\n\nThe manifest is refreshed after each successful generation. In watch mode, successful MDX and OpenAPI refreshes, including changes to watched local `$ref` files, become available to MCP automatically. If a refresh fails, the manifest continues to contain the last successfully generated corpus. For a one-time workflow, run `doccupine build` or `doccupine generate` before building and deploying the generated Next.js app.\n\n## Troubleshooting\n\n### Index not building\n\nIf the index is not building, check:\n\n- Your LLM provider is configured correctly in your `.env` file\n- You have a valid API key set\n- `services/mcp/docs-content.json` exists in the generated app\n- The latest Doccupine generation completed successfully before deployment\n\n### No search results\n\nIf searches return no results:\n\n- Verify that your source MDX files are inside the configured `watchDir`\n- Regenerate the app so `docs-content.json` contains the latest pages\n- Ensure the index has been built (check the `index.ready` status via GET `/api/mcp`)\n\n### Slow search performance\n\nSearches use the precomputed in-memory index and are fast. The first search is only slow when the app has to embed your docs at runtime, which happens when the precomputed index is missing or was built with a different provider or model. If performance is consistently slow:\n\n- Confirm the build ran the doc-index precompute step (the `build` script runs it before `next build`) with a valid API key\n- Check your embedding API response times\n- Consider reducing the number of documentation pages\n- Verify your server has sufficient memory\n\n### Cloudflare blocking MCP requests\n\nIf you use Cloudflare as a proxy in front of your documentation site, Cloudflare's bot protection may block server-to-server requests from AI tools like Claude.ai. This can cause MCP connections to fail silently or return errors.\n\nThere are two ways to resolve this:\n\n**Option 1: Disable the Cloudflare proxy (simplest)**\n\nIn your Cloudflare DNS settings, click the orange cloud icon next to your domain record to switch it to \"DNS only\" (grey cloud). This disables Cloudflare's proxy and bot protection for your domain, allowing MCP requests to reach your server directly.\n\n**Option 2: Add a Cloudflare WAF exception (keeps your custom domain proxied)**\n\nIn Cloudflare dashboard:\n\n1. Go to **Security > WAF**.\n2. Click **Create rule**.\n3. Set it up as:\n - **Rule name**: Allow MCP API\n - **Field**: URI Path\n - **Operator**: starts with\n - **Value**: `/api/mcp`\n - **Action**: Skip -- then check all remaining custom rules, Rate limiting rules, and Bot Fight Mode / Super Bot Fight Mode.\n4. Deploy the rule and make sure it is ordered first (above other rules).\n\n<Callout type=\"warning\">\n Also check **Security > Bots** in your Cloudflare dashboard. If \"Bot Fight Mode\" or \"Super Bot Fight Mode\" is enabled, that is very likely what is blocking server-to-server requests from AI tools.\n</Callout>\n\n## Best practices\n\n- **Keep content up-to-date**: Rebuild or redeploy your site after updating documentation to regenerate the index with fresh content.\n- **Use descriptive queries**: More specific queries yield better semantic search results.\n- **Monitor index status**: Use the GET endpoint to check if your index is ready before performing searches.\n- **Optimize content structure**: Well-structured markdown with clear headings improves search relevance.";
|
|
1
|
+
export declare const mcpMdxTemplate = "---\ntitle: \"Model Context Protocol\"\ndescription: \"Connect your Doccupine documentation to AI tools with an MCP server for enhanced AI-powered documentation search.\"\ndate: \"2026-02-19\"\nupdated: \"2026-07-31\"\ncategory: \"AI & Integrations\"\ncategoryOrder: 3\norder: 2\n---\n# Model Context Protocol\n\nConnect your documentation to AI tools with a hosted MCP server.\n\nDoccupine automatically generates a Model Context Protocol (MCP) server from your documentation, making your content accessible to AI applications like Claude, Cursor, VS Code, and other MCP-compatible tools. Your MCP server exposes semantic search capabilities, allowing AI tools to query your documentation directly and provide accurate, context-aware answers.\n\n<Callout type=\"warning\">\n Semantic `search_docs` requires the [AI Assistant](/ai-assistant) embedding\n provider to be configured. `get_doc` and `list_docs` can retrieve the generated\n content manifest without an embedding provider.\n</Callout>\n\n## About MCP servers\n\nThe Model Context Protocol (MCP) is an open protocol that creates standardized connections between AI applications and external services, like documentation. Doccupine generates an MCP server from your documentation, preparing your content for the broader AI ecosystem where any MCP client can connect to your documentation.\n\nYour MCP server exposes search and retrieval tools for AI applications to query your documentation. Your users must connect your MCP server to their preferred AI tools to access your documentation.\n\n### How MCP servers work\n\nWhen an AI tool has your documentation MCP server connected, the AI tool can search your documentation directly instead of making a generic web search in response to a user's prompt. Your MCP server provides access to all indexed content from your documentation site.\n\n- The LLM can proactively search your documentation while generating a response, not just when explicitly asked.\n- The LLM determines when to use the search tool based on the context of the conversation and the relevance of your documentation.\n- Each tool call happens during the generation process, so the LLM searches up-to-date information from your documentation to generate its response.\n\n### MCP compared to web search\n\nAI tools can search the web, but MCP provides distinct advantages for documentation.\n\n- **Direct source access**: Web search depends on what search engines have indexed, which may be stale or incomplete. MCP searches your current indexed documentation directly.\n- **Integrated workflow**: MCP allows the AI to search during response generation rather than performing a separate web search.\n- **Semantic search**: MCP uses vector embeddings for semantic similarity search, providing more relevant results than keyword-based web search.\n- **No search noise**: SEO and ranking algorithms influence web search results. MCP goes straight to your documentation content.\n\n## Access your MCP server\n\nDoccupine automatically generates an MCP server for your documentation and hosts it at your documentation URL with the `/api/mcp` path. For example, if your documentation is hosted at `https://example.com`, your MCP server is available at `https://example.com/api/mcp`.\n\nThe MCP server provides both a GET endpoint to discover available tools and a POST endpoint to execute tool calls.\n\n### Authentication\n\nYou can optionally protect your MCP server with an API key by setting the `DOCS_API_KEY` environment variable in your `.env` file:\n\n```bash\nDOCS_API_KEY=your-secret-key\n```\n\nWhen `DOCS_API_KEY` is set, all requests to `/api/mcp` must include an `Authorization` header with a Bearer token:\n\n```text\nAuthorization: Bearer your-secret-key\n```\n\nRequests without a valid token receive a `401 Unauthorized` response. When `DOCS_API_KEY` is not set, the MCP server follows the site's access mode: it is public on a public site and requires the normal gate session when `SITE_PASSWORD` is configured.\n\n<Callout type=\"note\">\n `DOCS_API_KEY` applies to `/api/mcp` and its `/mcp` discovery alias; it does not grant access to the chat, search, or playground APIs. To gate the entire site behind a shared password, see the [Authentication](/authentication) documentation.\n</Callout>\n\n### Rate limiting\n\nTool calls to `POST /api/mcp` are rate limited per client IP when the generated app runs on a recognized platform that supplies a trusted client-address header. Unknown or self-hosted proxy setups use one conservative shared bucket instead of trusting spoofable forwarding headers. When the limit is exceeded, the server responds with `429 Too Many Requests` and a `Retry-After` header indicating how many seconds to wait before retrying.\n\nThe included limiter is intentionally lightweight and scoped to each running server instance. For a globally consistent limit across multiple serverless instances or regions, or accurate per-client limits behind a custom reverse proxy, configure rate limiting at your trusted hosting edge or use a shared external rate-limit store.\n\nRequests are bounded before tool execution: request bodies, protocol batches, tool arguments, search result counts, and serialized responses all have fixed limits. A protocol body may contain at most one `tools/call` message, so one rate-limited request cannot execute multiple paid tools; batches containing only non-tool protocol messages remain compatible. Internal provider errors are logged on the server and returned to clients as generic failures so deployment details are not exposed.\n\n### API Endpoints\n\n#### GET /api/mcp\n\nReturns information about available tools and the current index status.\n\n**Response:**\n\n```json\n{\n \"tools\": [\n {\n \"name\": \"search_docs\",\n \"description\": \"Search through the documentation content using semantic search...\",\n \"inputSchema\": { ... }\n },\n ...\n ],\n \"index\": {\n \"ready\": true,\n \"chunkCount\": 150\n }\n}\n```\n\n#### POST /api/mcp\n\nExecutes an MCP tool call.\n\n**Request Body:**\n\n```json\n{\n \"tool\": \"search_docs\",\n \"params\": {\n \"query\": \"how to deploy\",\n \"limit\": 6\n }\n}\n```\n\n**Response:**\n\n```json\n{\n \"content\": [\n {\n \"path\": \"app/deployment-and-hosting/page.tsx\",\n \"uri\": \"docs://deployment-and-hosting\",\n \"score\": \"0.892\",\n \"text\": \"Deploy your Doccupine site as a Next.js application...\"\n },\n ...\n ]\n}\n```\n\n## Available Tools\n\nYour MCP server exposes three tools for interacting with your documentation:\n\n### search_docs\n\nSearch through the documentation content using semantic search. Returns relevant chunks of documentation based on the query using vector embeddings and cosine similarity.\n\n**Parameters:**\n\n- `query` (required): The search query to find relevant documentation\n- `limit` (optional): Maximum number of results to return (default: 6)\n- `language` (optional): Language code to search on a site with [languages](/languages); defaults to the site's default language\n- `version` (optional): Version slug to search on a site with [versions](/versions); defaults to the current version\n\n**Example:**\n\n```json\n{\n \"tool\": \"search_docs\",\n \"params\": {\n \"query\": \"how to configure AI assistant\",\n \"limit\": 5\n }\n}\n```\n\n### get_doc\n\nGet the full content of a specific documentation page by its path.\n\n**Parameters:**\n\n- `path` (required): The file path to the documentation page (e.g., `app/getting-started/page.tsx`)\n\n**Example:**\n\n```json\n{\n \"tool\": \"get_doc\",\n \"params\": {\n \"path\": \"app/deployment-and-hosting/page.tsx\"\n }\n}\n```\n\n### list_docs\n\nList all available documentation pages, optionally filtered by directory.\n\n**Parameters:**\n\n- `directory` (optional): Optional directory to filter results (e.g., `components`)\n- `language` (optional): Language code to list on a site with [languages](/languages); defaults to the site's default language\n- `version` (optional): Version slug to list on a site with [versions](/versions); defaults to the current version\n\nResults carry the page's `language` and `version` on such a site, and the `docs://list` resource lists every language and version at once.\n\n**Example:**\n\n```json\n{\n \"tool\": \"list_docs\",\n \"params\": {\n \"directory\": \"configuration\"\n }\n}\n```\n\n## How it works\n\nDoccupine's MCP server uses semantic search powered by vector embeddings to provide accurate, context-aware search results.\n\n### Indexing Process\n\nDoccupine runs this pipeline at build time and ships the resulting vectors with your site, so the server loads a ready-made index instead of re-embedding your docs on every cold start.\n\n1. **Content Manifest**: During generation, Doccupine writes the source MDX and generated API-reference content to `services/mcp/docs-content.json`.\n2. **Runtime Loading**: The build traces that manifest into the MCP and RAG functions, which read it from one fixed path without inlining the corpus into their JavaScript bundles.\n3. **Chunking**: Large documents are split into chunks of approximately 800 characters with 100 character overlap for better context preservation.\n4. **Embedding Generation**: Each chunk is converted to a vector embedding using your configured LLM provider's embedding model.\n5. **Compaction**: Each vector is truncated to `LLM_EMBEDDING_DIMS` dimensions (default 512) and quantized to int8, keeping the index roughly 20x smaller than raw floats so large doc sets don't stall the chat on cold start.\n6. **Index Building**: The compact embeddings are written to `services/mcp/docs-index.json`, traced into your serverless functions as a data file, and loaded into memory at runtime for fast similarity search.\n\n### Search Process\n\n1. **Query Embedding**: The search query is converted to a vector embedding using the same embedding model.\n2. **Similarity Calculation**: Cosine similarity is calculated between the query embedding and all document chunk embeddings.\n3. **Ranking**: Results are sorted by similarity score (highest first).\n4. **Response**: The top N results (based on the limit parameter) are returned with their paths, URIs, scores, and text content.\n\n<Callout type=\"note\">\n Embeddings are precomputed at build time and shipped as a traced data file, so the server loads the ready-made index into memory on startup instead of re-embedding your docs on every cold start. It only embeds at runtime when the precomputed index is missing or was built with a different provider or model. When you update your documentation, regenerate and rebuild or redeploy your site to refresh both the content manifest and index.\n</Callout>\n\n## Use your MCP server\n\nYour users must connect your MCP server to their preferred AI tools.\n\n1. Make your MCP server URL publicly available.\n2. Users copy your MCP server URL and add it to their tools.\n3. Users access your documentation through their tools.\n\nThese are some of the ways you can help your users connect to your MCP server:\n\n<Tabs>\n <TabContent title=\"Claude\">\n <Steps>\n <Step title=\"Get your MCP server URL.\">\n Your MCP server URL is available at `https://your-domain.com/api/mcp`.\n </Step>\n <Step title=\"Publish your MCP server URL for your users.\">\n Create a guide for your users that includes your MCP server URL and the steps to connect it to Claude.\n 1. Navigate to the [Connectors](https://claude.ai/settings/connectors) page in the Claude settings.\n 2. Select **Add custom connector**.\n 3. Add your MCP server name and URL.\n 4. Select **Add**.\n 5. When using Claude, select the attachments button (the plus icon).\n 6. Select your MCP server.\n </Step>\n </Steps>\n See the [Model Context Protocol documentation](https://modelcontextprotocol.io/docs/tutorials/use-remote-mcp-server#connecting-to-a-remote-mcp-server) for more details.\n </TabContent>\n <TabContent title=\"Claude Code\">\n <Steps>\n <Step title=\"Get your MCP server URL.\">\n Your MCP server URL is available at `https://your-domain.com/api/mcp`.\n </Step>\n <Step title=\"Publish your MCP server URL for your users.\">\n Create a guide for your users that includes your MCP server URL and the command to connect it to Claude Code.\n ```bash\n claude mcp add --transport http <name> <url>\n ```\n </Step>\n </Steps>\n See the [Claude Code documentation](https://docs.anthropic.com/en/docs/claude-code/mcp#installing-mcp-servers) for more details.\n </TabContent>\n <TabContent title=\"Cursor\">\n <Steps>\n <Step title=\"Get your MCP server URL.\">\n Your MCP server URL is available at `https://your-domain.com/api/mcp`.\n </Step>\n <Step title=\"Publish your MCP server URL for your users.\">\n Create a guide for your users that includes your MCP server URL and the steps to connect it to Cursor.\n 1. Use <kbd>Command</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd> (<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd> on Windows) to open the command palette.\n 2. Search for \"Open MCP settings\".\n 3. Select **Add custom MCP**. This opens the `mcp.json` file.\n 4. In `mcp.json`, configure your server:\n ```json\n {\n \"mcpServers\": {\n \"<your-mcp-server-name>\": {\n \"url\": \"<your-mcp-server-url>\"\n }\n }\n }\n ```\n </Step>\n </Steps>\n See the [Cursor documentation](https://docs.cursor.com/en/context/mcp#installing-mcp-servers) for more details.\n </TabContent>\n <TabContent title=\"VS Code\">\n <Steps>\n <Step title=\"Get your MCP server URL.\">\n Your MCP server URL is available at `https://your-domain.com/api/mcp`.\n </Step>\n <Step title=\"Publish your MCP server URL for your users.\">\n Create a guide for your users that includes your MCP server URL and the steps to connect it to VS Code.\n 1. Create a `.vscode/mcp.json` file.\n 2. In `mcp.json`, configure your server:\n ```json\n {\n \"servers\": {\n \"<your-mcp-server-name>\": {\n \"type\": \"http\",\n \"url\": \"<your-mcp-server-url>\"\n }\n }\n }\n ```\n </Step>\n </Steps>\n See the [VS Code documentation](https://code.visualstudio.com/docs/copilot/chat/mcp-servers) for more details.\n </TabContent>\n</Tabs>\n\n## Requirements\n\nTo use the MCP server, you need to have the AI Assistant configured. The MCP server uses the same LLM configuration for generating embeddings.\n\n| Variable | Required | Description |\n| -------------- | -------- | ------------------------------------------------------------ |\n| `LLM_PROVIDER` | Yes | Your LLM provider (`openai`, `anthropic`, or `google`) |\n| `DOCS_API_KEY` | No | When set, requires Bearer token authentication on `/api/mcp` |\n\n<Callout type=\"warning\">\n The `search_docs` tool requires an LLM provider for query embeddings. Configure\n the AI Assistant with a valid API key before using semantic search.\n</Callout>\n\nSee the [AI Assistant documentation](/ai-assistant) for configuration details.\n\n## Content indexing\n\nDoccupine builds a `services/mcp/docs-content.json` manifest from your source MDX and generated API-reference pages. The deployed MCP and RAG routes load that traced data file at runtime, so the documentation corpus is not inlined into the server function's JavaScript bundle and the server never scans user-controlled paths.\n\nThe manifest is refreshed after each successful generation. In watch mode, successful MDX and OpenAPI refreshes, including changes to watched local `$ref` files, become available to MCP automatically. If a refresh fails, the manifest continues to contain the last successfully generated corpus. For a one-time workflow, run `doccupine build` or `doccupine generate` before building and deploying the generated Next.js app.\n\n## Troubleshooting\n\n### Index not building\n\nIf the index is not building, check:\n\n- Your LLM provider is configured correctly in your `.env` file\n- You have a valid API key set\n- `services/mcp/docs-content.json` exists in the generated app\n- The latest Doccupine generation completed successfully before deployment\n\n### No search results\n\nIf searches return no results:\n\n- Verify that your source MDX files are inside the configured `watchDir`\n- Regenerate the app so `docs-content.json` contains the latest pages\n- Ensure the index has been built (check the `index.ready` status via GET `/api/mcp`)\n\n### Slow search performance\n\nSearches use the precomputed in-memory index and are fast. The first search is only slow when the app has to embed your docs at runtime, which happens when the precomputed index is missing or was built with a different provider or model. If performance is consistently slow:\n\n- Confirm the build ran the doc-index precompute step (the `build` script runs it before `next build`) with a valid API key\n- Check your embedding API response times\n- Consider reducing the number of documentation pages\n- Verify your server has sufficient memory\n\n### Cloudflare blocking MCP requests\n\nIf you use Cloudflare as a proxy in front of your documentation site, Cloudflare's bot protection may block server-to-server requests from AI tools like Claude.ai. This can cause MCP connections to fail silently or return errors.\n\nThere are two ways to resolve this:\n\n**Option 1: Disable the Cloudflare proxy (simplest)**\n\nIn your Cloudflare DNS settings, click the orange cloud icon next to your domain record to switch it to \"DNS only\" (grey cloud). This disables Cloudflare's proxy and bot protection for your domain, allowing MCP requests to reach your server directly.\n\n**Option 2: Add a Cloudflare WAF exception (keeps your custom domain proxied)**\n\nIn Cloudflare dashboard:\n\n1. Go to **Security > WAF**.\n2. Click **Create rule**.\n3. Set it up as:\n - **Rule name**: Allow MCP API\n - **Field**: URI Path\n - **Operator**: starts with\n - **Value**: `/api/mcp`\n - **Action**: Skip -- then check all remaining custom rules, Rate limiting rules, and Bot Fight Mode / Super Bot Fight Mode.\n4. Deploy the rule and make sure it is ordered first (above other rules).\n\n<Callout type=\"warning\">\n Also check **Security > Bots** in your Cloudflare dashboard. If \"Bot Fight Mode\" or \"Super Bot Fight Mode\" is enabled, that is very likely what is blocking server-to-server requests from AI tools.\n</Callout>\n\n## Best practices\n\n- **Keep content up-to-date**: Rebuild or redeploy your site after updating documentation to regenerate the index with fresh content.\n- **Use descriptive queries**: More specific queries yield better semantic search results.\n- **Monitor index status**: Use the GET endpoint to check if your index is ready before performing searches.\n- **Optimize content structure**: Well-structured markdown with clear headings improves search relevance.";
|
|
@@ -145,6 +145,8 @@ Search through the documentation content using semantic search. Returns relevant
|
|
|
145
145
|
|
|
146
146
|
- \`query\` (required): The search query to find relevant documentation
|
|
147
147
|
- \`limit\` (optional): Maximum number of results to return (default: 6)
|
|
148
|
+
- \`language\` (optional): Language code to search on a site with [languages](/languages); defaults to the site's default language
|
|
149
|
+
- \`version\` (optional): Version slug to search on a site with [versions](/versions); defaults to the current version
|
|
148
150
|
|
|
149
151
|
**Example:**
|
|
150
152
|
|
|
@@ -184,6 +186,10 @@ List all available documentation pages, optionally filtered by directory.
|
|
|
184
186
|
**Parameters:**
|
|
185
187
|
|
|
186
188
|
- \`directory\` (optional): Optional directory to filter results (e.g., \`components\`)
|
|
189
|
+
- \`language\` (optional): Language code to list on a site with [languages](/languages); defaults to the site's default language
|
|
190
|
+
- \`version\` (optional): Version slug to list on a site with [versions](/versions); defaults to the current version
|
|
191
|
+
|
|
192
|
+
Results carry the page's \`language\` and \`version\` on such a site, and the \`docs://list\` resource lists every language and version at once.
|
|
187
193
|
|
|
188
194
|
**Example:**
|
|
189
195
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const navigationMdxTemplate = "---\ntitle: \"Navigation\"\ndescription: \"Organize and structure your navigation.\"\ndate: \"2026-02-19\"\ncategory: \"Configuration\"\ncategoryOrder: 2\norder: 2\n---\n# Navigation\n\nDoccupine builds your sidebar automatically from your MDX pages. By default, it reads the page frontmatter and groups pages into categories in the order you define. For larger docs, you can take full control with a `navigation.json` file.\n\n## Automatic navigation (default)\n\nWhen no custom navigation is provided, Doccupine generates a structure based on each page's frontmatter.\n\n### Frontmatter fields\n\n- **category**: The category name that groups the page in the sidebar.\n- **categoryOrder**: The position of the category within the sidebar. Lower numbers appear first.\n- **order**: The position of the page within its category. Lower numbers appear first.\n- **navIcon**: Optional [Lucide](https://lucide.dev/icons) icon name shown next to the page's sidebar link.\n- **categoryIcon**: Optional Lucide icon name for the page's category header. The first page in a category that sets it wins.\n\n### Example frontmatter\n\n```text\n---\ntitle: \"Navigation\"\ndescription: \"Organize and structure your navigation.\"\ndate: \"2025-01-15\"\ncategory: \"Configuration\"\ncategoryOrder: 2\norder: 2\n---\n```\n\nThis approach is great for small sets of documents. For larger projects, setting these fields on every page can become repetitive.\n\n## Custom navigation with navigation.json\n\nTo centrally define the entire sidebar, create a `navigation.json` at your project root (the same directory where you execute `npx doccupine`). When present, it takes priority over page frontmatter and fully controls the navigation structure.\n\n### Array format\n\nThe simplest format is an array of categories. When using [sections](/sections), this applies to the root section only.\n\n```json\n[\n {\n \"label\": \"Getting Started\",\n \"links\": [\n { \"slug\": \"\", \"title\": \"Introduction\" },\n { \"slug\": \"what-is-doccupine\", \"title\": \"What is Doccupine\" },\n { \"slug\": \"commands\", \"title\": \"Commands\" }\n ]\n },\n {\n \"label\": \"Components\",\n \"links\": [\n { \"slug\": \"components\", \"title\": \"Components\" },\n { \"slug\": \"headers-and-text\", \"title\": \"Headers and Text\" },\n { \"slug\": \"lists-and-tables\", \"title\": \"Lists and tables\" },\n { \"slug\": \"code\", \"title\": \"Code\" },\n { \"slug\": \"prompt\", \"title\": \"Prompt\" },\n { \"slug\": \"callouts\", \"title\": \"Callouts\" },\n { \"slug\": \"accordion\", \"title\": \"Accordion\" },\n { \"slug\": \"tabs\", \"title\": \"Tabs\" },\n { \"slug\": \"steps\", \"title\": \"Steps\" },\n { \"slug\": \"tree\", \"title\": \"Tree\" },\n { \"slug\": \"cards\", \"title\": \"Cards\" },\n { \"slug\": \"buttons\", \"title\": \"Buttons\" },\n { \"slug\": \"badges\", \"title\": \"Badges\" },\n { \"slug\": \"tooltips\", \"title\": \"Tooltips\" },\n { \"slug\": \"images-and-embeds\", \"title\": \"Images and embeds\" },\n { \"slug\": \"frames\", \"title\": \"Frames\" },\n { \"slug\": \"icons\", \"title\": \"Icons\" },\n { \"slug\": \"columns\", \"title\": \"Columns\" },\n { \"slug\": \"side-panel\", \"title\": \"Side Panel\" },\n { \"slug\": \"fields\", \"title\": \"Fields\" },\n { \"slug\": \"api-playground\", \"title\": \"API Playground\" },\n { \"slug\": \"update\", \"title\": \"Update\" },\n { \"slug\": \"color-swatches\", \"title\": \"Color Swatches\" },\n { \"slug\": \"mermaid\", \"title\": \"Mermaid\" }\n ]\n },\n {\n \"label\": \"Configuration\",\n \"links\": [\n { \"slug\": \"globals\", \"title\": \"Globals\" },\n { \"slug\": \"navigation\", \"title\": \"Navigation\" },\n { \"slug\": \"sections\", \"title\": \"Sections\" },\n { \"slug\": \"footer-links\", \"title\": \"Footer Links\" },\n { \"slug\": \"theme\", \"title\": \"Theme\" },\n { \"slug\": \"fonts\", \"title\": \"Fonts\" },\n { \"slug\": \"media-and-assets\", \"title\": \"Media and assets\" }\n ]\n },\n {\n \"label\": \"AI & Integrations\",\n \"links\": [\n { \"slug\": \"ai-assistant\", \"title\": \"AI Assistant\" },\n { \"slug\": \"model-context-protocol\", \"title\": \"Model Context Protocol\" },\n { \"slug\": \"analytics\", \"title\": \"Analytics\" }\n ]\n },\n {\n \"label\": \"Deployment\",\n \"links\": [\n { \"slug\": \"deployment-and-hosting\", \"title\": \"Deployment & Hosting\" },\n { \"slug\": \"authentication\", \"title\": \"Authentication\" }\n ]\n }\n]\n```\n\n### Object format (per-section)\n\nWhen using [sections](/sections), you can define navigation for each section by using an object keyed by section slug. Sections without a key fall back to auto-generated navigation from frontmatter.\n\n```json\n{\n \"\": [\n {\n \"label\": \"General\",\n \"links\": [\n { \"slug\": \"\", \"title\": \"Getting Started\" },\n { \"slug\": \"commands\", \"title\": \"Commands\" }\n ]\n }\n ],\n \"platform\": [\n {\n \"label\": \"Overview\",\n \"links\": [\n { \"slug\": \"platform/auth\", \"title\": \"Authentication\" },\n { \"slug\": \"platform/users\", \"title\": \"Users\" }\n ]\n }\n ]\n}\n```\n\nThe key `\"\"` controls the root section. Other keys match section slugs defined in `sections.json` or derived from frontmatter. See [Sections](/sections) for details on configuring sections.\n\n### Fields\n\n- **label**: The section header shown in the sidebar.\n- **icon**: Optional [Lucide](https://lucide.dev/icons) icon name shown next to the category header.\n- **links**: An array of page entries for that section.\n - **slug**: The MDX file slug (filename without extension). Use an empty string `\"\"` for `index.mdx`.\n - **title**: The display title in the navigation. This can differ from the page's `title` frontmatter.\n - **icon**: Optional Lucide icon name shown next to the link.\n - **links**: Optional array of nested child links. See [Nested navigation](#nested-navigation).\n\n## Icons\n\nAdd icons to categories and links to make the sidebar easier to scan. Icons use [Lucide](https://lucide.dev/icons) names in kebab-case (e.g. `rocket`, `book-open`, `settings`). Unknown names render nothing, so a typo never breaks the build.\n\nWith frontmatter, set `navIcon` on a page for its sidebar link and `categoryIcon` for its category:\n\n```text\n---\ntitle: \"Introduction\"\ncategory: \"Getting Started\"\ncategoryOrder: 1\norder: 1\nnavIcon: \"rocket\"\ncategoryIcon: \"book-open\"\n---\n```\n\nWith `navigation.json`, add an `icon` to any category or link:\n\n```json\n[\n {\n \"label\": \"Getting Started\",\n \"icon\": \"book-open\",\n \"links\": [\n { \"slug\": \"\", \"title\": \"Introduction\", \"icon\": \"rocket\" },\n { \"slug\": \"commands\", \"title\": \"Commands\", \"icon\": \"terminal\" }\n ]\n }\n]\n```\n\n## Nested navigation\n\nA link in `navigation.json` can hold its own `links` array to create a collapsible group. Groups expand and collapse on click and open automatically when one of their pages is active. Nesting can go as deep as you need.\n\n```json\n[\n {\n \"label\": \"Guides\",\n \"icon\": \"book-open\",\n \"links\": [\n { \"slug\": \"guides\", \"title\": \"Overview\", \"icon\": \"compass\" },\n {\n \"title\": \"Advanced\",\n \"icon\": \"settings\",\n \"links\": [\n { \"slug\": \"guides/caching\", \"title\": \"Caching\" },\n { \"slug\": \"guides/streaming\", \"title\": \"Streaming\" }\n ]\n }\n ]\n }\n]\n```\n\nA group can be a plain label - omit `slug` and it acts only as a collapsible header - or a real page, by adding a `slug` so the group title is also a link.\n\n<Callout type=\"note\">\n Nested groups are only available through `navigation.json`. Frontmatter navigation is always two levels: category and pages.\n</Callout>\n\n## Precedence and behavior\n\n<Callout type=\"note\">\n `navigation.json` takes priority over frontmatter. If present, it fully controls the sidebar structure for the sections it covers.\n</Callout>\n\n- Without `navigation.json`, the sidebar is built from page frontmatter: `category` -> grouped; `categoryOrder` -> category position; `order` -> page position.\n- When using the object format, sections not listed in `navigation.json` fall back to frontmatter-based navigation.\n- Pages without a `category` appear at the top level.\n\n## Tips\n\n- **Start simple**: Use frontmatter for small docs. Switch to `navigation.json` as the structure grows.\n- **Keep slugs consistent**: `slug` must match the MDX filename (e.g., `text.mdx` -> `text`).\n- **Control titles**: Use `title` in `navigation.json` to customize sidebar labels without changing page frontmatter.\n- **Per-section navigation**: Use the object format to define different sidebars for each section. Mix and match - define some sections explicitly and let others auto-generate.";
|
|
1
|
+
export declare const navigationMdxTemplate = "---\ntitle: \"Navigation\"\ndescription: \"Organize and structure your navigation.\"\ndate: \"2026-02-19\"\ncategory: \"Configuration\"\ncategoryOrder: 2\norder: 2\n---\n# Navigation\n\nDoccupine builds your sidebar automatically from your MDX pages. By default, it reads the page frontmatter and groups pages into categories in the order you define. For larger docs, you can take full control with a `navigation.json` file.\n\n## Automatic navigation (default)\n\nWhen no custom navigation is provided, Doccupine generates a structure based on each page's frontmatter.\n\n### Frontmatter fields\n\n- **category**: The category name that groups the page in the sidebar.\n- **categoryOrder**: The position of the category within the sidebar. Lower numbers appear first.\n- **order**: The position of the page within its category. Lower numbers appear first.\n- **navIcon**: Optional [Lucide](https://lucide.dev/icons) icon name shown next to the page's sidebar link.\n- **categoryIcon**: Optional Lucide icon name for the page's category header. The first page in a category that sets it wins.\n\n### Example frontmatter\n\n```text\n---\ntitle: \"Navigation\"\ndescription: \"Organize and structure your navigation.\"\ndate: \"2025-01-15\"\ncategory: \"Configuration\"\ncategoryOrder: 2\norder: 2\n---\n```\n\nThis approach is great for small sets of documents. For larger projects, setting these fields on every page can become repetitive.\n\n## Custom navigation with navigation.json\n\nTo centrally define the entire sidebar, create a `navigation.json` at your project root (the same directory where you execute `npx doccupine`). When present, it takes priority over page frontmatter and fully controls the navigation structure.\n\n### Array format\n\nThe simplest format is an array of categories. When using [sections](/sections), this applies to the root section only.\n\n```json\n[\n {\n \"label\": \"Getting Started\",\n \"links\": [\n { \"slug\": \"\", \"title\": \"Introduction\" },\n { \"slug\": \"what-is-doccupine\", \"title\": \"What is Doccupine\" },\n { \"slug\": \"commands\", \"title\": \"Commands\" }\n ]\n },\n {\n \"label\": \"Components\",\n \"links\": [\n { \"slug\": \"components\", \"title\": \"Components\" },\n { \"slug\": \"headers-and-text\", \"title\": \"Headers and Text\" },\n { \"slug\": \"lists-and-tables\", \"title\": \"Lists and tables\" },\n { \"slug\": \"code\", \"title\": \"Code\" },\n { \"slug\": \"prompt\", \"title\": \"Prompt\" },\n { \"slug\": \"callouts\", \"title\": \"Callouts\" },\n { \"slug\": \"accordion\", \"title\": \"Accordion\" },\n { \"slug\": \"tabs\", \"title\": \"Tabs\" },\n { \"slug\": \"steps\", \"title\": \"Steps\" },\n { \"slug\": \"tree\", \"title\": \"Tree\" },\n { \"slug\": \"cards\", \"title\": \"Cards\" },\n { \"slug\": \"buttons\", \"title\": \"Buttons\" },\n { \"slug\": \"badges\", \"title\": \"Badges\" },\n { \"slug\": \"tooltips\", \"title\": \"Tooltips\" },\n { \"slug\": \"images-and-embeds\", \"title\": \"Images and embeds\" },\n { \"slug\": \"frames\", \"title\": \"Frames\" },\n { \"slug\": \"icons\", \"title\": \"Icons\" },\n { \"slug\": \"columns\", \"title\": \"Columns\" },\n { \"slug\": \"side-panel\", \"title\": \"Side Panel\" },\n { \"slug\": \"fields\", \"title\": \"Fields\" },\n { \"slug\": \"api-playground\", \"title\": \"API Playground\" },\n { \"slug\": \"update\", \"title\": \"Update\" },\n { \"slug\": \"color-swatches\", \"title\": \"Color Swatches\" },\n { \"slug\": \"mermaid\", \"title\": \"Mermaid\" }\n ]\n },\n {\n \"label\": \"Configuration\",\n \"links\": [\n { \"slug\": \"globals\", \"title\": \"Globals\" },\n { \"slug\": \"navigation\", \"title\": \"Navigation\" },\n { \"slug\": \"sections\", \"title\": \"Sections\" },\n { \"slug\": \"footer-links\", \"title\": \"Footer Links\" },\n { \"slug\": \"theme\", \"title\": \"Theme\" },\n { \"slug\": \"fonts\", \"title\": \"Fonts\" },\n { \"slug\": \"media-and-assets\", \"title\": \"Media and assets\" }\n ]\n },\n {\n \"label\": \"AI & Integrations\",\n \"links\": [\n { \"slug\": \"ai-assistant\", \"title\": \"AI Assistant\" },\n { \"slug\": \"model-context-protocol\", \"title\": \"Model Context Protocol\" },\n { \"slug\": \"analytics\", \"title\": \"Analytics\" }\n ]\n },\n {\n \"label\": \"Deployment\",\n \"links\": [\n { \"slug\": \"deployment-and-hosting\", \"title\": \"Deployment & Hosting\" },\n { \"slug\": \"authentication\", \"title\": \"Authentication\" }\n ]\n }\n]\n```\n\n### Object format (per-section)\n\nWhen using [sections](/sections), you can define navigation for each section by using an object keyed by section slug. Sections without a key fall back to auto-generated navigation from frontmatter.\n\n```json\n{\n \"\": [\n {\n \"label\": \"General\",\n \"links\": [\n { \"slug\": \"\", \"title\": \"Getting Started\" },\n { \"slug\": \"commands\", \"title\": \"Commands\" }\n ]\n }\n ],\n \"platform\": [\n {\n \"label\": \"Overview\",\n \"links\": [\n { \"slug\": \"platform/auth\", \"title\": \"Authentication\" },\n { \"slug\": \"platform/users\", \"title\": \"Users\" }\n ]\n }\n ]\n}\n```\n\nThe key `\"\"` controls the root section. Other keys match section slugs defined in `sections.json` or derived from frontmatter. See [Sections](/sections) for details on configuring sections.\n\nKeys are URL prefixes, so on a site with [languages](/languages) or [versions](/versions) they can also name a variant: `\"de\"` for the German root, `\"de/platform\"` for the German Platform section, `\"v1\"` for the root of version v1. A scope without a key builds its sidebar from frontmatter, so you only have to define the scopes you want to control by hand.\n\n### Fields\n\n- **label**: The section header shown in the sidebar.\n- **icon**: Optional [Lucide](https://lucide.dev/icons) icon name shown next to the category header.\n- **links**: An array of page entries for that section.\n - **slug**: The MDX file slug (filename without extension). Use an empty string `\"\"` for `index.mdx`.\n - **title**: The display title in the navigation. This can differ from the page's `title` frontmatter.\n - **icon**: Optional Lucide icon name shown next to the link.\n - **links**: Optional array of nested child links. See [Nested navigation](#nested-navigation).\n\n## Icons\n\nAdd icons to categories and links to make the sidebar easier to scan. Icons use [Lucide](https://lucide.dev/icons) names in kebab-case (e.g. `rocket`, `book-open`, `settings`). Unknown names render nothing, so a typo never breaks the build.\n\nWith frontmatter, set `navIcon` on a page for its sidebar link and `categoryIcon` for its category:\n\n```text\n---\ntitle: \"Introduction\"\ncategory: \"Getting Started\"\ncategoryOrder: 1\norder: 1\nnavIcon: \"rocket\"\ncategoryIcon: \"book-open\"\n---\n```\n\nWith `navigation.json`, add an `icon` to any category or link:\n\n```json\n[\n {\n \"label\": \"Getting Started\",\n \"icon\": \"book-open\",\n \"links\": [\n { \"slug\": \"\", \"title\": \"Introduction\", \"icon\": \"rocket\" },\n { \"slug\": \"commands\", \"title\": \"Commands\", \"icon\": \"terminal\" }\n ]\n }\n]\n```\n\n## Nested navigation\n\nA link in `navigation.json` can hold its own `links` array to create a collapsible group. Groups expand and collapse on click and open automatically when one of their pages is active. Nesting can go as deep as you need.\n\n```json\n[\n {\n \"label\": \"Guides\",\n \"icon\": \"book-open\",\n \"links\": [\n { \"slug\": \"guides\", \"title\": \"Overview\", \"icon\": \"compass\" },\n {\n \"title\": \"Advanced\",\n \"icon\": \"settings\",\n \"links\": [\n { \"slug\": \"guides/caching\", \"title\": \"Caching\" },\n { \"slug\": \"guides/streaming\", \"title\": \"Streaming\" }\n ]\n }\n ]\n }\n]\n```\n\nA group can be a plain label - omit `slug` and it acts only as a collapsible header - or a real page, by adding a `slug` so the group title is also a link.\n\n<Callout type=\"note\">\n Nested groups are only available through `navigation.json`. Frontmatter navigation is always two levels: category and pages.\n</Callout>\n\n## Precedence and behavior\n\n<Callout type=\"note\">\n `navigation.json` takes priority over frontmatter. If present, it fully controls the sidebar structure for the sections it covers.\n</Callout>\n\n- Without `navigation.json`, the sidebar is built from page frontmatter: `category` -> grouped; `categoryOrder` -> category position; `order` -> page position.\n- When using the object format, sections not listed in `navigation.json` fall back to frontmatter-based navigation.\n- Pages without a `category` appear at the top level.\n\n## Tips\n\n- **Start simple**: Use frontmatter for small docs. Switch to `navigation.json` as the structure grows.\n- **Keep slugs consistent**: `slug` must match the MDX filename (e.g., `text.mdx` -> `text`).\n- **Control titles**: Use `title` in `navigation.json` to customize sidebar labels without changing page frontmatter.\n- **Per-section navigation**: Use the object format to define different sidebars for each section. Mix and match - define some sections explicitly and let others auto-generate.";
|
|
@@ -143,6 +143,8 @@ When using [sections](/sections), you can define navigation for each section by
|
|
|
143
143
|
|
|
144
144
|
The key \`""\` controls the root section. Other keys match section slugs defined in \`sections.json\` or derived from frontmatter. See [Sections](/sections) for details on configuring sections.
|
|
145
145
|
|
|
146
|
+
Keys are URL prefixes, so on a site with [languages](/languages) or [versions](/versions) they can also name a variant: \`"de"\` for the German root, \`"de/platform"\` for the German Platform section, \`"v1"\` for the root of version v1. A scope without a key builds its sidebar from frontmatter, so you only have to define the scopes you want to control by hand.
|
|
147
|
+
|
|
146
148
|
### Fields
|
|
147
149
|
|
|
148
150
|
- **label**: The section header shown in the sidebar.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const platformAiAssistantMdxTemplate = "---\ntitle: \"AI Assistant\"\ndescription: \"One setting per project decides what powers every AI feature - Agent Sync, the editor assistant, repository imports, and the assistant on your published site.\"\ndate: \"2026-02-19\"\nupdated: \"2026-08-17\"\ncategory: \"AI & Integrations\"\ncategoryOrder: 3\ncategoryIcon: \"sparkles\"\norder: 0\nsection: \"Platform\"\n---\n# AI Assistant\n\nOne setting decides what every AI feature in your project spends. It covers both sides of Doccupine:\n\n| Where | What it powers |\n| ----- | -------------- |\n| **In Doccupine** | [Agent Sync](/platform/self-updating-docs) runs, the [editor's](/platform/file-editor) writing assistant, Auto-link's AI selection, and [Import from GitHub](/platform/import-from-github) |\n| **On your site** | The assistant readers use to ask questions about your documentation |\n\nYou'll find it under **Settings \u2192 AI** in the project sidebar.\n\n## Modes\n\n### Enable AI Assistant (default)\n\nUses the AI credit included with your plan. Nothing to configure - no API keys, no provider account.\n\n| Plan | Monthly Budget |\n| ---------- | -------------- |\n| Trial | $5 |\n| Pro | $20 |\n| Enterprise | $50 |\n\nThe settings page shows a usage meter with your current spending and what's left. Usage resets with your billing cycle.\n\nBecause this credit is shared across everything you do, Doccupine keeps single runs bounded: an agent run and a repository import each stop at a spend ceiling and ship whatever they finished, rather than quietly draining a month's budget in one go.\n\n#### AI credit top-ups\n\nIf you run out before your billing cycle resets, you can buy a one-time top-up:\n\n- **$5**\n- **$10**\n- **$20**\n\nTop-ups apply to the current cycle immediately and reset when it renews. You can buy more than one in the same cycle.\n\n### Custom AI Models\n\nBring your own API key. It is used for everything above - writing documentation as well as answering readers - and the spend goes to your provider rather than your Doccupine credit. Supported providers:\n\n- **OpenAI**\n- **Anthropic**\n- **Google**\n\n<Callout type=\"note\">\n Once saved, a key is never shown again - the settings page displays only its last four characters. To change it, select **Replace key** and enter a new one.\n</Callout>\n\n#### Documentation model\n\nWhich model Agent Sync, the editor assistant, and imports write with. This is deliberately separate from the chat model below: one writes whole documentation pages that have to build, the other writes a paragraph into a chat bubble, and the right model for each is rarely the same. Doccupine defaults to a capable model for your provider.\n\n#### Spend limit\n\nYour own key has no ceiling unless you give it one. Turn on **Limit spend per run** to cap a single agent run or import in dollars; Doccupine stops at the limit and keeps whatever it wrote. The limit is per run, not per month.\n\n#### Site assistant options\n\nThese only affect the assistant on your published site:\n\n- **Chat model** - the model that answers readers\n- **Embedding model** - the model used to index your documentation content\n- **Temperature** - response creativity (0.0 for focused answers, up to 1.0 for more varied ones)\n\nFor the full list of available models, see your provider's own documentation.\n\n### Off\n\nTurns AI off for the whole project. The assistant disappears from your published site, and Agent Sync, the editor's writing assistant, and repository imports all stop - nothing can spend on this project until you turn it back on.\n\nYour source links and drift history are untouched, so turning AI back on picks up where you left off.\n\n<Callout type=\"note\">\n AI settings are stored with your project and take effect in Doccupine immediately. Your published site receives them on its next deploy, so Doccupine offers to redeploy after you save.\n</Callout>\n\n<Callout type=\"warning\">\n Only the project **owner** can change these settings or see which key is configured. Team members can see whether AI is on, since it decides whether the agent and the editor assistant are available to them.\n</Callout>\n\n## AI endpoint authentication\n\nYour site's chat endpoint (`/api/rag`) is public by default, in the same way your documentation is. That means anyone who finds the endpoint can send it questions, and every question spends from your AI budget - or your own provider account. On a site you expect to be found, it is worth deciding deliberately whether that is what you want.\n\nTo require a key:\n\n1. Enable **Require API key for AI chat** in the Authentication card.\n2. Enter an API key.\n3. Save.\n\nClients must then send the key as a Bearer token in the `Authorization` header of every request to `/api/rag`.\n\n<Callout type=\"note\">\n Like your provider key, this one is write-only: leave the field empty to keep the key you already saved, and enter a new value only when you want to replace it. Keep your own copy - Doccupine cannot show it to you again.\n</Callout>\n\n<Callout type=\"warning\">\n On a public site, turning this on also stops the chat widget on your own documentation from answering visitors. A browser cannot safely hold a server secret, so there is nowhere for the page to keep the key - only API clients that send the Bearer token get answers.\n</Callout>\n\nIf you want readers to keep using the assistant while still closing the endpoint to strangers, protect the whole site with a password instead - see [Authentication](/platform/authentication). Readers who have unlocked the site keep chatting as normal, and the API key becomes a second way in for programmatic clients rather than a replacement for the first.\n\n<Callout type=\"note\">\n The key is stored as an environment variable (`RAG_API_KEY`) on your deployment. After saving, a redeploy is triggered automatically to apply the change. See [Authentication](/authentication) for how the site gate, `RAG_API_KEY`, and `DOCS_API_KEY` interact.\n</Callout>\n\n<Callout type=\"note\">\n Connecting external AI tools (Claude, Cursor, and others) to your site is configured on the dedicated [MCP](/platform/mcp) page, which also covers MCP server authentication.\n</Callout>";
|
|
1
|
+
export declare const platformAiAssistantMdxTemplate = "---\ntitle: \"AI Assistant\"\ndescription: \"One setting per project decides what powers every AI feature - Agent Sync, the editor assistant, repository imports, and the assistant on your published site.\"\ndate: \"2026-02-19\"\nupdated: \"2026-08-17\"\ncategory: \"AI & Integrations\"\ncategoryOrder: 3\ncategoryIcon: \"sparkles\"\norder: 0\nsection: \"Platform\"\n---\n# AI Assistant\n\nOne setting decides what every AI feature in your project spends. It covers both sides of Doccupine:\n\n| Where | What it powers |\n| ----- | -------------- |\n| **In Doccupine** | [Agent Sync](/platform/self-updating-docs) runs, the [editor's](/platform/file-editor) writing assistant, Auto-link's AI selection, and [Import from GitHub](/platform/import-from-github) |\n| **On your site** | The assistant readers use to ask questions about your documentation |\n\nYou'll find it under **Settings \u2192 AI** in the project sidebar.\n\n## Modes\n\n### Enable AI Assistant (default)\n\nUses the AI credit included with your plan. Nothing to configure - no API keys, no provider account.\n\nPage translation from the [Languages](/platform/languages) page uses the project's AI configuration like every other AI feature: this credit here, your own keys with custom models.\n\n| Plan | Monthly Budget |\n| ---------- | -------------- |\n| Trial | $5 |\n| Pro | $20 |\n| Enterprise | $50 |\n\nThe settings page shows a usage meter with your current spending and what's left. Usage resets with your billing cycle.\n\nBecause this credit is shared across everything you do, Doccupine keeps single runs bounded: an agent run and a repository import each stop at a spend ceiling and ship whatever they finished, rather than quietly draining a month's budget in one go.\n\n#### AI credit top-ups\n\nIf you run out before your billing cycle resets, you can buy a one-time top-up:\n\n- **$5**\n- **$10**\n- **$20**\n\nTop-ups apply to the current cycle immediately and reset when it renews. You can buy more than one in the same cycle.\n\n### Custom AI Models\n\nBring your own API key. It is used for everything above - writing documentation as well as answering readers - and the spend goes to your provider rather than your Doccupine credit. Supported providers:\n\n- **OpenAI**\n- **Anthropic**\n- **Google**\n\n<Callout type=\"note\">\n Once saved, a key is never shown again - the settings page displays only its last four characters. To change it, select **Replace key** and enter a new one.\n</Callout>\n\n#### Documentation model\n\nWhich model Agent Sync, the editor assistant, and imports write with. This is deliberately separate from the chat model below: one writes whole documentation pages that have to build, the other writes a paragraph into a chat bubble, and the right model for each is rarely the same. Doccupine defaults to a capable model for your provider.\n\n#### Spend limit\n\nYour own key has no ceiling unless you give it one. Turn on **Limit spend per run** to cap a single agent run or import in dollars; Doccupine stops at the limit and keeps whatever it wrote. The limit is per run, not per month.\n\n#### Site assistant options\n\nThese only affect the assistant on your published site:\n\n- **Chat model** - the model that answers readers\n- **Embedding model** - the model used to index your documentation content\n- **Temperature** - response creativity (0.0 for focused answers, up to 1.0 for more varied ones)\n\nFor the full list of available models, see your provider's own documentation.\n\n### Off\n\nTurns AI off for the whole project. The assistant disappears from your published site, and Agent Sync, the editor's writing assistant, and repository imports all stop - nothing can spend on this project until you turn it back on.\n\nYour source links and drift history are untouched, so turning AI back on picks up where you left off.\n\n<Callout type=\"note\">\n AI settings are stored with your project and take effect in Doccupine immediately. Your published site receives them on its next deploy, so Doccupine offers to redeploy after you save.\n</Callout>\n\n<Callout type=\"warning\">\n Only the project **owner** can change these settings or see which key is configured. Team members can see whether AI is on, since it decides whether the agent and the editor assistant are available to them.\n</Callout>\n\n## AI endpoint authentication\n\nYour site's chat endpoint (`/api/rag`) is public by default, in the same way your documentation is. That means anyone who finds the endpoint can send it questions, and every question spends from your AI budget - or your own provider account. On a site you expect to be found, it is worth deciding deliberately whether that is what you want.\n\nTo require a key:\n\n1. Enable **Require API key for AI chat** in the Authentication card.\n2. Enter an API key.\n3. Save.\n\nClients must then send the key as a Bearer token in the `Authorization` header of every request to `/api/rag`.\n\n<Callout type=\"note\">\n Like your provider key, this one is write-only: leave the field empty to keep the key you already saved, and enter a new value only when you want to replace it. Keep your own copy - Doccupine cannot show it to you again.\n</Callout>\n\n<Callout type=\"warning\">\n On a public site, turning this on also stops the chat widget on your own documentation from answering visitors. A browser cannot safely hold a server secret, so there is nowhere for the page to keep the key - only API clients that send the Bearer token get answers.\n</Callout>\n\nIf you want readers to keep using the assistant while still closing the endpoint to strangers, protect the whole site with a password instead - see [Authentication](/platform/authentication). Readers who have unlocked the site keep chatting as normal, and the API key becomes a second way in for programmatic clients rather than a replacement for the first.\n\n<Callout type=\"note\">\n The key is stored as an environment variable (`RAG_API_KEY`) on your deployment. After saving, a redeploy is triggered automatically to apply the change. See [Authentication](/authentication) for how the site gate, `RAG_API_KEY`, and `DOCS_API_KEY` interact.\n</Callout>\n\n<Callout type=\"note\">\n Connecting external AI tools (Claude, Cursor, and others) to your site is configured on the dedicated [MCP](/platform/mcp) page, which also covers MCP server authentication.\n</Callout>";
|
|
@@ -26,6 +26,8 @@ You'll find it under **Settings → AI** in the project sidebar.
|
|
|
26
26
|
|
|
27
27
|
Uses the AI credit included with your plan. Nothing to configure - no API keys, no provider account.
|
|
28
28
|
|
|
29
|
+
Page translation from the [Languages](/platform/languages) page uses the project's AI configuration like every other AI feature: this credit here, your own keys with custom models.
|
|
30
|
+
|
|
29
31
|
| Plan | Monthly Budget |
|
|
30
32
|
| ---------- | -------------- |
|
|
31
33
|
| Trial | $5 |
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const platformApiPlaygroundMdxTemplate = "---\ntitle: \"API Playground\"\ndescription: \"Register an OpenAPI spec and turn it into an interactive API reference with a live request playground.\"\ndate: \"2026-07-26\"\nupdated: \"2026-07-31\"\ncategory: \"AI & Integrations\"\ncategoryOrder: 3\norder: 2\nsection: \"Platform\"\n---\n# API Playground\n\nThe API Playground settings page turns an OpenAPI spec in your repository into an interactive API reference. Any page can embed a live \"try it\" playground for a single endpoint, and you can generate a full reference with one page per operation.\n\n## Registering a spec\n\nOpen the **API Playground** settings page and choose your OpenAPI file with the **OpenAPI spec file** picker. It searches your repository for YAML and JSON files - start typing to filter, or type a path to use one that is not listed yet. The path is stored, relative to `doccupine.json`, as the `openapi` field:\n\n```json\n{\n \"openapi\": \"openapi.yaml\"\n}\n```\n\nPress **Save Configuration**, then commit the change. Both YAML and JSON specs (OpenAPI 3.0 and 3.1) are supported.\n\n> For multiple specs, edit the `openapi` array in `doccupine.json` directly - the settings page manages a single spec.\n\n<Callout type=\"warning\">\n The root spec and every local `$ref` dependency must exist in the repository after publishing. References must stay beneath the directory containing the root spec, use `.json`, `.yaml`, or `.yml`, and cannot target remote URLs, dotfiles, or dot-directories. Publish the configuration, root spec, and all referenced files together. Doccupine [checks this before publishing](/platform/publishing) rather than letting the deploy fail.\n</Callout>\n\n## Embedding a playground on a page\n\nAdd an `openapi` field to any page's frontmatter to render the interactive playground for that operation above the page content. The value is either `\"METHOD /path\"` or an `operationId`:\n\n```mdx\n---\ntitle: \"Create a post\"\nopenapi: \"POST /posts\"\n---\n\nPosts are created for a user. The playground above is live - fill in the fields and press **Send**.\n```\n\nThe playground resolves the operation from your configured spec, so its parameters, request body, and responses always match the source of truth.\n\n## Generating an API reference\n\nPress **Generate API pages** to create one page per operation from your spec. Each generated page:\n\n- carries an `openapi:` frontmatter reference, so it renders the live playground,\n- is placed under an **API Reference** section, grouped by tag,\n- documents every parameter, the request body, and each response,\n- is staged as a pending change for you to review and commit.\n\nAlongside them you get an **API Reference** landing page at the section root, listing every endpoint as a card with its method and path. It is a normal page like any other, so you can edit it, add an introduction, or delete it if you would rather write your own.\n\nGeneration reads the committed spec, so save and commit your configuration first. Endpoints are shown with a colored HTTP-method badge so they are easy to scan in the file list.\n\n## Sending requests\n\nInside the playground, **Try it** opens the request editor. Fill in parameters, authentication, and the body, then press **Send**:\n\n- **Proxy** mode runs the request from the server, so endpoints that block cross-origin browser calls still work. Requests are restricted to the servers declared in your spec.\n- **Direct** mode calls the API straight from the browser.\n\nSecrets you enter are never logged, and appear as `<YOUR_CREDENTIALS>` in the generated code snippets unless you choose to reveal them.\n";
|
|
1
|
+
export declare const platformApiPlaygroundMdxTemplate = "---\ntitle: \"API Playground\"\ndescription: \"Register an OpenAPI spec and turn it into an interactive API reference with a live request playground.\"\ndate: \"2026-07-26\"\nupdated: \"2026-07-31\"\ncategory: \"AI & Integrations\"\ncategoryOrder: 3\norder: 2\nsection: \"Platform\"\n---\n# API Playground\n\nThe API Playground settings page turns an OpenAPI spec in your repository into an interactive API reference. Any page can embed a live \"try it\" playground for a single endpoint, and you can generate a full reference with one page per operation.\n\n## Registering a spec\n\nOpen the **API Playground** settings page and choose your OpenAPI file with the **OpenAPI spec file** picker. It searches your repository for YAML and JSON files - start typing to filter, or type a path to use one that is not listed yet. The path is stored, relative to `doccupine.json`, as the `openapi` field:\n\n```json\n{\n \"openapi\": \"openapi.yaml\"\n}\n```\n\nPress **Save Configuration**, then commit the change. Both YAML and JSON specs (OpenAPI 3.0 and 3.1) are supported.\n\n> For multiple specs, edit the `openapi` array in `doccupine.json` directly - the settings page manages a single spec.\n\n<Callout type=\"warning\">\n The root spec and every local `$ref` dependency must exist in the repository after publishing. References must stay beneath the directory containing the root spec, use `.json`, `.yaml`, or `.yml`, and cannot target remote URLs, dotfiles, or dot-directories. Publish the configuration, root spec, and all referenced files together. Doccupine [checks this before publishing](/platform/publishing) rather than letting the deploy fail.\n</Callout>\n\n## Embedding a playground on a page\n\nAdd an `openapi` field to any page's frontmatter to render the interactive playground for that operation above the page content. The value is either `\"METHOD /path\"` or an `operationId`:\n\n```mdx\n---\ntitle: \"Create a post\"\nopenapi: \"POST /posts\"\n---\n\nPosts are created for a user. The playground above is live - fill in the fields and press **Send**.\n```\n\nThe playground resolves the operation from your configured spec, so its parameters, request body, and responses always match the source of truth.\n\n## Generating an API reference\n\nPress **Generate API pages** to create one page per operation from your spec. Each generated page:\n\n- carries an `openapi:` frontmatter reference, so it renders the live playground,\n- is placed under an **API Reference** section, grouped by tag,\n- documents every parameter, the request body, and each response,\n- is staged as a pending change for you to review and commit.\n\nAlongside them you get an **API Reference** landing page at the section root, listing every endpoint as a card with its method and path. It is a normal page like any other, so you can edit it, add an introduction, or delete it if you would rather write your own.\n\nThe generated pages always land in the default language and version; the reference is neither translated nor versioned.\n\nGeneration reads the committed spec, so save and commit your configuration first. Endpoints are shown with a colored HTTP-method badge so they are easy to scan in the file list.\n\n## Sending requests\n\nInside the playground, **Try it** opens the request editor. Fill in parameters, authentication, and the body, then press **Send**:\n\n- **Proxy** mode runs the request from the server, so endpoints that block cross-origin browser calls still work. Requests are restricted to the servers declared in your spec.\n- **Direct** mode calls the API straight from the browser.\n\nSecrets you enter are never logged, and appear as `<YOUR_CREDENTIALS>` in the generated code snippets unless you choose to reveal them.\n";
|
|
@@ -56,6 +56,8 @@ Press **Generate API pages** to create one page per operation from your spec. Ea
|
|
|
56
56
|
|
|
57
57
|
Alongside them you get an **API Reference** landing page at the section root, listing every endpoint as a card with its method and path. It is a normal page like any other, so you can edit it, add an introduction, or delete it if you would rather write your own.
|
|
58
58
|
|
|
59
|
+
The generated pages always land in the default language and version; the reference is neither translated nor versioned.
|
|
60
|
+
|
|
59
61
|
Generation reads the committed spec, so save and commit your configuration first. Endpoints are shown with a colored HTTP-method badge so they are easy to scan in the file list.
|
|
60
62
|
|
|
61
63
|
## Sending requests
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const platformFileEditorMdxTemplate = "---\ntitle: \"File Editor\"\ndescription: \"Browse, create, and edit your documentation files directly in the browser.\"\ndate: \"2026-02-19\"\ncategory: \"Editing\"\ncategoryOrder: 1\ncategoryIcon: \"pencil\"\norder: 0\nsection: \"Platform\"\n---\n# File Editor\n\nThe file editor is the main workspace for your documentation project. It provides a browser-based file explorer and editor for working with your MDX files and assets.\n\n## File explorer\n\nThe left panel has three tabs:\n\n- **Files** - browse your repository's file tree, create and manage files and directories\n- **Media** - browse directories and manage uploaded images and binary assets\n- **Navigation** - open the [Navigation Builder](/platform/navigation-settings) to configure your sidebar structure with drag-and-drop\n\nIn the Files tab, you can:\n\n- **Browse** directories and files\n- **Create** new files and directories\n- **Rename** and **delete** existing files\n- **Upload** binary assets like images, favicons, and font files\n\nClick any file to open it in the editor panel.\n\n## Editing files\n\nThe editor supports MDX files with full syntax highlighting. Changes you make are saved as **pending changes** - they aren't committed to your repository until you publish.\n\n<Callout type=\"note\">\n Pending changes are stored in Doccupine's database, not in your Git repository. This means you can make edits across multiple sessions before publishing.\n</Callout>\n\n## Inserting components\n\nYou don't have to remember the syntax for every component. There are three ways to insert one, and they all produce the same snippet.\n\n**The Insert component menu.** In the editor toolbar, open the component menu and pick from the grouped list. The snippet is inserted at your cursor, or appended to the end of the document if you haven't placed a cursor yet.\n\n**The `/` shortcut.** Type `/` on an empty line or after a space and the same menu opens at your cursor. Choose a component and it replaces the `/`. If you keep typing instead, the menu disappears and your text is left alone, so a `/` in a URL or a date never gets in the way.\n\n**Autocomplete.** Type `<` and a list of components appears. Keep typing to filter it.\n\nWhichever you use, the editor scrolls the new component into view and places your cursor inside it, ready to fill in.\n\n<Callout type=\"tip\">\n The menu only offers components that are valid on their own. Ones that must live inside a parent, like `<Step>` inside `<Steps>`, stay in the `<` autocomplete instead, so you can reach them while filling out a list.\n</Callout>\n\n## Live preview\n\nThe editor has three modes: **Code**, **Split**, and **Preview**. Split shows your source and the rendered result side by side.\n\nThe preview renders your document the way your published site will:\n\n- **Components** render as themselves, not as raw tags\n- **Images** resolve from your repository, so `` shows the file from your `public` directory. Relative paths like `./diagram.png` resolve against the document's own directory, and images you've uploaded but not yet published appear too\n- **Mermaid diagrams** render as diagrams rather than code blocks\n\nIf a component is missing or a diagram can't be parsed, the preview says so in place rather than failing, so you can see what went wrong and keep editing.\n\n## Media directories\n\nThe **Media** tab browses directories, not just a flat list. Click a directory to open it, and use the breadcrumb to go back.\n\n- **New directory** creates a directory in the directory you're currently viewing\n- **Uploads** go into the directory you're viewing, not always the top level\n- **Copy path** gives you the path to paste into MDX, relative to your site root\n\n<Callout type=\"note\">\n Git can't store an empty directory, so a new directory holds a hidden placeholder file until you add something to it. You'll never see the placeholder in the Media tab.\n</Callout>\n\n## Version history\n\nFor any file, you can view its commit history to see how it has changed over time. This lets you:\n\n- See when changes were made and what the commit messages were\n- View the file's content at any previous commit\n- Compare past versions to understand what changed\n\n## Binary files\n\nYou can upload images and other binary assets (PNG, JPG, SVG, WOFF2, etc.) directly through the file explorer. These are stored temporarily in Doccupine's storage and committed to your repository when you publish.\n\n## Read-only mode\n\nTeam members with the **Viewer** or **Billing** role can browse files but cannot make edits. The editor will display content in read-only mode for these users.";
|
|
1
|
+
export declare const platformFileEditorMdxTemplate = "---\ntitle: \"File Editor\"\ndescription: \"Browse, create, and edit your documentation files directly in the browser.\"\ndate: \"2026-02-19\"\ncategory: \"Editing\"\ncategoryOrder: 1\ncategoryIcon: \"pencil\"\norder: 0\nsection: \"Platform\"\n---\n# File Editor\n\nThe file editor is the main workspace for your documentation project. It provides a browser-based file explorer and editor for working with your MDX files and assets.\n\n## File explorer\n\nThe left panel has three tabs:\n\n- **Files** - browse your repository's file tree, create and manage files and directories\n- **Media** - browse directories and manage uploaded images and binary assets\n- **Navigation** - open the [Navigation Builder](/platform/navigation-settings) to configure your sidebar structure with drag-and-drop\n\nIn the Files tab, you can:\n\n- **Browse** directories and files\n- **Create** new files and directories\n- **Rename** and **delete** existing files\n- **Upload** binary assets like images, favicons, and font files\n\nOn a project with [languages](/platform/languages) or [versions](/platform/versions), a selector above the tree scopes it to one language and version at a time; the other variant folders stay out of view until you switch.\n\nClick any file to open it in the editor panel.\n\n## Editing files\n\nThe editor supports MDX files with full syntax highlighting. Changes you make are saved as **pending changes** - they aren't committed to your repository until you publish.\n\n<Callout type=\"note\">\n Pending changes are stored in Doccupine's database, not in your Git repository. This means you can make edits across multiple sessions before publishing.\n</Callout>\n\n## Inserting components\n\nYou don't have to remember the syntax for every component. There are three ways to insert one, and they all produce the same snippet.\n\n**The Insert component menu.** In the editor toolbar, open the component menu and pick from the grouped list. The snippet is inserted at your cursor, or appended to the end of the document if you haven't placed a cursor yet.\n\n**The `/` shortcut.** Type `/` on an empty line or after a space and the same menu opens at your cursor. Choose a component and it replaces the `/`. If you keep typing instead, the menu disappears and your text is left alone, so a `/` in a URL or a date never gets in the way.\n\n**Autocomplete.** Type `<` and a list of components appears. Keep typing to filter it.\n\nWhichever you use, the editor scrolls the new component into view and places your cursor inside it, ready to fill in.\n\n<Callout type=\"tip\">\n The menu only offers components that are valid on their own. Ones that must live inside a parent, like `<Step>` inside `<Steps>`, stay in the `<` autocomplete instead, so you can reach them while filling out a list.\n</Callout>\n\n## Live preview\n\nThe editor has three modes: **Code**, **Split**, and **Preview**. Split shows your source and the rendered result side by side.\n\nThe preview renders your document the way your published site will:\n\n- **Components** render as themselves, not as raw tags\n- **Images** resolve from your repository, so `` shows the file from your `public` directory. Relative paths like `./diagram.png` resolve against the document's own directory, and images you've uploaded but not yet published appear too\n- **Mermaid diagrams** render as diagrams rather than code blocks\n\nIf a component is missing or a diagram can't be parsed, the preview says so in place rather than failing, so you can see what went wrong and keep editing.\n\n## Media directories\n\nThe **Media** tab browses directories, not just a flat list. Click a directory to open it, and use the breadcrumb to go back.\n\n- **New directory** creates a directory in the directory you're currently viewing\n- **Uploads** go into the directory you're viewing, not always the top level\n- **Copy path** gives you the path to paste into MDX, relative to your site root\n\n<Callout type=\"note\">\n Git can't store an empty directory, so a new directory holds a hidden placeholder file until you add something to it. You'll never see the placeholder in the Media tab.\n</Callout>\n\n## Version history\n\nFor any file, you can view its commit history to see how it has changed over time. This lets you:\n\n- See when changes were made and what the commit messages were\n- View the file's content at any previous commit\n- Compare past versions to understand what changed\n\n## Binary files\n\nYou can upload images and other binary assets (PNG, JPG, SVG, WOFF2, etc.) directly through the file explorer. These are stored temporarily in Doccupine's storage and committed to your repository when you publish.\n\n## Read-only mode\n\nTeam members with the **Viewer** or **Billing** role can browse files but cannot make edits. The editor will display content in read-only mode for these users.";
|
|
@@ -27,6 +27,8 @@ In the Files tab, you can:
|
|
|
27
27
|
- **Rename** and **delete** existing files
|
|
28
28
|
- **Upload** binary assets like images, favicons, and font files
|
|
29
29
|
|
|
30
|
+
On a project with [languages](/platform/languages) or [versions](/platform/versions), a selector above the tree scopes it to one language and version at a time; the other variant folders stay out of view until you switch.
|
|
31
|
+
|
|
30
32
|
Click any file to open it in the editor panel.
|
|
31
33
|
|
|
32
34
|
## Editing files
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const platformIndexMdxTemplate = "---\ntitle: \"Platform Overview\"\ndescription: \"Learn how to use the Doccupine platform to create, customize, and deploy documentation websites.\"\ndate: \"2026-02-19\"\ncategory: \"Getting Started\"\ncategoryOrder: 0\ncategoryIcon: \"rocket\"\norder: 0\nsection: \"Platform\"\n---\n# Platform Overview\n\nThe Doccupine platform gives you everything you need to create, customize, and host beautiful documentation websites - all from your browser. No local setup, no CI pipelines, no infrastructure to manage.\n\n## What you get\n\n- **Browser-based editor** for writing and managing your documentation files\n- **One-click publishing** that commits to GitHub and deploys automatically\n- **Agent Sync** to link pages to the code they document and rewrite them when it changes\n- **Visual configuration** for themes, navigation, fonts, links, and more\n- **Custom domains** with automatic HTTPS\n- **AI assistant** built into every deployed site\n- **Team collaboration** with role-based access control\n\n## How it works\n\nDoccupine connects two core pieces behind the scenes:\n\n1. **GitHub** stores your documentation source files in a Git repository\n2. **Doccupine** builds, hosts, and serves your site globally - plus provides a dashboard for editing, configuring, and managing your project\n\nYou write MDX files, configure your site through visual settings pages, and hit Publish. Doccupine handles the rest.\n\n## Getting started\n\n1. **Sign up** at Doccupine and start your free 30-day trial - no credit card required.\n2. **Create a project** from the dashboard. Choose between a managed repository or connecting your own GitHub account.\n3. **Edit your docs** using the built-in file explorer and editor.\n4. **Configure your site** through the settings pages - theme, navigation, fonts, and more.\n5. **Publish** your changes with a single click.\n\n<Callout type=\"success\">\n Your documentation site is live the moment you create a project. Doccupine deploys a starter site automatically so you can see results immediately.\n</Callout>\n\n## Dashboard\n\nAfter signing in, the dashboard shows all your projects. You'll see two sections:\n\n- **Your Projects** - documentation sites you own, plus a button to create new ones\n- **Shared Projects** - sites that other users have invited you to collaborate on\n\nClick any project card to open it and start working.\n\n<Columns cols={2}>\n <Card title=\"Sign Up\" icon=\"user-plus\" href=\"https://doccupine.com/sign-up\">\n Create your free account and start building documentation in minutes.\n </Card>\n <Card title=\"Sign In\" icon=\"log-in\" href=\"https://doccupine.com/sign-in\">\n Already have an account? Sign in to your dashboard.\n </Card>\n</Columns>";
|
|
1
|
+
export declare const platformIndexMdxTemplate = "---\ntitle: \"Platform Overview\"\ndescription: \"Learn how to use the Doccupine platform to create, customize, and deploy documentation websites.\"\ndate: \"2026-02-19\"\ncategory: \"Getting Started\"\ncategoryOrder: 0\ncategoryIcon: \"rocket\"\norder: 0\nsection: \"Platform\"\n---\n# Platform Overview\n\nThe Doccupine platform gives you everything you need to create, customize, and host beautiful documentation websites - all from your browser. No local setup, no CI pipelines, no infrastructure to manage.\n\n## What you get\n\n- **Browser-based editor** for writing and managing your documentation files\n- **One-click publishing** that commits to GitHub and deploys automatically\n- **Agent Sync** to link pages to the code they document and rewrite them when it changes\n- **Visual configuration** for themes, navigation, fonts, links, languages, versions, and more\n- **Custom domains** with automatic HTTPS\n- **AI assistant** built into every deployed site\n- **Team collaboration** with role-based access control\n\n## How it works\n\nDoccupine connects two core pieces behind the scenes:\n\n1. **GitHub** stores your documentation source files in a Git repository\n2. **Doccupine** builds, hosts, and serves your site globally - plus provides a dashboard for editing, configuring, and managing your project\n\nYou write MDX files, configure your site through visual settings pages, and hit Publish. Doccupine handles the rest.\n\n## Getting started\n\n1. **Sign up** at Doccupine and start your free 30-day trial - no credit card required.\n2. **Create a project** from the dashboard. Choose between a managed repository or connecting your own GitHub account.\n3. **Edit your docs** using the built-in file explorer and editor.\n4. **Configure your site** through the settings pages - theme, navigation, fonts, and more.\n5. **Publish** your changes with a single click.\n\n<Callout type=\"success\">\n Your documentation site is live the moment you create a project. Doccupine deploys a starter site automatically so you can see results immediately.\n</Callout>\n\n## Dashboard\n\nAfter signing in, the dashboard shows all your projects. You'll see two sections:\n\n- **Your Projects** - documentation sites you own, plus a button to create new ones\n- **Shared Projects** - sites that other users have invited you to collaborate on\n\nClick any project card to open it and start working.\n\n<Columns cols={2}>\n <Card title=\"Sign Up\" icon=\"user-plus\" href=\"https://doccupine.com/sign-up\">\n Create your free account and start building documentation in minutes.\n </Card>\n <Card title=\"Sign In\" icon=\"log-in\" href=\"https://doccupine.com/sign-in\">\n Already have an account? Sign in to your dashboard.\n </Card>\n</Columns>";
|
|
@@ -17,7 +17,7 @@ The Doccupine platform gives you everything you need to create, customize, and h
|
|
|
17
17
|
- **Browser-based editor** for writing and managing your documentation files
|
|
18
18
|
- **One-click publishing** that commits to GitHub and deploys automatically
|
|
19
19
|
- **Agent Sync** to link pages to the code they document and rewrite them when it changes
|
|
20
|
-
- **Visual configuration** for themes, navigation, fonts, links, and more
|
|
20
|
+
- **Visual configuration** for themes, navigation, fonts, links, languages, versions, and more
|
|
21
21
|
- **Custom domains** with automatic HTTPS
|
|
22
22
|
- **AI assistant** built into every deployed site
|
|
23
23
|
- **Team collaboration** with role-based access control
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const platformLanguagesMdxTemplate = "---\ntitle: \"Languages\"\ndescription: \"Add translations to your documentation from the dashboard: declare languages, copy pages into a language, and translate them with AI.\"\ndate: \"2026-09-08\"\ncategory: \"Configuration\"\ncategoryOrder: 2\norder: 6\nsection: \"Platform\"\n---\n# Languages\n\nThe **Languages** page under a project's settings manages the project's `languages.json` and the language folders in its repository. It is the dashboard counterpart of the CLI's [Languages](/languages) feature, and it stages everything as pending changes for you to review and [publish](/platform/publishing).\n\n## Enabling languages\n\nTurn on **Enable languages** and name the default language (its code, such as `en`, and its label). Saving writes a `languages.json` with that single entry. Nothing moves: the default language's pages stay at the root of the docs folder.\n\n## Adding a language\n\nClick **Add language**, enter the language code and label, and choose how to start:\n\n- **Empty**: only a starter `index.mdx` is created in the new language folder.\n- **Start from a copy of the default language**: every page of the default language is copied into the language folder as a starting point for translation.\n\nBoth options stage the new files and the updated `languages.json`; they reach the live site when you publish.\n\n## Translating pages\n\nWith at least two languages configured, the file editor's action bar offers **Translate to** on every page of the default language. It translates the page with the project's AI configuration, keeps code blocks, components, links, and frontmatter keys intact, and stages the result in the target language folder. When a translation already exists you are asked before it is replaced.\n\nThe Languages page also offers **Translate missing pages** for each language, which translates the default-language pages that have no counterpart yet, up to 25 pages per run, with progress and a cancel button. Translation is billed like every other AI feature of the project.\n\n## Editing translations\n\nThe file explorer shows a language selector when languages are configured, so you work inside one language at a time. Translated pages are ordinary MDX files: the [file editor](/platform/file-editor), preview, and version history work the same way.\n\n## Site text\n\nEach language card has a **Site text** button that opens the site's own labels for that language: the search box and its messages, the navigation and page actions, the AI assistant's greeting and prompts, the footer, and the language and version switchers. Every label shows its English default; type a translation to override it and clear the field to fall back. The dialog groups the labels by area, and a label that carries a placeholder such as `{count}` reminds you to keep it. The button shows how many labels the language overrides.\n\nApplying the dialog updates the language's `strings` object in `languages.json`; save the page to stage it. See the CLI's [Languages](/languages#interface-strings) page for the full list of keys.\n\n## Removing a language\n\nRemoving a language from the list asks whether its pages should be deleted too. The removal, the deleted pages, and the updated `languages.json` are staged together and appear in the Publish dialog.\n\n## Rules\n\nA language code must be a lowercase URL segment and must not collide with a section slug, a version slug, or a reserved route segment. The page refuses a collision when you save, and the Publish dialog refuses a change set that would stop the site build.\n";
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export const platformLanguagesMdxTemplate = `---
|
|
2
|
+
title: "Languages"
|
|
3
|
+
description: "Add translations to your documentation from the dashboard: declare languages, copy pages into a language, and translate them with AI."
|
|
4
|
+
date: "2026-09-08"
|
|
5
|
+
category: "Configuration"
|
|
6
|
+
categoryOrder: 2
|
|
7
|
+
order: 6
|
|
8
|
+
section: "Platform"
|
|
9
|
+
---
|
|
10
|
+
# Languages
|
|
11
|
+
|
|
12
|
+
The **Languages** page under a project's settings manages the project's \`languages.json\` and the language folders in its repository. It is the dashboard counterpart of the CLI's [Languages](/languages) feature, and it stages everything as pending changes for you to review and [publish](/platform/publishing).
|
|
13
|
+
|
|
14
|
+
## Enabling languages
|
|
15
|
+
|
|
16
|
+
Turn on **Enable languages** and name the default language (its code, such as \`en\`, and its label). Saving writes a \`languages.json\` with that single entry. Nothing moves: the default language's pages stay at the root of the docs folder.
|
|
17
|
+
|
|
18
|
+
## Adding a language
|
|
19
|
+
|
|
20
|
+
Click **Add language**, enter the language code and label, and choose how to start:
|
|
21
|
+
|
|
22
|
+
- **Empty**: only a starter \`index.mdx\` is created in the new language folder.
|
|
23
|
+
- **Start from a copy of the default language**: every page of the default language is copied into the language folder as a starting point for translation.
|
|
24
|
+
|
|
25
|
+
Both options stage the new files and the updated \`languages.json\`; they reach the live site when you publish.
|
|
26
|
+
|
|
27
|
+
## Translating pages
|
|
28
|
+
|
|
29
|
+
With at least two languages configured, the file editor's action bar offers **Translate to** on every page of the default language. It translates the page with the project's AI configuration, keeps code blocks, components, links, and frontmatter keys intact, and stages the result in the target language folder. When a translation already exists you are asked before it is replaced.
|
|
30
|
+
|
|
31
|
+
The Languages page also offers **Translate missing pages** for each language, which translates the default-language pages that have no counterpart yet, up to 25 pages per run, with progress and a cancel button. Translation is billed like every other AI feature of the project.
|
|
32
|
+
|
|
33
|
+
## Editing translations
|
|
34
|
+
|
|
35
|
+
The file explorer shows a language selector when languages are configured, so you work inside one language at a time. Translated pages are ordinary MDX files: the [file editor](/platform/file-editor), preview, and version history work the same way.
|
|
36
|
+
|
|
37
|
+
## Site text
|
|
38
|
+
|
|
39
|
+
Each language card has a **Site text** button that opens the site's own labels for that language: the search box and its messages, the navigation and page actions, the AI assistant's greeting and prompts, the footer, and the language and version switchers. Every label shows its English default; type a translation to override it and clear the field to fall back. The dialog groups the labels by area, and a label that carries a placeholder such as \`{count}\` reminds you to keep it. The button shows how many labels the language overrides.
|
|
40
|
+
|
|
41
|
+
Applying the dialog updates the language's \`strings\` object in \`languages.json\`; save the page to stage it. See the CLI's [Languages](/languages#interface-strings) page for the full list of keys.
|
|
42
|
+
|
|
43
|
+
## Removing a language
|
|
44
|
+
|
|
45
|
+
Removing a language from the list asks whether its pages should be deleted too. The removal, the deleted pages, and the updated \`languages.json\` are staged together and appear in the Publish dialog.
|
|
46
|
+
|
|
47
|
+
## Rules
|
|
48
|
+
|
|
49
|
+
A language code must be a lowercase URL segment and must not collide with a section slug, a version slug, or a reserved route segment. The page refuses a collision when you save, and the Publish dialog refuses a change set that would stop the site build.
|
|
50
|
+
`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const platformMcpMdxTemplate = "---\ntitle: \"MCP\"\ndescription: \"Connect external AI apps like Claude and Cursor to your documentation with a Model Context Protocol server, and protect it with an API key.\"\ndate: \"2026-07-12\"\nupdated: \"2026-07-30\"\ncategory: \"AI & Integrations\"\ncategoryOrder: 3\norder: 1\nsection: \"Platform\"\n---\n# MCP\n\nThe **MCP** settings page lets external AI applications connect to your documentation through a hosted Model Context Protocol (MCP) server. Every Doccupine site exposes an MCP endpoint at `/api/mcp` that AI tools can query to search and read your content.\n\n## Connect your site with AI apps\n\nThe **Connect your site with AI apps** card gives you a ready-to-paste MCP configuration for popular AI tools. Pick a tab, copy the snippet, and add it to that tool's MCP config:\n\n- **Claude** - add the configuration to Claude Desktop's `claude_desktop_config.json`, or add the server URL as a connector from Claude's settings.\n- **Cursor** - add the configuration to Cursor's `~/.cursor/mcp.json`, or connect it from Cursor's MCP settings.\n- **Others** - a generic `mcpServers` block for any MCP-compatible application.\n\nEvery snippet points to your site's own MCP endpoint, for example:\n\n```json\n{\n \"mcpServers\": {\n \"Your Project\": { \"url\": \"https://your-site.com/api/mcp\" }\n }\n}\n```\n\n<Callout type=\"note\">\n The connection snippet appears once your site has been deployed. If you haven't published yet, deploy your site first to get its MCP server URL.\n</Callout>\n\n## MCP server authentication\n\nOn a public site, the MCP endpoint is publicly accessible by default. When the site is [password protected](/platform/authentication), MCP requires the same session unless you configure its dedicated API key:\n\n1. Enable **Require API key for MCP access**.\n2. Enter an API key.\n3. Save.\n\nOnce enabled, clients must include the key as a Bearer token in the `Authorization` header of every request to `/api/mcp`.\n\n<Callout type=\"warning\">\n The API key is stored as an environment variable (`DOCS_API_KEY`) on your deployment, not in a JSON file. After saving, a redeploy is triggered automatically to apply the change.\n</Callout>\n\n<Callout type=\"note\">\n For the full reference on how the MCP server works - available tools, rate limits, and endpoint details - see the [Model Context Protocol documentation](/model-context-protocol).\n</Callout>";
|
|
1
|
+
export declare const platformMcpMdxTemplate = "---\ntitle: \"MCP\"\ndescription: \"Connect external AI apps like Claude and Cursor to your documentation with a Model Context Protocol server, and protect it with an API key.\"\ndate: \"2026-07-12\"\nupdated: \"2026-07-30\"\ncategory: \"AI & Integrations\"\ncategoryOrder: 3\norder: 1\nsection: \"Platform\"\n---\n# MCP\n\nThe **MCP** settings page lets external AI applications connect to your documentation through a hosted Model Context Protocol (MCP) server. Every Doccupine site exposes an MCP endpoint at `/api/mcp` that AI tools can query to search and read your content.\n\nOn a site with [languages](/platform/languages) or [versions](/platform/versions), the server's `search_docs` and `list_docs` tools accept `language` and `version` parameters and answer from the default language and version when they are left out.\n\n## Connect your site with AI apps\n\nThe **Connect your site with AI apps** card gives you a ready-to-paste MCP configuration for popular AI tools. Pick a tab, copy the snippet, and add it to that tool's MCP config:\n\n- **Claude** - add the configuration to Claude Desktop's `claude_desktop_config.json`, or add the server URL as a connector from Claude's settings.\n- **Cursor** - add the configuration to Cursor's `~/.cursor/mcp.json`, or connect it from Cursor's MCP settings.\n- **Others** - a generic `mcpServers` block for any MCP-compatible application.\n\nEvery snippet points to your site's own MCP endpoint, for example:\n\n```json\n{\n \"mcpServers\": {\n \"Your Project\": { \"url\": \"https://your-site.com/api/mcp\" }\n }\n}\n```\n\n<Callout type=\"note\">\n The connection snippet appears once your site has been deployed. If you haven't published yet, deploy your site first to get its MCP server URL.\n</Callout>\n\n## MCP server authentication\n\nOn a public site, the MCP endpoint is publicly accessible by default. When the site is [password protected](/platform/authentication), MCP requires the same session unless you configure its dedicated API key:\n\n1. Enable **Require API key for MCP access**.\n2. Enter an API key.\n3. Save.\n\nOnce enabled, clients must include the key as a Bearer token in the `Authorization` header of every request to `/api/mcp`.\n\n<Callout type=\"warning\">\n The API key is stored as an environment variable (`DOCS_API_KEY`) on your deployment, not in a JSON file. After saving, a redeploy is triggered automatically to apply the change.\n</Callout>\n\n<Callout type=\"note\">\n For the full reference on how the MCP server works - available tools, rate limits, and endpoint details - see the [Model Context Protocol documentation](/model-context-protocol).\n</Callout>";
|
|
@@ -12,6 +12,8 @@ section: "Platform"
|
|
|
12
12
|
|
|
13
13
|
The **MCP** settings page lets external AI applications connect to your documentation through a hosted Model Context Protocol (MCP) server. Every Doccupine site exposes an MCP endpoint at \`/api/mcp\` that AI tools can query to search and read your content.
|
|
14
14
|
|
|
15
|
+
On a site with [languages](/platform/languages) or [versions](/platform/versions), the server's \`search_docs\` and \`list_docs\` tools accept \`language\` and \`version\` parameters and answer from the default language and version when they are left out.
|
|
16
|
+
|
|
15
17
|
## Connect your site with AI apps
|
|
16
18
|
|
|
17
19
|
The **Connect your site with AI apps** card gives you a ready-to-paste MCP configuration for popular AI tools. Pick a tab, copy the snippet, and add it to that tool's MCP config:
|