Skip to content

AR-20261125-1: Add same-origin WebMCP documentation tools - #1092

Open
warp-agent-staging[bot] wants to merge 4 commits into
mainfrom
factory/ar-20261125-1-same-origin-webmcp
Open

warp-agent-staging[bot] wants to merge 4 commits into
mainfrom
factory/ar-20261125-1-same-origin-webmcp

Conversation

@warp-agent-staging

@warp-agent-staging warp-agent-staging Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

AR-20261125-1 adds same-origin, read-only WebMCP tools so browser agents can search documentation by title/keyword, browse its documentation tree, and read a page’s Markdown twin. Kapa and its semantic search tool are unchanged. Astro bundles the new script under /_astro/ and loads it on every page, including the homepage.

Related issues

Experiment AR-20261125-1, 2026-11-25 AEO/SEO autoresearch run. No tracked issue.

Changes

  • Lazy Pagefind search returns up to eight title, URL, and excerpt results. The installed Pagefind package’s generated browser API was inspected: search(query) yields results, each hydrated with data().
  • Markdown retrieval maps / to /index.md, normalizes a trailing slash, rejects traversal and absolute/external URLs before normalization, and disallows redirects and credentials.
  • Prefer document.modelContext, fall back to navigator.modelContext, and no-op without the API. Abort/unregister cleanup runs on pagehide; bfcache restores registration.
  • Ten Node tests cover schemas, annotations, mocked execution, result limits, failures, path rejection, dynamic navigation/section validation, fallback, and cleanup. CI runs them next to Kapa WebMCP tests.
  • list_docs_pages reads generated page titles/canonical paths from same-origin /llms-small.txt, rebases links onto the current origin, and optionally filters by a section validated against current entries. This avoids a hardcoded page/section list. The existing abridged corpus is approximately 3.6 MB and is fetched only when navigation is invoked, not on page load.

Metric prediction

The canonical docs.warp.dev ora score is predicted to rise from 71 (scan 647963, 2026-11-25, scoring v3 rev 22) to 75–76 (+4 to +5) on the first production scan after deployment, within one week after merge. Baseline required-tier WebMCP score: 0/8; each point contributes approximately 0.663 overall points. No Peec effect expected. This is a hypothesis, not a measured production improvement.

Validation

Security: Markdown paths are decoded and rejected for dot segments, nested/malformed escapes, encoded separators, backslashes, internal double slashes, controls, schemes, or hosts before URL construction or network access; navigation sections have matching no-fetch traversal regression coverage.

Passed: npm run typecheck (0 errors), test:webmcp-tools (10), test:kapa-webmcp (2), test:heading-vars (5), npm run build, test:heading-tocs (3,736 entries across 430 pages), test:homepage-json-ld, test:docs-markdown (12), test:agent-discovery (6), and test:markdown-negotiation (8). Internal link check: 5,313 links, zero broken. Changed-file style lint and git diff --check passed.

npm run lint and npm run fmt were attempted but unavailable: sh: 1: trunk: not found. Trunk is not vendored; no formatting/lint success is claimed.

Controlled regression gate — passed

Unchanged main (d3768f828ae0da90ec9eaf6ee1985f4bb681fa50) and candidate 31e5db8f2afc1f82c56994159469ffd77c3b5e12 were built with the same installed dependencies and Node version, then served from their generated .vercel/output/static trees using identical Python HTTP servers. Ora’s account-free --tunnel-cmd ephemeral mode used the same cloudflared HTTP/2 protocol, CLI version, and scoring revision. npm run preview was attempted but the Vercel adapter reports that preview is unsupported; these static controls do not exercise server-side Vercel functions. Real browser verification on Vercel separately covers all three new tool paths.

  • Main scan 649778: overall 48, WebMCP 0/8.
  • Initial two-tool candidate scan 649802: overall 52, WebMCP 7.2/8, coverage warning.
  • Final three-tool candidate scan 650289: overall 53, WebMCP 8/8, coverage pass. The third tool closes the previously missing documentation-tree navigation capability.
  • The only scored-check delta versus unchanged main is WebMCP; no check decreased. All tunnels were automatically terminated after scanning and no active tunnel processes remained. No production scan is implied by these ephemeral scores.

Commands (main uses port 4321):

npx -y @ora-ai/ax@0.5 audit http://127.0.0.1:4322 --tunnel-cmd '/tmp/docs-cloudflared tunnel --url http://127.0.0.1:4322 --protocol http2 --no-autoupdate' --json

Raw per-check score diff (every changed score):

{
  "mainScanId": 649778,
  "mainScore": 48,
  "candidateScanId": 650289,
  "candidateScore": 53,
  "scoredCheckDeltas": [
    {
      "id": "webmcp",
      "main": 0,
      "candidate": 8
    }
  ],
  "regressions": []
}

Canonical versus Vercel preview — not domain-equivalent

CI status is tracked by the checks on this PR; local production build, typecheck, and all ten tool tests passed on the navigation head. Vercel deployment completed successfully and is publicly readable, not authentication-protected.

Preview: https://docs-git-factory-ar-20261125-1-same-origin-webmcp-warpdotdev.vercel.app/

The refreshed Vercel preview scan 650346 reports WebMCP 8/8 and coverage pass, with all three tools detected. This matches the controlled candidate result. The earlier two-tool result was 7.2/8 with a coverage warning.

This unmatched-origin comparison is not the regression gate: overall Vercel preview score 56 vs canonical production 71, with lower-scoring checks retained below. Several explicitly compare the temporary preview domain’s web discovery, package identity, and Vercel X-Robots-Tag: noindex; others use different API/MCP/content samples. These results are not domain-equivalent and do not establish a production regression or improvement. The controlled same-environment comparison above is the regression gate; no unrelated fixes were made to chase preview-domain scores.

Browser functional smoke (real preview network, fake document.modelContext registration):

  • Homepage renders navigation and main content; title Warp overview | Warp.
  • All three tools register; search_docs_pages({query: 'skills'}) returns eight real Pagefind results, led by “Skills for agents.” All Pagefind entry/index/metadata/WASM/fragment requests returned 200.
  • Markdown retrieval for / returns /index.md (3,407 characters); /agents/capabilities/skills/ returns its .md twin (14,892 characters), both HTTP 200.
  • Navigation returns 427 current pages, including 70 agents pages and 110 factories pages. Every filtered URL has the requested first path segment; all returned URLs use the preview origin. Unknown sections and slash-containing section values are rejected. The catalog request returns 200.
  • Legitimate / and /agents/capabilities/skills/ Markdown requests still succeed on the security-fixed preview. Browser instrumentation confirmed zero fetches for eleven rejected path variants (literal/encoded dot segments, nested escapes, separators, host/scheme inputs, and malformed escapes) and five unsafe section variants. Regression tests first failed on the old code and then passed after the fix. Absolute external paths are rejected with Provide a root-relative documentation path without dot segments, queries, or fragments.
  • No observed WebMcpTools/Pagefind errors. Unrelated Vercel feedback CSP errors and an existing Kapa proxy 404 were observed. The browser lacks a native WebMCP API, so native agent invocation remains unverified; registration/execute behavior was tested using a fake API.

Complete fast-verifier output (raw):

$ npm run build
[build] Complete!
$ grep -l registerTool .vercel/output/static/_astro/*.js
.vercel/output/static/_astro/WebMcpTools.astro_astro_type_script_index_0_lang.D4TuymjR.js
tool names: search_docs_pages, get_page_markdown, list_docs_pages
$ curl homepage; list same-origin /_astro/*.js scripts; grep each bundle
https://docs-git-factory-ar-20261125-1-same-origin-webmcp-warpdotdev.vercel.app/_astro/ArticleImageLightbox.astro_astro_type_script_index_0_lang.3bDx_pZ9.js?dpl=dpl_8by8GWKaVR9qjFaFEW7qXQGkiZbt
https://docs-git-factory-ar-20261125-1-same-origin-webmcp-warpdotdev.vercel.app/_astro/WebMcpTools.astro_astro_type_script_index_0_lang.D4TuymjR.js?dpl=dpl_8by8GWKaVR9qjFaFEW7qXQGkiZbt
  MATCH registerTool, search_docs_pages, get_page_markdown, list_docs_pages
https://docs-git-factory-ar-20261125-1-same-origin-webmcp-warpdotdev.vercel.app/_astro/page.C4l30SBd.js
https://docs-git-factory-ar-20261125-1-same-origin-webmcp-warpdotdev.vercel.app/_astro/Search.astro_astro_type_script_index_0_lang.zVH2PZpH.js?dpl=dpl_8by8GWKaVR9qjFaFEW7qXQGkiZbt
https://docs-git-factory-ar-20261125-1-same-origin-webmcp-warpdotdev.vercel.app/_astro/ec.0vx5m.js
https://docs-git-factory-ar-20261125-1-same-origin-webmcp-warpdotdev.vercel.app/_astro/MobileTableOfContents.astro_astro_type_script_index_0_lang.BcSo_yiZ.js?dpl=dpl_8by8GWKaVR9qjFaFEW7qXQGkiZbt
https://docs-git-factory-ar-20261125-1-same-origin-webmcp-warpdotdev.vercel.app/_astro/TableOfContents.astro_astro_type_script_index_0_lang.Csloo1VZ.js?dpl=dpl_8by8GWKaVR9qjFaFEW7qXQGkiZbt
https://docs-git-factory-ar-20261125-1-same-origin-webmcp-warpdotdev.vercel.app/_astro/MermaidControls.astro_astro_type_script_index_0_lang.D9viLZl9.js?dpl=dpl_8by8GWKaVR9qjFaFEW7qXQGkiZbt
same-origin script bundles scanned: 8
$ npx -y @ora-ai/ax@0.5 audit <preview-url> --force --json | jq webmcp-checks
CHECK webmcp
{"score":8,"id":"webmcp","status":"pass","details":"Imperative WebMCP API detected (modelContext.registerTool in script bundle /_astro/WebMcpTools.astro_astro_type_script_index_0_lang.D4TuymjR.js). Read 3 tools from the page's scripts. Graded from the page's code: 100/100 on the WebMCP rows below.","maxScore":8}
CHECK webmcp-schema-validity
{"score":0,"id":"webmcp-schema-validity","status":"pass","details":"All 3 declared input schemas are structurally valid object schemas.","maxScore":0}
CHECK webmcp-schema-quality
{"score":0,"id":"webmcp-schema-quality","status":"pass","details":"All 3 tool schemas describe their parameters, and every description stays within Chrome's size guidance.","maxScore":0}
CHECK webmcp-stub-detection
{"score":0,"id":"webmcp-stub-detection","status":"pass","details":"All 3 tools declare an execute handler.","maxScore":0}
CHECK webmcp-entry-point
{"score":0,"id":"webmcp-entry-point","status":"pass","details":"All 3 tools register on the canonical document.modelContext entry point.","maxScore":0}
CHECK webmcp-naming
{"score":0,"id":"webmcp-naming","status":"pass","details":"All 3 tool names are consistent, verb-led, and within Chrome's size guidance.","maxScore":0}
CHECK webmcp-annotations-present
{"score":0,"id":"webmcp-annotations-present","status":"pass","details":"All 3 read-shaped tools declare readOnlyHint: true - the one declared claim that lets an agent treat a call as safe to make without asking.","maxScore":0}
CHECK webmcp-annotation-mismatch
{"score":0,"id":"webmcp-annotation-mismatch","status":"pass","details":"No tool claims to be read-only while its own name or description says it writes (3 declared hints checked).","maxScore":0}
CHECK webmcp-untrusted-content-hint
{"score":0,"id":"webmcp-untrusted-content-hint","status":"na","details":"No tool's contract suggests it returns text written by somebody other than the site, so there is nothing to flag as untrusted.","maxScore":0}
CHECK webmcp-consequential-hint
{"score":0,"id":"webmcp-consequential-hint","status":"na","details":"No tool name reads like a consequential action (a purchase, a booking, a payment, a transfer, a deletion), so there is no consequentialHint to expect.","maxScore":0}
CHECK webmcp-coverage
{"score":0,"id":"webmcp-coverage","status":"pass","details":"The tool set covers the whole core docs flow: search or browse the catalog, read a page or article, navigate the documentation tree.","maxScore":0}
Overall score: production=71; preview=56
Scans: production=647963; preview=650346
Lower-scoring canonical/preview checks (not domain-equivalent):
{"scores":"4 -> 0","id":"agentic-search-specific","previewDetails":"In a search for your API docs, none of the 10 results is your official docs. In a search for your MCP server, SDK or CLI, none of the 10 results is your own, although the scan found one on your site"}
{"scores":"3 -> 0","id":"brand-search-accuracy","previewDetails":"docs-git-factory-ar-20261125-1-same-origin-webmcp-warpdotdev.vercel.app was not in the top 10 for \"Warp\" (searched your brand name alone: no main product term from your homepage qualified)"}
{"scores":"1 -> 0","id":"npm-sdk-package","previewDetails":"No NPM or PyPI SDK package found"}
{"scores":"1 -> 0","id":"agent-rules-repo","previewDetails":"Could not locate a public repo containing agent configs or rules. If our probes missed it, AI coding agents likely will too - link the repo from your homepage or docs so it's discoverable."}
{"scores":"1 -> 0","id":"noindex-directives","previewDetails":"The homepage tells search engines not to index it (X-Robots-Tag: noindex). Search engines drop it, so agents that search the web to find a site will not find this one."}
{"scores":"1 -> 0","id":"skills-sh-listed","previewDetails":"No official skills self-published on skills.sh"}
{"scores":"4 -> 1.33","id":"public-api-docs","previewDetails":"Documentation found at /api but not linked from homepage"}
{"scores":"2 -> 0","id":"skills-sh-quality","previewDetails":"No official skills on skills.sh to evaluate"}
{"scores":"1 -> 0","id":"docs-auth-gate","previewDetails":"No content pages sampled"}
{"scores":"8 -> 3.43","id":"public-api","previewDetails":"API described in documentation at https://docs-git-factory-ar-20261125-1-same-origin-webmcp-warpdotdev.vercel.app/agents.md but no machine-verifiable API surface confirmed. Best-of-protocols score: 3/7."}
{"scores":"1 -> 0","id":"mcp-server-card","previewDetails":"No MCP server card found for https://warp.mcp.kapa.ai (checked /.well-known/mcp/server-card.json, the site's ai-catalog.json, servers[].card in mcp.json, and <server>/server-card)"}
Unmatched-origin comparison: 11 lower-scoring checks; not used as the regression gate.

Ora CLI stderr on both runs: ora reports contract 1.42.0; this CLI was built against 1.23.0. Newer fields may be missing from the output - upgrade with: npm i -g @ora-ai/ax@latest. Requested CLI version @ora-ai/ax@0.5 was retained. The initial audits used no --force. The navigation refresh used it only after proving the cached scan predated its push. For the security refresh, the first audit returned cached scan 650047 dated 16:58, predating the security push; only then was --force used to obtain scan 650346. No feedback APIs were used.

Follow-ups / human decision

Keep this PR draft with no requested reviewers. Human decision: whether to merge the experiment after normal review. The controlled regression gate passes; no preview-domain exception is required. The canonical production score prediction still requires a post-deploy scan within one week. No content, route, llms configuration, or off-limits PR changes.

Co-Authored-By: Oz oz-agent@warp.dev

Co-Authored-By: Oz <oz-agent@warp.dev>
@warp-agent-staging

Copy link
Copy Markdown
Contributor Author

This PR was generated with Warp.

Comment @warp-staging-factory on this PR to send it follow-up work.

@vercel

vercel Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Nov 27, 2026 8:10pm UTC

Request Review

Co-Authored-By: Oz <oz-agent@warp.dev>
Co-Authored-By: Oz <oz-agent@warp.dev>

This branch was successfully deployed

1 active deployment
Preview — 2ed92ea6 Deployed Nov 27, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant