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 enables webMcp by default, so agents can use WebMCP to search, read, and navigate Rspress documentation. For more details, see ChatGPT - Site tools.

    For your Agent
    Try WebMCP with your agent

    Send this prompt to Codex or another agent to see which WebMCP tools the page offers.

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

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

    Built-in tools

    ToolPurpose
    get_site_infoSite metadata, locales, versions, navigation, and the active sidebar.
    list_pagesFilter and paginate page metadata, defaulting to the active language and version. Works independently of search.
    get_pageRead metadata, frontmatter, TOC, and Markdown for a known route without navigating (enabled with SSG-MD).
    get_current_pageRead metadata, frontmatter, TOC, and Markdown for the current page (enabled with SSG-MD).
    search_docsSearch the local documentation index for the active language and version (default theme local search only).
    navigateNavigate to a known internal route, then return committed page metadata, section routes, and previous/next pages.
    View tool input schemas
    toolInputSchemas.json
    {
      "get_current_page": {
        "type": "object",
        "properties": {},
        "required": [],
        "additionalProperties": false
      },
      "get_page": {
        "type": "object",
        "properties": {
          "routePath": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": ["routePath"],
        "additionalProperties": false
      },
      "get_site_info": {
        "type": "object",
        "properties": {},
        "required": [],
        "additionalProperties": false
      },
      "list_pages": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string",
            "minLength": 1
          },
          "lang": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "offset": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [],
        "additionalProperties": false
      },
      "navigate": {
        "type": "object",
        "properties": {
          "routePath": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": ["routePath"],
        "additionalProperties": false
      },
      "search_docs": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string",
            "minLength": 1
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 20
          }
        },
        "required": ["query"],
        "additionalProperties": false
      }
    }
    

    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.