explaingit

sdras/webmcp-demo

14CSSAudience · developerComplexity · 1/5ActiveSetup · easy

TLDR

Static side-by-side demo of WebMCP, comparing how an AI agent interacts with a normal web button versus one exposed as a declared tool via a WebMCP shim.

Mindmap

mindmap
  root((webmcp-demo))
    Inputs
      Static HTML page
      WebMCP shim script
      Browser extension
    Outputs
      Side by side comparison
      Simulated agent calls
      Annotation overlay
    Use Cases
      Learn what WebMCP looks like
      Demo to teammates
      Fork as teaching aid
    Tech Stack
      HTML
      CSS
      JavaScript

Things people build with this

USE CASE 1

Show stakeholders the difference between DOM scraping and a declared WebMCP tool

USE CASE 2

Fork the demo as a teaching aid for MCP-in-browser concepts

USE CASE 3

Test the WebMCP browser extension against a known working page

Tech stack

HTMLCSSJavaScript

Getting it running

Difficulty · easy Time to first run · 5min

The interactive side requires the WebMCP browser extension; without it you only see the static comparison.

In plain English

This repository is a small explainer site for WebMCP, a proposal that lets a web page tell an AI agent which tools it offers, in a structured way, instead of forcing the agent to read the rendered HTML or the accessibility tree. The demo, written by sdras, is meant as a teaching aid for people who have read about MCP for AI tools and want to see what the same idea looks like in a browser. The page itself is a side-by-side comparison. On one side, a calendar booking button behaves the way today's agents see it, by scraping the document model. On the other side, the same button is exposed through a WebMCP shim, so an agent connected through the WebMCP browser extension can call it as a declared tool. Around that demo, the page carries written explainer copy, links to the WebMCP specification and origin trial, and feedback channels for the proposal. There is no build step. The whole thing is three static files: index.html for the page structure and copy, styles.css for the visual design, and app.js for the booking widget, the WebMCP shim, the simulated agent, and the annotation overlay that points out which parts of the page are doing what. To run it locally, the README suggests serving the directory with any static file server. It shows two one-line options, npx serve . from Node, or python3 -m http.server 8000, then opening the served URL in a browser. The author invites readers to fork the demo as a learning tool and to follow the links on the site for the WebMCP spec, related docs, and the origin trial signup. No license is mentioned in the README, and there are no tests or external dependencies beyond a static web server and the WebMCP browser extension for the interactive side of the comparison.

Copy-paste prompts

Prompt 1
Walk me through what the WebMCP shim in app.js does compared to the plain DOM button
Prompt 2
Help me add a second declared tool to the webmcp-demo booking widget
Prompt 3
Set up the webmcp-demo locally with python3 -m http.server and the WebMCP browser extension
Prompt 4
Write a short blog post that uses this demo to explain WebMCP to a frontend team
Open on GitHub → Explain another repo

Generated 2026-05-22 · Model: sonnet-4-6 · Verify against the repo before relying on details.