Skip to content

Register WebMCP tools for browser agents (Lighthouse Agentic Browsing) - #27

Merged
hiabhee merged 2 commits into
mainfrom
feat/webmcp-tools
Nov 7, 2026
Merged

hiabhee merged 2 commits into
mainfrom
feat/webmcp-tools

Conversation

@hiabhee

@hiabhee hiabhee commented Nov 7, 2026

Copy link
Copy Markdown
Owner

Summary

Lighthouse's Agentic Browsing category scored 2/3. The failing check was WebMCP tool registration: the site registered no tools that a browser agent can call.

components/providers/WebMcpTools.tsx, mounted in the root layout, now registers five tools with document.modelContext.registerTool. In browsers without WebMCP it does nothing, and it removes the tools on unmount.

Tool What it does
search_architecture_templates Searches the templates and returns name, description, tags, URL and id (read-only)
search_system_design_tutorials Searches the tutorials and returns title, difficulty, minutes and URL (read-only)
open_template_in_editor Opens /editor?template=<id>
generate_architecture_diagram Opens /editor?generate=<description>; counts toward the AI quota
open_archdraw_page Opens one page from a fixed list
  • The tool logic lives in lib/site/webmcpTools.ts, pure and tested. The tools only navigate to same-site paths they build themselves; an agent can't pass in a URL.
  • New static /catalog.json with templates and tutorials, fetched only when a search tool runs, so pages don't carry the list. It's allowed in robots.txt.
  • New optional NEXT_PUBLIC_WEBMCP_ORIGIN_TRIAL adds the Chrome origin-trial meta tag (documented in .env.example).

Test plan

  • tsc clean, site and design-guard tests pass (76), eslint clean
  • /catalog.json serves locally
  • Chrome with chrome://flags/#enable-webmcp-testing: on the preview, await document.modelContext.getTools() lists the five tools
  • Lighthouse Agentic Browsing passes 3/3
  • Optional: register the origin trial and set NEXT_PUBLIC_WEBMCP_ORIGIN_TRIAL in Vercel

Lighthouse's Agentic Browsing category failed "WebMCP tool registration":
the site registered no tools. WebMcpTools (root layout) now registers five
with document.modelContext.registerTool when the browser supports it:

- search_architecture_templates, search_system_design_tutorials
  (read-only; fetch the new static /catalog.json on demand)
- open_template_in_editor (/editor?template=)
- generate_architecture_diagram (/editor?generate=, counts toward quota)
- open_archdraw_page (fixed list of public pages)

Tools only navigate to same-site paths they build. Optional
NEXT_PUBLIC_WEBMCP_ORIGIN_TRIAL adds the Chrome origin-trial meta tag.
/catalog.json is allowed in robots.txt.
@vercel

vercel Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
arch-draw Ready Ready Preview Nov 7, 2026 3:31pm UTC

@coderabbitai

coderabbitai Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ab02e526-09e0-486a-b674-463970e4ca7a
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

robots.ts: keep both sides (catalog.json + the SEO pages). open_archdraw_page
now also lists the glossary, the free tools and the comparisons.
@hiabhee
hiabhee merged commit 6a0189c into main Nov 7, 2026
6 checks passed
@hiabhee
hiabhee deleted the feat/webmcp-tools branch November 7, 2026 15:32

This branch was successfully deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant