For AI agents: the complete documentation index is available at https://rspress.rs/llms.txt, the full documentation bundle is available at https://rspress.rs/llms-full.txt, and this page is available as Markdown at https://rspress.rs/guide/basic/webmcp.md.
close
  • English
  • WebMCP

    Rspress can expose documentation tools to browser agents through the native WebMCP API. It is built into core and enabled by default. Enable Markdown generation to make all six tools available:

    rspress.config.ts
    import { defineConfig } from '@rspress/core';
    
    export default defineConfig({
      llms: true,
    });

    Set webMcp: false to disable the Rspress built-in tools. The useWebMcp hook remains available for registering custom tools.

    WebMCP is experimental and requires a browser with document.modelContext enabled in a secure context, such as HTTPS or localhost. Unsupported browsers continue to render the site normally.

    See AI config for the configuration reference.

    Built-in tools

    ToolPurpose
    rspress_get_site_infoSite metadata, locales, versions, navigation, and the active sidebar.
    rspress_list_pagesFilter and paginate page metadata, defaulting to the active language and version. Works independently of search.
    rspress_get_pageRead metadata, frontmatter, TOC, and SSG-MD Markdown for a known route without navigating (enabled with llms: true).
    rspress_get_current_pageRead metadata, frontmatter, TOC, and SSG-MD Markdown for the current page (enabled with llms: true).
    rspress_search_docsSearch the local documentation index for the active language and version (default theme local search only).
    rspress_navigateNavigate to a known internal route, then return committed page metadata, section routes, and previous/next pages.

    Route paths exclude the configured base and support query strings and hashes.

    rspress_list_pages accepts query, lang, version, limit (1–100, default 50), and offset (default 0). Its query matches page titles, descriptions, routes, and headings. rspress_search_docs accepts query and limit (1–20, default 10).

    Cross-origin agents

    Use webMcp.exposedTo to allow specific secure origins to discover tools.

    Custom tools

    Use useWebMcp from @rspress/core/runtime to register tools in your own components. Tools are automatically removed when the component unmounts.