WebMCP demo

Score Context in the tab.

This page reads a project.faf (a small YAML file of context to boost AGENTS.md) from a public repo that already has one — no clone. AGENTS.md, Context Card, and Score run on that file.

Listed in the W3C Web Machine Learning group's awesome-webmcp (Demos).

await document.modelContext.registerTool({
  name: 'score_faf',
  description: "Score a Foundational AI-context Format (.faf) YAML document 0–100 and list missing slots. Input is YAML text or a https URL that returns YAML. Does not write files.",
  inputSchema: {
    type: 'object',
    properties: {
      yaml: { type: 'string', description: 'Full .faf YAML' },
      url: { type: 'string', description: 'https URL of a .faf file' }
    }
  },
  annotations: { readOnlyHint: true },
  execute: async (input) => scoreFaf(input)
});

Why in the tab?

WebMCP lets a web page give an agent named tools with typed inputs. This page already holds the file and the scorer, so an agent calls score_faf instead of clicking through the UI. No local MCP server.

WebMCP tools

Same names an agent sees — plus what each one does.

Try it

project.faf

Loaded from a repo that already has the file. AGENTS.md, Context Card, and Score read this box.

Paste a project.faf to write AGENTS.md.

Who / What / Why / Where / When / How

This file's six human-context slots. Edit any, then Return YAML. Nothing is saved.

How to use

  1. Turn on WebMCP

    Enable chrome://flags/#enable-webmcp-testing and relaunch Chrome, or use the Model Context Tool Inspector.

  2. Open this page

    It registers the tools on load. Now: detecting….

  3. Ask your agent

    Ask a WebMCP-aware agent to score the project, or run score_faf from the Inspector.

  4. Change the file

    Delete a line in the box, like why:, and score again. The score drops and names the missing slot.

How it works

  • score_faf and emit_agents_md are registered with document.modelContext.registerTool(), readOnlyHint: true.
  • fill_6ws is a plain form with toolname, tooldescription, and toolautosubmit. It answers with respondWith() and does not navigate.
  • Native document.modelContext first. @mcp-b/webmcp-polyfill only as a fallback.
  • Scoring runs as WASM in the tab. The tools' only network call is fetching a project.faf over https from raw.githubusercontent.com or faf.one, capped at 256 KB.

Source and README · MIT

Read-only. Three tools. Origin-isolated. Help guide what we build — comments · suggestions welcome.

Source · Privacy