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:
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
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.