Build your docs

Search, AI, and MCP

Use local search, optional AI chat and voice, external AI context actions, Markdown exports, llms.txt, and the MCP endpoint.

Updated May 11, 2026

The starter includes discovery features that work well for both humans and AI tools. Search works without setup. AI chat needs your own API key.

Click Search or press Command+K on macOS and Ctrl+K on Windows or Linux.

Search indexes:

  • Page titles.
  • Page descriptions.
  • Section headings.
  • Body text.
  • Generated Markdown text for each page.

Markdown exports

Every page can be viewed as Markdown through the page action menu.

The app also serves:

  • /llms.txt: A compact index of pages.
  • /llms-full.txt: A full Markdown export of all listed pages.
  • /.well-known/llms.txt: A compatibility route for tools that look under .well-known.
  • /.well-known/llms-full.txt: A compatibility route for the full export.

Optional AI chat

AI chat is available from the top-bar Chat button. It stays disabled until you add a server-side API key:

bash
NEXT_PUBLIC_SITE_URL=http://localhost:3000
OPENAI_API_KEY=your_api_key
OPENAI_MODEL=gpt-5.4-mini
DOCS_ASSISTANT_MAX_CONTEXT_CHARS=80000

Restart npm run dev after you change .env.local.

When enabled, the assistant receives the public docs corpus, ranked docs excerpts for citations, allowlisted source files, and optional web search. It does not read .env, node_modules, lockfiles, or files outside the allowlist in lib/codebase-context.ts.

Assistant answers include source links when local docs excerpts were used. Readers can mark answers as helpful or not helpful; the feedback emits the same optional docs:feedback browser event as page feedback.

Optional voice chat

Voice chat is disabled by default. Enable it only when you want a browser-based Talk to docs button:

bash
NEXT_PUBLIC_DOCS_VOICE_ASSISTANT=true
DOCS_VOICE_ASSISTANT_ENABLED=true
OPENAI_API_KEY=your_api_key
OPENAI_REALTIME_MODEL=gpt-realtime
OPENAI_REALTIME_VOICE=marin
OPENAI_REALTIME_VOICE_FEMALE=marin
OPENAI_REALTIME_VOICE_MALE=cedar
NEXT_PUBLIC_OPENAI_REALTIME_VOICE_FEMALE=marin
NEXT_PUBLIC_OPENAI_REALTIME_VOICE_MALE=cedar
OPENAI_REALTIME_TRANSCRIPTION_MODEL=gpt-4o-transcribe

The browser never receives OPENAI_API_KEY. The server route at /api/voice/session creates an ephemeral OpenAI Realtime client secret, then the browser connects to the Realtime API with WebRTC. The Audio panel lets readers choose the female or male preset before starting a session and shows the live transcript history while they talk.

External AI actions

The page action menu can copy the current page or open a prefilled prompt in tools such as ChatGPT, Claude, Perplexity, Grok, Google AI Studio, Devin, and Windsurf.

Choose which actions appear by editing siteConfig.contextual.options.

MCP endpoint

The starter includes a /mcp endpoint with tools, resources, and prompts for AI clients.

Copy the MCP URL or install command from the page action menu. The endpoint uses the same docs search and Markdown helpers as the rest of the app.

Included MCP tools
PropertyTypeDescription
search_docsRequiredtool

Search public docs content and return matching sections.

read_docRequiredtool

Read a page as Markdown by slug.

list_pagesOptionaltool

Return the page list with routes and descriptions.

get_page_markdownOptionaltool

Return the same per-page Markdown used by .md exports.

list_api_endpointsOptionaltool

List generated OpenAPI and AsyncAPI pages.

get_api_endpointOptionaltool

Read one generated API endpoint page.

Next step: AI resources

Was this page helpful?