craigthompson.dev

$ cat case-studies/webmcp.md

A site AI agents can use, not just read

// webmcp + mcp · tools for AI agents · 2026

A site AI agents can use, not just read

AI assistants are starting to work inside the browser, on the page a person has open. Rather than leave them to read the screen and guess, I’ve given this site its own tools through WebMCP, a draft web standard. An agent calls a tool and gets structured answers, drawn from the same content visitors read. The same tools also run as an MCP server, so any MCP client can use them without the site open.

In this browser: no WebMCP, so the page skips it.

MCP server https://craga-ask.craga89.workers.dev/mcp

How an agent uses the tools
  1. AI agent in the browser, or any MCP client
  2. calls a tool through WebMCP or MCP
  3. reads the site's own data cv.json, the ask.sh index, CI results
  4. gets a structured answer or opens it on screen
The tools
  • get_profileheadline, summary, contact, CV links and skills
  • get_careerevery role, with highlights, and the degree
  • list_files · read_filecase studies and responsibilities in full, and can open one on the page
  • search_sitethe best-matching passages, in my own words
  • askan ask.sh answer, with the same limits as the box on the page
  • get_open_sourcemerged pull requests by quarter, and qTip2
  • get_site_reportthe latest Lighthouse, WCAG and ask.sh results
  • show_sectionscrolls to a section and highlights it (on the page only)
# in practice
  • Each tool is defined once, in one shared module, and runs in both places: on the page through WebMCP and on the Worker through MCP. The site’s search lives there too, so ask.sh, the page and the server can’t drift apart.
  • The tools read the same files the page loads, so an agent gets the same facts a visitor reads.
  • The MCP server is public, read-only and rate-limited. It keeps no state between requests and serves both the current protocol (2026-07-28) and older clients.
  • Browsers without WebMCP skip it. In Chrome it runs as an origin trial.
  • CI tests both: the page’s tools against a stand-in for the browser API, and the server against both protocol versions and the official MCP client. The ask tool is stubbed in tests, so they never reach the live service.
  • For agents that read rather than act, the same content is in llms.txt and cv.json.

$ ls case-studies/

Search and jump