WebMCP is an experimental browser API that lets a page offer tools to an agent running in the browser. Nimbus registers one tool, search_documentation, which searches the site’s search index. New sites have it already.
What new sites get
Nothing loads until an agent calls the tool, and browsers without the API skip it. Results follow the same rules as site search: drafts and hidden versions are left out, and so are noindex pages unless they set searchable: true.
Input
| Field | Type | Default | Constraints |
|---|---|---|---|
query |
string | — | Required, at most 500 characters |
limit |
integer | 5 |
1 to 20 |
version |
string | Every version except deprecated ones | Versioned sites only; any visible version, deprecated included |
Result: a list of matches, each with title, heading, an anchored url, and a plain-text excerpt of at most 1,000 characters.
Errors
| Code | Meaning |
|---|---|
invalid_input |
The query, limit or version is invalid. |
index_unavailable |
The search index couldn’t load: check that the build’s whole pagefind/ folder is deployed. |
search_failed |
The search or its code failed to load. Retry, or reload the page. |
Add it to an older site
Prerequisites
- Site search on the default provider (
searchnot set tofalseor a custom provider) - Pagefind 1.5.2 or later
Steps
Copy the component
Copy
src/components/WebMCP.astrofrom the starter into your project’ssrc/components/.Render it in the head
In
src/layouts/BaseLayout.astro, import the component and render it inside<head>:src/layouts/BaseLayout.astroastro --- import WebMCP from "@/components/WebMCP.astro"; --- <head> <!-- … --> <WebMCP /> </head>Build the site
npm run build
Verify
Open any built page’s HTML and find the tool’s settings in <head>:
<meta name="nimbus-webmcp" content="{"search":"pagefind",…}">If the tag is missing, the site’s search isn’t the default provider. The tool needs a production build: in astro dev it answers index_unavailable.
Next steps
- Remote MCP server: let agents outside the browser read your docs.
- Agent discovery: the files agents read to find your site.