Page Actions
Page actions are buttons rendered above or below the page title. They let users interact with page content — copy it as Markdown, or open it in an LLM provider like ChatGPT or Claude.
Quick Start
pageActions: {
copyMarkdown: { enabled: true },
openDocs: { enabled: true },
connectMcp: true,
installSkills: true,
}This adds the content actions plus Connect MCP and Install skills setup controls.
Configuration Reference
All options go inside the pageActions object in docs.config.ts:
export default defineDocs({
pageActions: {
// ... options
},
});pageActions.position
Where to render the page action buttons relative to the page title.
| Type | Default |
|---|---|
"above-title" | "below-title" | "below-title" |
pageActions: {
position: "above-title",
}Reading time follows this slot
If reading time is active for the current page, the read-time label stays attached to the same
title-area slot. above-title places it directly under the action row. below-title keeps it
grouped in the below-title metadata area. This also applies when a page opts in with frontmatter
like readingTime: true or readingTime: 8.
pageActions.alignment
Control whether the action row is left- or right-aligned.
| Type | Default |
|---|---|
"left" | "right" | "left" |
pageActions: {
alignment: "right",
}Agent setup actions
pageActions.connectMcp
Show one-click, copyable MCP setup for the raw endpoint, Claude Code, Cursor, VS Code, and Codex. Relative endpoints are resolved against the deployed docs origin.
pageActions: {
connectMcp: {
enabled: true,
endpoint: "/mcp",
providers: ["copy", "claude-code", "cursor", "vscode", "codex"],
label: "Connect docs MCP",
},
}pageActions.installSkills
Read the published /.well-known/agent-skills/index.json catalog and offer a copyable Skills CLI
command. You can override the index or command when the docs are hosted behind a proxy.
pageActions: {
installSkills: {
enabled: true,
index: "/.well-known/agent-skills/index.json",
command: "npx skills add https://docs.example.com",
},
}Both actions are opt-in. Keep mcp and agent.skills enabled so the copied setup resolves to live
surfaces after deployment.
Copy Markdown
pageActions.copyMarkdown
Whether to show the "Copy Markdown" button. Copies the current page's content as Markdown to the clipboard.
| Type | Default |
|---|---|
boolean | { enabled: boolean } | false |
pageActions: {
copyMarkdown: true,
// or
copyMarkdown: { enabled: true },
}The object form also lets you customize the button text.
pageActions.copyMarkdown.label
Button label shown before the page has been copied.
| Type | Default |
|---|---|
string | "Copy page" |
pageActions.copyMarkdown.copiedLabel
Button label shown after a successful copy.
| Type | Default |
|---|---|
string | "Copied!" |
pageActions.copyMarkdown.format
Content format that the button copies to the clipboard.
| Type | Default |
|---|---|
"markdown" | "text" | "markdown" |
"markdown"— fetches the page's public.mdroute and copies its markdown source."text"— reads the visible text content of the rendered page without a network request.
pageActions: {
copyMarkdown: { enabled: true, format: "text" },
}pageActions: {
copyMarkdown: { enabled: true, label: "Copy docs", copiedLabel: "Copied docs" },
}pageActions.copyMarkdown.includeTitle
Whether to prepend the current page title to the copied content.
| Type | Default |
|---|---|
boolean | false |
When enabled:
- In
"markdown"format a# Titleheading is added before the page content. - In
"text"format the plain title is prepended as a first line.
The title is not added if the content already begins with it.
pageActions: {
copyMarkdown: { enabled: true, includeTitle: true },
}Open in LLM
The Open in... dropdown lets users send the current page to an LLM or tool. Built-in providers can target the public .md route, the rendered page, the source .mdx URL, or the GitHub edit URL.
pageActions.openDocs
Enable the "Open in..." dropdown. Can be a boolean or an object with additional configuration.
| Type | Default |
|---|---|
boolean | OpenDocsConfig | false |
pageActions: {
openDocs: true,
}When set to true, the built-in provider list is used: ChatGPT and Claude.
pageActions.openDocs.enabled
Whether to show the "Open in..." dropdown.
| Type | Default |
|---|---|
boolean | false |
pageActions.openDocs.providers
Custom list of LLM / tool providers to show in the dropdown. Use provider strings for the built-in presets, or objects when you need icons, labels, per-provider prompts, or a custom URL template.
| Type | Default |
|---|---|
OpenDocsProvider[] | Built-in defaults |
pageActions: {
openDocs: {
enabled: true,
target: "markdown",
providers: ["chatgpt", "claude", "cursor"],
},
}Built-in provider ids are "chatgpt", "claude", "cursor", "gemini", "copilot", "perplexity", and "github".
Each of these built-in presets automatically renders a monochrome provider icon in the dropdown — no icon field is required. You only need to supply an icon when using a custom urlTemplate provider or when you want to override the default mark for a named preset.
pageActions.openDocs.target
Controls which URL is inserted into {url} for the built-in provider prompt.
| Value | Used for |
|---|---|
"markdown" | Public .md route for the page. This is the default. |
"page" | Rendered docs page URL. |
"source" | Source-style .mdx URL. |
"github" | GitHub edit URL, when the top-level github config is present. |
pageActions.openDocs.prompt
Prompt text sent to built-in providers. It defaults to:
"Read this documentation: {url}"You can make the handoff more specific:
pageActions: {
openDocs: {
enabled: true,
target: "markdown",
prompt: "Use this documentation while editing the codebase: {url}",
providers: ["chatgpt", "claude", "perplexity", { id: "cursor", mode: "app" }],
},
}Agent-ready docs links
target: "markdown" sends providers to the public .md route for the current page. That route can
return a sibling agent.md when the page has one. In Next.js, HTTP clients can also request the
normal page URL with Accept: text/markdown, or send Signature-Agent when they identify
themselves as an agent. See Agent Primitive.
Provider Objects
Provider objects can customize a preset while keeping its built-in URL:
import { SiClaude, SiOpenai } from "react-icons/si";
pageActions: {
openDocs: {
enabled: true,
target: "markdown",
providers: [
{ id: "chatgpt", name: "ChatGPT", icon: <SiOpenai className="size-4" /> },
{ id: "claude", name: "Claude", icon: <SiClaude className="size-4" /> },
{
id: "cursor",
mode: "app",
prompt: "Open this docs page in Cursor context: {url}",
},
],
},
}Custom URL Templates
Use urlTemplate when you need a provider that is not built in. This keeps the previous API working.
pageActions: {
openDocs: {
enabled: true,
providers: [
{
name: "Internal AI",
urlTemplate: "https://internal.example/new?prompt={prompt}",
prompt: "Read this documentation: {markdownUrl}",
},
],
},
}The urlTemplate string supports these placeholders:
| Placeholder | Replaced with |
|---|---|
{prompt} | The resolved prompt text |
{url} | The selected target URL, controlled by target |
{pageUrl} | The rendered docs page URL |
{markdownUrl} | The public .md route for the page |
{sourceUrl} | The source-style .mdx URL for the page |
{mdxUrl} | Alias for {sourceUrl} |
{githubUrl} | GitHub edit URL for the current page (same as "Edit on GitHub"). Requires github in config. Use urlTemplate: "{githubUrl}" so "Open in GitHub" opens the file on GitHub. |
Legacy URL templates still work
Existing providers that use name and urlTemplate are still supported. For custom URL
templates, {url} keeps the previous page-URL behavior unless you explicitly set target.
New configs should prefer target: "markdown" with provider strings.
Full Example
export default defineDocs({
pageActions: {
position: "below-title",
copyMarkdown: { enabled: true },
openDocs: {
enabled: true,
target: "markdown",
prompt: "Read this documentation: {url}",
providers: ["chatgpt", "claude", "cursor"],
},
},
});Add copy, LLM, MCP connection, and Agent Skills actions to docs pages
How is this guide?