API & MCP
Everything a person can do on Board Game Solver, a program or AI agent can do with the same inputs and get the identical result.
HTTP API
POST https://playcardsboardsolver.usefulweb.app/api/v1/calculate– run Board Game SolverGET https://playcardsboardsolver.usefulweb.app/api/v1/tool– inputs, output schema, examples- OpenAPI 3.1: /openapi.json · /openapi.yaml
- Errors:
application/problem+json;422includes per-fielderrors.
Board Game Solver
Enter a Four in a Row position as the moves played so far (column digits 1–7, e.g. 4453) or as a 6-line grid, and the solver searches it to the end of the game: does the player to move win, lose or draw with perfect play, how fast, and what is every column worth. Positions with many empty cells take too long to solve exactly — the solver then stops at the node limit and says so instead of guessing. The Playcards computer player uses the same solver near the end of a game. Kalah endgames work the same way: enter both rows of pits with their stores and who is to move, and the solver plays every line to the end and gives the final store difference for each pit.
| Field | Type | Default | Description |
|---|---|---|---|
game | select (fourinrow, kalah) | "fourinrow" | Game |
position | textarea | "52753311433677442422121" | Position. Four in a Row: moves as column digits 1–7 from the first move on, or 6 lines of 7 cells (X = first player, O = second, . = empty), top row first. Kalah: “south: 0 0 0 2 1 1 | 20”, “north: …” (pits from each player’s left, store after |) and “to move: south”. |
maxNodes | integer | 2000000 | Search limit (positions). The solver stops after this many positions and reports “not solved”. |
Example request
A win in one move (14 stones)
curl -X POST https://playcardsboardsolver.usefulweb.app/api/v1/calculate -H 'content-type: application/json' -d '{"game":"fourinrow","position":"44444433333322"}'
Every result contains
inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.
MCP (Model Context Protocol)
- Streamable HTTP endpoint:
https://playcardsboardsolver.usefulweb.app/mcp– protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake). - Tools:
playcards_board_solver - Local stdio connector:
node src/mcp-stdio.ts --tool=playcards-board-solver
{
"mcpServers": {
"playcards-board-solver": { "type": "http", "url": "https://playcardsboardsolver.usefulweb.app/mcp" }
}
}