Skip to content
Mintlify
Mintlify
Optimize

Contextual menu

Add a contextual menu to your docs with one-click AI integrations for ChatGPT, Claude, Perplexity, Google AI Studio, Devin, Devin Desktop, and MCP tools.

The contextual menu provides quick access to AI-optimized content and direct integrations with popular AI tools. When users click the contextual menu on any page, they can copy content as context for AI tools or open it in an AI conversation. Supported tools include ChatGPT, Claude, Perplexity, Google AI Studio, Grok, Devin, Devin Desktop, and any custom tool you configure.

Pair the contextual menu with your hosted skill.md file and MCP server. This lets users install your product’s full capabilities into their AI tools, not just the page they are reading.

The contextual menu includes several pre-built options that you can enable by adding their identifier to your configuration.

OptionIdentifierDescription
Copy pagecopyCopies the current page as Markdown for pasting as context into AI tools
View as MarkdownviewOpens the current page as Markdown
Ask assistantassistantOpens the assistant with the current page as context
Download PDFdownload-pdfDownloads the current page as a PDF. Available on Enterprise plans.
Open in ChatGPTchatgptCreates a ChatGPT conversation with the current page as context
Open in ClaudeclaudeCreates a Claude conversation with the current page as context
Open in PerplexityperplexityCreates a Perplexity conversation with the current page as context
Open in GrokgrokCreates a Grok conversation with the current page as context
Open in Google AI StudioaistudioCreates a Google AI Studio conversation with the current page as context
Open in DevindevinCreates a Devin session with the current page as context
Open in Devin Desktopdevin-desktopOpens Devin Desktop with the current page as context. Requires installing Devin Desktop.
Copy MCP server URLmcpCopies your MCP server URL to the clipboard
Copy MCP install commandadd-mcpCopies the npx add-mcp command to install the MCP server
Connect to CursorcursorInstalls your hosted MCP server in Cursor
Connect to VS CodevscodeInstalls your hosted MCP server in VS Code
Connect to Devindevin-mcpInstalls your hosted MCP server in Devin
Download API specdownload-specDownloads your deployment’s OpenAPI spec. If there are multiple specs, downloads them as a zip archive. Only appears on API reference pages.
Custom optionsObjectAdd custom options to the contextual menu
The expanded contextual menu showing the Copy page, View as Markdown, Open in ChatGPT, and Open in Claude menu items.

Enable the contextual menu

Add the contextual field to your docs.json file and specify which options you want to include. Options appear in the menu in the order you list them.

{
  "contextual": {
    "options": [
      "copy",
      "view",
      "assistant",
      "chatgpt",
      "claude",
      "perplexity",
      "grok",
      "aistudio",
      "devin",
      "devin-desktop",
      "mcp",
      "cursor",
      "vscode",
      "devin-mcp",
      "download-spec",
      "download-pdf"
    ]
  }
}

Display location

By default, the contextual menu appears in the page header. You can configure it to display in the table of contents sidebar instead using the display option.

{
  "contextual": {
    "options": ["copy", "view", "chatgpt", "claude"],
    "display": "toc"
  }
}
ValueDescription
headerDisplays options in the top-of-page context menu (default)
tocDisplays options in the table of contents sidebar

Add custom options

Create custom options in the contextual menu by adding an object to the options array. Each custom option requires these properties:

titlestringrequired

The title of the option.

descriptionstringrequired

The description of the option. Displayed beneath the title when the contextual menu expands.

You must include one of icon or src.

iconstring

The icon to display from an icon library.

Options:

srcstring

Path or URL to an image to use as the icon. Use src instead of icon when you want to use a custom image rather than an icon from a library.

Options:

  • Path to an image file in your project (for example, /images/my-icon.svg)
  • URL to an externally hosted image (for example, https://example.com/icon.png)
iconTypestring

The Font Awesome icon style. Only used with Font Awesome icons.

Options: regular, solid, light, thin, sharp-solid, duotone, brands.

hrefstring | objectrequired

The href of the option. Use a string for simple links or an object for dynamic links with query parameters.

Show href object
basestringrequired

The base URL for the option.

queryobject[]

An array of query parameter objects to append to the base URL.

Show query object
keystringrequired

The query parameter key.

valuestringrequired

The query parameter value. Mintlify replaces the following placeholders with the corresponding values:

  • Use $page to insert the current page content in Markdown.
  • Use $path to insert the current page path.
  • Use $mcp to insert the hosted MCP server URL.

Example custom option:

{
    "contextual": {
        "options": [
            "copy",
            "view",
            "chatgpt",
            "claude",
            "perplexity",
            {
                "title": "Request a feature",
                "description": "Join the discussion on GitHub to request a new feature",
                "icon": "plus",
                "href": "https://github.com/orgs/mintlify/discussions/categories/feature-requests"
            }
        ]
    }
}

Override on individual pages

To override the global contextual menu on a specific page, add the contextual field to the page’s frontmatter. Override the global contextual menu to surface page-specific actions like download-pdf on a terms of service page, or to hide the menu entirely on a landing page.

The page-level contextual object replaces the global one for that page. Omit the field to inherit docs.json, or set options: [] to disable the contextual menu on that page.

---
title: "Terms of Service"
contextual:
  options:
    - copy
    - download-pdf
  display: header
---

The same fields and validation rules apply as in docs.json, including custom options and the display setting. If a page override is invalid, Mintlify falls back to the global contextual configuration.

Custom option examples

Was this page helpful?Suggest editsRaise issue