How to Connect Claude to a Game of Life Sandbox (MCP Tutorial, Step by Step)
A copy-pasteable, step-by-step guide to connecting Claude (or any MCP client) to our Game of Life server — find a pattern, evolve it, check a prediction against ground truth, and publish a shareable board.
How to Connect Claude to a Game of Life Sandbox (MCP Tutorial, Step by Step)
Our MCP server tour covered what the server can do. This is a shorter, narrower thing: a step-by-step tutorial to get Claude connected and walk it through one complete task — find a pattern, evolve it, check a prediction against ground truth, and publish the result as a link — using nothing but copy-pasteable commands.
Every response below is real, taken from live calls against production while writing this. You don't need an account, an API key, or any local setup beyond an MCP client — Claude Desktop, Claude Code, or a raw HTTP client all work, and the four tools this walkthrough uses (get_pattern, run_generations, verify_prediction, create_board) are all free, unauthenticated, and public.
Step 0: Connect the server
The server speaks MCP over a single HTTP endpoint:
https://life.angen.ai/api/mcp/mcp
For Claude Desktop or Claude Code, add this to your MCP config:
{
"mcpServers": {
"gameoflife": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-fetch", "https://life.angen.ai/api/mcp/mcp"]
}
}
}
No API key, no auth. If you'd rather talk to it directly, the MCP transport requires you to accept both response formats — leave out the Accept header and you'll get a 406-style JSON-RPC error instead of a result:
curl -X POST "https://life.angen.ai/api/mcp/mcp" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list",
"params": {}
}'
That returns the full tool list — 11 tools as of this writing. Everything below uses four of them.
Step 1: Find a pattern
Ask Claude to look one up, or call it yourself:
{"name": "get_pattern", "arguments": {"patternId": "glider"}}
{ "rle": "bo$2bo$3o!", "width": 3, "height": 3, "cellCount": 5 }
That's the five-cell glider in RLE — the smallest, most common spaceship in Life, and a good pattern to sanity-check a sandbox against because its behavior is completely predictable: it translates one cell diagonally every 4 generations, forever.
Step 2: Run it forward
This is where the tutorial diverges from a plain pattern-library tour. run_generations evolves a pattern through the server's own exact simulation — no hand-counting neighbors, no guessing:
{"name": "run_generations", "arguments": {"rle": "bo$2bo$3o!", "generations": 4}}
{
"rle": "bo$2bo$3o!",
"generationsRun": 4,
"population": 5,
"extinct": false,
"aborted": false,
"offset": { "dx": 1, "dy": 1 }
}
Same shape, same population, and offset confirms the textbook claim: after exactly one period (4 generations), the glider is back to its starting RLE, just shifted one cell right and one cell down. That's not a coincidence the model reasoned its way to — it's the real simulation, run once, checked once.
Step 3: Check a prediction against ground truth
This is the part our piece on why LLMs still can't play Life is about: language models are unreliable at hand-simulating Life state transitions, because it requires exact, all-cells-at-once tracking that autoregressive generation isn't built for. verify_prediction turns that unreliability into something you can actually measure, instead of eyeballing it.
Ask your LLM client to predict one generation of the glider without calling a tool — just reasoning about it — then verify the guess:
{
"name": "verify_prediction",
"arguments": { "rle": "bo$2bo$3o!", "generations": 1, "predictedRle": "o1$bobo$bo!" }
}
{
"match": false,
"actualPopulation": 5,
"predictedPopulation": 4,
"missingCells": 2,
"extraCells": 1,
"generationsRun": 1,
"extinct": false,
"actualRle": "obo$b2o$bo!",
"actualOffset": { "dx": 0, "dy": 1 }
}
That's a real wrong guess — one cell dropped, one placed somewhere it shouldn't be. Now the correct one:
{
"name": "verify_prediction",
"arguments": { "rle": "bo$2bo$3o!", "generations": 1, "predictedRle": "obo$b2o$bo!" }
}
{ "match": true, "actualPopulation": 5, "predictedPopulation": 5, "missingCells": 0, "extraCells": 0, "generationsRun": 1, "extinct": false, "actualRle": "obo$b2o$bo!", "actualOffset": { "dx": 0, "dy": 1 } }
match: true, zero diff. The comparison is translation-invariant, so it's checking the actual cell arrangement, not demanding your predicted RLE happen to be anchored at the same coordinates. This is a genuine evaluation harness — the same shape as an academic Life-prediction benchmark, but callable from inside a normal agent conversation, on any pattern you want, not a fixed test set.
Both tools accept 1–1000 generations, so the same pattern works for a one-step sanity check or a long-horizon stress test — ask an agent to predict a methuselah's population after 200 generations and verify_prediction will tell you exactly how wrong it was, cell by cell, instead of you having to eyeball two grids and guess. That's the actual point of building this as a tool rather than a one-off benchmark dataset: it works on patterns nobody wrote a ground-truth answer key for in advance, because the server computes the answer key on demand, the same way it computes everything else here.
Step 4: Publish the result
Once you've got an RLE worth sharing — a pattern you fetched, evolved, or composed — create_board turns it into a public link anyone can open in the live simulator:
{"name": "create_board", "arguments": {"patternId": "gosperglidergun", "name": "MCP tutorial demo board"}}
{
"shareUrl": "https://life.angen.ai/shared/a15ddpwfr6vqxwxudpqee",
"id": "a15ddpwfr6vqxwxudpqee",
"name": "MCP tutorial demo board",
"cellCount": 36
}
That link is live right now: life.angen.ai/shared/a15ddpwfr6vqxwxudpqee — the actual board this call produced, a running Gosper glider gun, published while writing this article. That's the loop closed: an agent found a pattern, ran it forward through an exact simulation, checked a prediction against the real answer, and shipped something a human can open in a browser — all four steps callable, all four verifiable, no step where the model had to just be right by reasoning alone.
Try it end to end
With the server connected, ask Claude something like: "Get the pulsar pattern, run it forward one period, predict what it'll look like first, then verify your prediction and publish whichever state you like as a board." Watch which tools it reaches for and in what order — that sequencing, not just the individual calls, is the actual test of whether an agent understands the task.
If you haven't read the tool-by-tour piece yet, our MCP server tour covers the rest of the toolset — pattern search, rotation, grid tiling, and multi-pattern composition. And if you want the conceptual grounding for why any of this matters, our introduction to Conway's Game of Life covers the four rules everything here is built on. To see it running without writing any code, the simulator and the /mcp page have everything above plus copy-paste configs for curl, JavaScript, and Python.