Open-source instrumentation
The one kind of traffic your server logs cannot see
A browser WebMCP tool invocation runs inside the visitor's tab and does not automatically write a server log entry. Even when its handler calls your API, that HTTP request rarely identifies which registered tool triggered it.
The MIT-licensed webmcp-analytics wrapper instruments tool registration, execution timing, and thrown errors without touching argument values or personal data.
One line, including for tools you did not write
Wrapping the model-context API captures every registered tool in one place — including tools registered by third-party widgets or added in a hurry without custom telemetry.
The WebMCP specification registers tools on document.modelContext (Chrome 150 deprecated the earlier navigator.modelContext location). Follow the API migration guide and verify registration and execution in Chrome.
npm install github:shufflethis/webmcp-analyticsimport { instrumentModelContext } from "webmcp-analytics";
instrumentModelContext({ endpoint: "/api/webmcp-events" });The wrapper is transparent: return values pass through untouched, and a tool that throws still throws after recording the failure class.
What it records, and what it refuses to
| Recorded | Never recorded |
|---|---|
| Which tool, duration in ms, pass or failure | Argument values |
Argument shapes — query:string:17 | Cookies, storage, or IP addresses |
| The shape of the execute context | Any durable user identifier |
| Which registered tools were never called | Anything sent to a third party |
Hosted alternative
Want turnkey AI crawler & WebMCP dashboards?
webmcp-analytics sends raw events to your own endpoint for self-hosting. If you want a hosted one-line snippet + dashboard that tracks ChatGPT, Claude, Perplexity referrals, bot crawls, and WebMCP tool calls out of the box, use our sister service agenttracking.co.
First check whether agents can find your tools
Run a free 25-check Agent Readiness scan on any public URL.
Free instant score in ~20s. No account, no email required. Works on any public homepage, product, or form URL.