Skip to main content
CodivDocs

Contextual menu

14 built-in options + tenant custom items, all in the Copy Page dropdown at the top of every page.

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)

ItemWhat it does
Copy page as MarkdownRaw MDX source to clipboard. Use when you want to quote the page verbatim.
Copy as Markdown for LLMsSource + a context header that points at the full component spec so any LLM can write valid CodivDocs MDX.
View page as raw MarkdownOpens the .md URL in a new tab. Crawler-friendly.
Copy page URLCanonical 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.

OptionTarget
Open in ChatGPTchat.openai.com/?q=...
Open in Claudeclaude.ai/new?q=...
Open in Perplexityperplexity.ai/?q=...
Open in Google AI Studioaistudio.google.com/app/prompts/new_chat?prompt=...
Open in Grokgrok.com/?q=...
Connect to Windsurfwindsurf://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:

OptionWhat it does
Copy MCP server URLhttps://mcp.codivdocs.com to clipboard
Copy MCP install commandnpx codivdocs-mcp install --client cursor to clipboard
Install MCP in Cursorcursor://... deep link — opens Cursor with the server pre-configured
Install MCP in VS Codevscode://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:

VariableResolves to
$pageURL-encoded full page URL (e.g. https%3A%2F%2Fdocs.acme.com%2Fapi%2Fauth)
$pathURL-encoded page path (e.g. %2Fapi%2Fauth)
$titleURL-encoded page title (e.g. Authentication)
$mdxURL-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 valueBuilt-in items hidden if absent
contentCopy MD, Copy for LLMs, View raw, Copy URL
ai-platformsChatGPT, Claude, Perplexity, Google AI Studio, Grok, Windsurf
mcpMCP server URL, install command, Cursor / VS Code links
customTenant-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

PhaseAddition
3.3Real MCP server backing the install/cursor/vscode options
3.4codivdocs migrate --from mintlify adds a "Migrate Mintlify config" option for tenants importing
3.5.cursorrules / CLAUDE.md auto-generation links
9Per-page analytics for which menu items get clicked (content gap signal)

Last updated April 12, 2026