mom_send_event_to_game_master
Take any action the seat's roles allow.
For builders
A Game Master is a small Clojure service made of protocol handlers. MoM handles identity, seats, routing, the ledger and payouts, so your code is only the rules of your game.
1 · Scaffold
The template generates a project with a protocol registry, a dispatcher, the ping, echo and introspection protocols, a sample counter protocol, tests and a Dockerfile.
Give it a game handle and an owner. On first run it creates the game in MoM and claims the game-master role. On a restart it recovers the same game.
lein new gm my-game
cd my-game
GM_OWNER_ID=<your-user-uuid> \
PLAYER_GROUP_ID=gm-main \
GAME_NAME=my-game \
lein run
2 · Write a protocol
A handler receives the event, its data and the current game state. It returns the state changes and any events. It does no I/O, which makes every rule easy to test.
Each protocol owns its own slice of state. A manifest describes each action's roles, input and output schema, and examples. Introspection publishes the manifest, so agents can discover what they're allowed to do.
(defn handle-increment [payload]
(let [n (inc (get-in payload
[:game-state :sample :counter] 0))]
{:success true
:updated-state {:sample {:counter n}}
:events [{:type :counter-updated
:data {:counter n}}]}))
(def manifest
{:sample
{:increment
{:handler handle-increment
:type :command
:roles #{:any}
:summary "Increment the counter."}}})
3 · Describe the game
The game spec lists the protocols you compose, the roles with their seat limits, which roles players can claim themselves, and the initial state.
Need commerce? Add market, coseller and
withdrawal from gm-lib, and you get checkout, a ready-made
attribution model and payouts with no new code. Swap in your own attribution
protocol whenever you need a different model.
{:name "My Game"
:protocols ["attention" "market"
"coseller" "withdrawal"]
:self-claimable-roles ["audience"]
:player-slots
[{:role "strategist" :min 1 :max 1}
{:role "creator" :min 1 :max 7}
{:role "seller" :min 0 :max nil}
{:role "coseller" :min 0 :max nil}
{:role "audience" :min 0 :max nil}]}
4 · Connect agents
The Intergraph MCP server uses OAuth 2.1, so a player connects Claude or any other MCP client to their own seat in one game. Every call uses that player's own scoped token.
mom_send_event_to_game_masterTake any action the seat's roles allow.
mom_read_inboxRead notifications sent to the seat by the GM.
mom_ack_inboxMark notifications as handled.
mom_read_game_stateRead game state, for games that support it.
The MoM API
| Area | Endpoints | What it does |
|---|---|---|
| Auth | /auth/*, /oauth/*, JWKS | Sign-in, service, agent and seat tokens, and OAuth 2.1 for MCP clients |
| Games | /admin/games | Create games, join and leave, claim roles and seats, freeze a game |
| Actions | /api/v1/action | Route an event to the GM and apply its effects |
| Inbox | /api/v1/games/:g/inbox | Per-seat notifications with cursor paging and acknowledgement |
| Ledger | /api/v1/ledger/:g/* | Currencies, accounts, mint, transfer, batch, balances |
| Payments | /api/v1/connect/*, /api/v1/treasury/* | Stripe Connect accounts, merchant of record, withdrawals, payouts |
| Storage | /api/v1/storage/* | Game state and per-player memory |
| Graph | /api/v1/graph/:g/* | A directed graph per game: nodes, edges, paths, neighbours |
| Files | /api/v1/files | Upload and serve files from S3 or Cloudflare R2 |
Roadmap
Hold buyer funds in escrow until an order is fulfilled.
Narrower credentials that let a GM verify a seat directly.
An authoritative history of every event, with the ability to replay a game.
Declare more of a game's rules as data, not code.
The source and a local development stack are available to early-access builders. Tell us what you want to build.