Skip to main content
Glama

title: MCP Events Test Kitchen colorFrom: yellow colorTo: pink sdk: docker app_port: 7860 pinned: false license: mit short_description: A cozy diner where an AI cook is woken by MCP Events

MCP Events Test Kitchen

MCP Events Test Kitchen. Watch the demo video.

Play it live: https://olaservo-mcp-events-test-kitchen.hf.space/

A tiny diner on Lantern Street, run by an AI cook. The cook is an MCP client, woken by MCP Events (SEP-3415) from the server: a customer comes in, a timer rings, a goose wanders through. It cooks and serves with tools. You watch the kitchen in the browser, and you can ring the doorbell or make it rain.

The diner opens when a cook connects. It closes a little while after the cook leaves, and anyone still waiting goes home. With no cook of your own, press "Call in a stand-in cook" and a scripted one opens the diner for five minutes.

Related MCP server: Tizón MCP Server

Rooms

Every kitchen is a room with its own game, named in the URL. The page for a room is /r/<room> and its MCP endpoint is /r/<room>/mcp. Opening the bare site URL sends you to a new room with a name like toasty-dumpling-42.

Anyone with a room's link shares that kitchen. They see the same cook and score, and can press the same buttons. A room is opened the first time its name is used, so you can also pick your own: 3 to 40 lowercase letters, digits and hyphens. The name is the only key, so pick a hard one if you want the room to yourself.

Several cooks can connect to one room. Every event wakes all of them, and nothing stops two from cooking the same order. The page says there are too many cooks and draws up to three squeezed in behind the counter. The spare dishes end up on the washing-up pile.

Rooms live in memory. A room nobody is watching or cooking in is swept after 4 hours, and a restart clears them all. MAX_ROOMS (default 200) caps how many are open at once.

What the page shows

  • The kitchen. Each pushed event flies to the cook as a paper slip with its event type on it, and the cook answers with tools.

  • On the wire. One card per event type shows whether a push stream is open, how many occurrences were pushed or polled, and the cursor. Below it is a log of the MCP messages in both directions: events/stream, the notifications/events/* frames, events/poll, and each tools/call with its result. Click a line for the full JSON.

  • What's happening. The same story in plain words. Each line is tagged with the event type that was emitted or the tool the cook called. An event emitted while no stream was open is marked as not pushed.

  • Stir things up. The doorbell seats a customer. The goose steals a ready dish. The festival bus seats up to three people. Rain makes everyone wait longer. A flicker pauses the pots. While the diner is closed nobody is seated, but the town still happens.

  • Call in a stand-in cook. While the diner is closed, this button takes the doorbell's place. It starts the scripted cook on the server for five minutes.

Events

All three event types offer poll and push delivery and take no arguments. Webhook delivery is not offered.

Event

When

diner.customer

A customer arrives (kind: arrived), gets grumbly from waiting (grumbling), or gives up and leaves (left_sad).

kitchen.timer

A dish is ready, or it burnt because it sat on the stove or in the oven too long.

town.happening

Something happens on Lantern Street: goose, bus, rain, flicker, flies when the washing-up pile gets three plates high, or new_day when someone starts a fresh day from the page.

The server follows the Events extension specification, which is in Beta:

  • The events methods are served at protocol revision 2026-07-28, the first the extension is defined for.

  • events/poll and events/stream need the Mcp-Name header set to the event name, as the specification requires over Streamable HTTP.

  • maxEvents, maxAgeMs and a suggested heartbeatMs are honoured. A heartbeat is sent every 15 seconds unless the client suggests another interval, from 1 to 30 seconds.

  • A cursor counts the occurrences of one event type. The last 200 of each type can be replayed, and a cursor the server can no longer serve gets truncated: true. A restart starts the counts again.

Tools

  • look shows the waiting customers and their orders, the stations, the menu and the score. It also returns heard, the last things any cook said, so cooks sharing a kitchen can hear each other.

  • cook(dish) starts a dish on a free station of the right kind: two burners, a cutting board and an oven.

  • serve(customer_id) serves a ready dish to the customer who ordered it. Faster service earns bigger tips.

  • toss(station) throws away what is on a station, burnt or not. Each tossed dish adds a plate to the washing-up pile on the counter. The third plate draws flies, and everyone waiting loses a little patience. The pile stays until someone starts a fresh day.

  • say(text, customer_id?) speaks in the diner. A kind word to a customer buys a little patience, once.

The server's MCP instructions tell a connecting agent how to play.

Run it

uv run --with-requirements requirements.txt app.py --port 7860

It needs Python 3.12 or later. Open http://127.0.0.1:7860/ to be shown to a room. GAME_SPEED=2 makes everything happen twice as fast.

The server prints every MCP message and every line of the story to stdout, each with its room name. On a Space these are in the Logs tab. It also prints the name and version each client gives the first time it speaks in a room, and one line of totals when a shift ends. --log-heartbeats adds heartbeats and empty polls.

Hire a cook

Any MCP client that supports the Events extension can cook, by push or by poll. The official extension support matrix lists which clients do. Each room's page has steps to copy for fast-agent, opencode and the stand-in cook.

fast-agent

The released fast-agent, from 0.10.69, cooks by polling. Push needs a build that has it, such as olaservo/fast-agent on the branch feat/mcp-events-push. The fastagent.config.yaml here declares the three subscriptions with wake on:

fast-agent go --config-path fastagent.config.yaml --servers kitchen --model <model>

Then say "Open the diner." Each event wakes the agent for a turn. The config cooks in the room my-kitchen on a local server, so watch at http://127.0.0.1:7860/r/my-kitchen. Change the room name in the config's URL to cook somewhere else.

To cook on the hosted Space instead, from a fast-agent checkout on that branch:

uv run fast-agent go --config-path <this repo>/fastagent.space.yaml --servers kitchen

fastagent.space.yaml points at the room my-kitchen on the Space and uses hf.zai-org/GLM-5.3-Flash:baseten through your Hugging Face login. Pass --model to pick another.

For a headless cook, use examples/mcp/events/event_loop.py from that fast-agent branch with --config pointing at fastagent.space.yaml and --server kitchen.

opencode

opencode 2.4 or later watches events over push with automations. Add a room's endpoint to opencode.json as a remote MCP server, then ask it to create an automation for each of the three events. The room's page has the config and a prompt to copy.

The stand-in cook

cook.py is a scripted cook with no model behind it. It speaks raw MCP over HTTP at protocol revision 2026-07-28, with no MCP SDK: it opens an events/stream for each event type, waits for a pushed event, then plays a turn with the tools. Use it to see the whole loop without an Events-capable client. At under 300 lines, it is also a small example of one.

uv run cook.py http://127.0.0.1:7860/r/my-kitchen/mcp
uv run cook.py <site>/r/<room>/mcp --shift 180 --think 3

--think is the pause before each tool call, to stand in for a slow model. --poll uses events/poll in place of push streams. The server also serves the script at /cook.py, and each room's page shows the full command for that room.

The page's "Call in a stand-in cook" button runs the same script on the server. It is a client of that room's own MCP endpoint, so the wire log shows the same traffic as a cook from outside. A room has one stand-in at a time. STAND_IN_S (default 300) is how long it stays, and MAX_STAND_INS (default 6) caps how many are on shift across all rooms.

Development

The scripts in dev/ are the ones the kitchen was tested and filmed with.

  • wire_check.py checks the protocol and the game rules over raw MCP. It needs no MCP client and takes about a minute: uv run --with-requirements requirements.txt dev/wire_check.py.

  • stage.py stages a scene in-process and screenshots the page with headless Chrome.

  • shift.py watches a room for a shift, presses the festival bus at set times, and writes a report from the room's wire log.

  • scene.sh starts the cooks for a demo scene on a Space: one cook, two, four, a fast-agent and opencode pair, or a cook that polls.

  • show.py plays a list of scenes on a Space one after another for a screen recording, and keeps each room's logs and report under runs/.

  • keep.py adds to that folder each cook's session as a trace, token totals, and the Space's run log.

  • label.py labels those traces with the commit of this server, the build of the agent, and where in the run each one is from. It writes manifest.json. TRACE_LABELS.md says what each label means.

  • cues.py lists what happened in each room against the clock of a screen recording, to find moments when editing.

  • e2e.py and space_check.py check fast-agent's client against a local server and against a Space. They need a fast-agent build with push.

  • deploy.sh saves a Space's run log, then uploads HEAD to it.

Lint with uv run ruff check --config ruff.toml . and format with uv run ruff format --config ruff.toml ..

Deploy to a Hugging Face Space

Create a Docker Space and upload app.py, cook.py, static/, requirements.txt, Dockerfile and this README. A room's MCP endpoint is then https://<user>-<space>.hf.space/r/<room>/mcp.

License

MIT. See LICENSE.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables MCP-capable agents to connect to a persistent shared-world service, discover people and worlds, and participate via natural-language actions.
      26 npm
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      MCP server for operating a fictional restaurant, providing tools to consult the menu, manage active orders, view shift summaries, update dish availability, and advance order statuses. Includes a playground that teaches JSON-RPC by showing live protocol interactions.
      1
      -
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables MCP clients to manage a simulated kitchen by listing menus, starting meals, reporting step progress, advancing the clock, proposing and accepting recovery plans, and querying state with versioned, idempotent mutations.
      1
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables agents to create and persist meal plans, track parallel timers and progress, recover from interruptions or constraint changes, and inspect revised schedules through MCP tools.
      MIT