Live Demo: MCP
An AI agent asks questions of the files the four other demos write, over the Model Context Protocol (MCP), right here in your browser. Each file gets its own MCP server: the same Go code that answers at /mcp in precomputing serve, compiled to WebAssembly. The agent reads what each file keeps, then asks for ready answers. Each answer costs a few hundred tokens, while the raw data behind it would run to hundreds of thousands, and most of that data is no longer in the files.
Real files, real server. The four files are the demos’ own, made by their real code from simulated data. The MCP server is the real one. The page makes the agent’s calls from a script, so every run asks the same way; a recorded session with a real agent is further down.
How to Run It
- Look at the four files. Each one is shown as its policy leaves it once the detail it keeps for a short while has faded. “What it keeps” shows the description the agent reads first.
- Press Ask the four questions, or ask them one at a time. Every call shows its arguments, the text the model reads, its size in tokens and what went over the wire.
- Read the checks. Each answer is checked against a count of the raw events made by separate code.
- Make a call yourself. Pick a server and a tool and change the arguments, or send any JSON-RPC message with your own headers, mistakes included.
On a wide screen the demo can use the whole window: open it full screen.
The Controls
| Control | What it does |
|---|---|
| Ask the four questions | Reads each file’s description once, then asks the four questions in turn |
| Ask | Asks one question on its own |
| Start again | Clears the answers |
| What it keeps, Download | Shows a file’s description as the agent reads it, or downloads the file |
| A tool call, Any message | Makes a call of your own: a tool with arguments, or a whole JSON-RPC message with headers |
| Run | Sends your call to the server of the file you picked |
The Four Files
| File | From | As it stands | Size |
|---|---|---|---|
| latency | Demo 1, three hours of API traffic | A day after its three hours | 2.8 MB |
| trades | Demo 2, a trading day | An hour after the close | 0.6 MB |
| usage | Demo 3, a month of AI usage | On 31 December, when September’s dispute window ends | 1.9 MB |
| shop | Demo 4, a web shop’s logs | Two days after its two hours | 2.3 MB |
The page downloads them compressed, 2.1 MB in all.
The Tools
Every tool only reads. Answers come back as short CSV text with a line of context, sized for a model to read.
| Tool | What it returns |
|---|---|
describe_file |
What the file keeps: its streams, keys, values, time span, precomputes and what is kept whole |
get_answer |
A precompute for a key and a period, such as an invoice for one customer in September |
get_windows |
Window summaries of a stream over a time range: counts, sums, averages, minimums, maximums and percentiles |
get_kept |
Events kept whole: raw events, samples, unusual events and log templates, newest, oldest or most unusual first |
query |
One read-only SQL statement, for anything the others do not cover |
The Four Questions
- What was the p99 latency of /api/checkout between 10:00 and 11:00 UTC, and which requests stood out?
- What was SIM4’s 1-minute candle at 10:30 New York time?
- What does Harbor Legal Drafts owe for September, line by line?
- Which log patterns are new since the payment incident began at 12:40, and what do the errors say?
What the Numbers Mean
- Tool calls: every call the agent made, the four file descriptions included.
- Tokens in the answers: the size of the text the model reads back from each call. Tokens are estimated as a quarter of the bytes.
- Tokens reading what each file keeps: the four descriptions, read once each.
- Tokens the raw data would take: the raw events each answer summarizes, as CSV, with the same estimate. For the four questions that is 21.3 MB.
- Checks against the raw events: each figure in each answer against a count by separate code, from the demos’ own event generators, the requests the Meter kept whole and the invoices its recount checked.
Things to Try
- Ask the four questions. Seven calls and four descriptions come to 2,561 tokens. The raw data behind the answers would take about 5.3 million, 2,081 times more, and all 19 checks pass.
- Read a description. “What it keeps” on the usage file shows what an agent learns before its first question: the streams, the precomputes and how long each level of detail lives.
- Ask for something the file no longer has. Ask
get_keptfor the latency file’s raw events from the first hour. They have faded, and the tool says so and says what is still kept. - Send a bad message. Under Any message, leave out a required header or ask for a tool that does not exist, and see the error the protocol prescribes.
- Read the recorded session. A real agent answers four questions of its own with 18 calls, and one of its calls is a mistake it then corrects.
The Recorded Session
The session was recorded on 30 September 2026. The agent is Claude, made by Anthropic, connected to four precomputing serve --read-only servers over HTTP with a read token, through the official MCP TypeScript client (version 2.2.0, protocol revision 2026-07-28). Claude built this release and had seen the files while building it; in the session it read them only through the tools. The questions were chosen before the first call, and every call, result and answer is shown as it happened.
How an Agent Connects
Outside this page the same server runs in precomputing serve, at /mcp beside the HTTP API, or as precomputing mcp FILE for agents that start local tools:
# On the machine with the file: read only, with a token file
precomputing serve --read-only --token-file tokens usage.sqlite
# In the agent's MCP configuration
{
"mcpServers": {
"usage": {
"type": "http",
"url": "http://localhost:8080/mcp",
"headers": { "Authorization": "Bearer <a read token from the file>" }
},
"shop": { "command": "precomputing", "args": ["mcp", "shop.sqlite"] }
}
}
The server speaks the current protocol revision, 2026-07-28, and answers clients that open with the older handshake of 2025-11-25, 2025-06-18 or 2025-03-26. Both official TypeScript clients, version 2 and version 1, pass over HTTP and stdio on all four files. A request without a token is refused with 401, and a read token cannot post events.
If It Does Not Start
The demo works in any current Chrome, Edge, Firefox or Safari, on a computer or a phone, with JavaScript switched on. It needs WebAssembly, which all of them support. It downloads SQLite (1.5 MB, 577 KB compressed), the MCP server with the Engine (5.9 MB, 1.6 MB compressed) and the four files (2.1 MB compressed) from this site. If the demo says it could not start, try another browser, or allow scripts on this page if an extension blocks them.
What Is Real Here
Real:
- The MCP server: the same Go code as
precomputing serveandprecomputing mcp, compiled to WebAssembly. The native server gives the same answers to the same calls, byte for byte. - The four files, written by the demos’ real code and faded by their own policies.
- The recorded session with a real agent, and the checks against the raw events.
Simulated:
- The data in the files, as in the other demos.
- The agent in the page: a script makes the calls a careful agent would make, so every run is the same.
The Platform page has the numbers, and the MCP case study follows the four questions and the recorded session.