Open source
The one kind of traffic your site cannot see
A page view leaves a log line. An API call carries a user agent. A WebMCP tool call carries nothing at all — it runs inside the browser, sends no request, and never touches your server. If your page does not report it, then as far as anyone outside can tell, the call did not happen.
So the first question anyone shipping WebMCP tools asks — is an agent actually using this? — has no answer today. We wrote the library that answers it, and gave it away.
One line, including for tools you did not write
It wraps navigator.modelContext rather than asking each tool to report itself. Instrumentation that depends on every tool author remembering a line goes missing exactly where it matters most: the tool added in a hurry, the tool a third-party widget registered, the tool that throws.
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 the failure is recorded. Analytics that change what the agent receives are a bug in the thing they measure.
What it records, and what it refuses to
| Recorded | Never recorded |
|---|---|
| Which tool, how long it took, whether it failed | Argument values |
Argument shapes — query:string:17 | Cookies, storage, IP addresses |
| The shape of the execute context | Any durable identifier |
| Which registered tools were never called | Anything sent to a third party |
A tool argument is whatever a stranger typed at an agent. query:string:17 says a seventeen character query was supplied — which answers what you are asking — while leaving nothing to leak, nothing to anonymise, and nothing that turns the log into personal data. Records go to your own endpoint and stay on your own disk.
The number you cannot get any other way
A tool nobody calls leaves no record to count, so registered, never called cannot be derived from a call log at all — it needs the list of what you registered. It is usually the line worth acting on: a tool an agent never reaches for is either described badly or not worth having.
Nobody yet knows whether a WebMCP call can be attributed to the agent behind it. The proposal specifies { signal } for the execute context and says nothing about provenance. So no field is guessed at: the shape of that object is recorded, and every key that ever appears is listed. The day a client starts identifying itself, it shows up on the first call rather than after somebody thinks to look for it.
Why we published it
We measure whether sites are ready for agents. Measuring whether the tools they ship are then used is the same question one step later, and nobody could answer it — so keeping the answer private would have been a strange way to argue that the web should be measurable. It is MIT licensed. Fork it, read it, send a patch, or take the idea and build something better.