Anatomy
Every docs page has a Copy page split button in the top-end corner of the header. The primary button copies the raw Markdown source. The chevron opens a dropdown organized into four sections:
Content
Copy MD, copy for LLMs, view raw, copy URL
AI platforms
ChatGPT, Claude, Perplexity, Google AI Studio, Grok, Windsurf
MCP server
Server URL, install command, Cursor / VS Code deep links
Custom
Tenant-defined items from codiv.config.json
Built-in items (14 total)
Content (4)
| Item | What it does |
| Copy page as Markdown | Raw MDX source to clipboard. Use when you want to quote the page verbatim. |
| Copy as Markdown for LLMs | Source + a context header that points at the full component spec so any LLM can write valid CodivDocs MDX. |
| View page as raw Markdown | Opens the .md URL in a new tab. Crawler-friendly. |
| Copy page URL | Canonical https URL to clipboard. |
AI platforms (6)
Each option deep-links to a new chat with the page URL + source pre-filled as the first message. The reader picks their preferred LLM and starts from a context-aware conversation.
| Option | Target |
| Open in ChatGPT | chat.openai.com/?q=... |
| Open in Claude | claude.ai/new?q=... |
| Open in Perplexity | perplexity.ai/?q=... |
| Open in Google AI Studio | aistudio.google.com/app/prompts/new_chat?prompt=... |
| Open in Grok | grok.com/?q=... |
| Connect to Windsurf | windsurf://chat?prompt=... (Codeium IDE deep link) |
ChatGPT, Claude, and Perplexity all support browse — they can fetch the full component spec URL and use it as context, even from these "small" deep links. The reader doesn't need to paste anything else.
MCP server (4)
The Model Context Protocol server (Phase 3.3) lets LLMs query the component library and search docs interactively, instead of relying on a paste. These options bootstrap the connection:
| Option | What it does |
| Copy MCP server URL | https://mcp.codivdocs.com to clipboard |
| Copy MCP install command | npx codivdocs-mcp install --client cursor to clipboard |
| Install MCP in Cursor | cursor://... deep link — opens Cursor with the server pre-configured |
| Install MCP in VS Code | vscode://mcp/install?... deep link via the Claude Code extension |
The MCP server itself ships in Phase 3.3 as a separate npm package. Until then these options copy the install command but the server URL responds with a placeholder. Tenants who want to ship before MCP launches can disable the MCP section via contextual.enabled (see below).
Custom options
Add your own menu items by setting contextual.options in codiv.config.json. Each option appears in a "Custom" section below the built-ins.
{
"contextual": {
"options": [
{
"title": "File a bug report",
"description": "GitHub issues for the docs team",
"icon": "bug",
"href": "https://github.com/acme/docs/issues/new?title=Bug+on+$path"
},
{
"title": "Open in Linear",
"description": "Create a Linear ticket pre-filled with this page URL",
"icon": "external-link",
"href": "https://linear.app/acme/team/docs/new?title=Improve%20$title&description=$page"
}
]
}
}Template variables
The href field supports four template variables resolved at click time:
| Variable | Resolves to |
$page | URL-encoded full page URL (e.g. https%3A%2F%2Fdocs.acme.com%2Fapi%2Fauth) |
$path | URL-encoded page path (e.g. %2Fapi%2Fauth) |
$title | URL-encoded page title (e.g. Authentication) |
$mdx | URL-encoded MDX source (use sparingly — long pages produce massive URLs) |
$mdx can produce URLs in the tens of kilobytes for long pages. Some platforms (e.g. older Slack share targets) reject URLs over a few KB. Test your custom option on a representative page before shipping.
Disable built-in sections
If a section doesn't fit your tenant's workflow, hide it via contextual.enabled:
{
"contextual": {
"enabled": ["content", "ai-platforms", "custom"]
}
}This config shows Content, AI platforms, and Custom — but hides MCP server because the tenant isn't using one yet.
| Section value | Built-in items hidden if absent |
content | Copy MD, Copy for LLMs, View raw, Copy URL |
ai-platforms | ChatGPT, Claude, Perplexity, Google AI Studio, Grok, Windsurf |
mcp | MCP server URL, install command, Cursor / VS Code links |
custom | Tenant-defined entries from contextual.options |
Omit the enabled key entirely to show all sections (the default).
Display position
The menu defaults to the page header (top-end corner of the h1 row). The Phase 3 plan includes an alternative display: "toc" mode that moves the menu into the right TOC sidebar — useful for very narrow page layouts where the header is crowded. That mode is queued for a follow-up commit.
{
"contextual": {
"display": "header"
}
}Phase 1 → Phase 3 evolution
The Copy Page dropdown started in Phase 1 with five options (Copy MD, Copy for LLMs, Copy URL, ChatGPT, Claude). Phase 3.2 expanded it to 14 built-ins + custom support. The data contract stayed the same — source, url, title, description props on <CopyPageMenu> — so the upgrade was additive.
What's coming
| Phase | Addition |
| 3.3 | Real MCP server backing the install/cursor/vscode options |
| 3.4 | codivdocs migrate --from mintlify adds a "Migrate Mintlify config" option for tenants importing |
| 3.5 | .cursorrules / CLAUDE.md auto-generation links |
| 9 | Per-page analytics for which menu items get clicked (content gap signal) |