API & MCP

Everything a person can do on Go Score Counter (SGF), a program or AI agent can do with the same inputs and get the identical result.

HTTP API

  • POST https://playcardsgoscore.usefulweb.app/api/v1/calculate – run Go Score Counter (SGF)
  • GET https://playcardsgoscore.usefulweb.app/api/v1/tool – inputs, output schema, examples
  • OpenAPI 3.1: /openapi.json · /openapi.yaml
  • Errors: application/problem+json; 422 includes per-field errors.

Go Score Counter (SGF)

Paste a finished Go game as SGF (any board size up to 19×19) and the counter replays it, removes the dead stones and scores it: area scoring (stones on the board plus surrounded empty points, as in Chinese and AGA rules) or territory scoring (surrounded points plus captured stones, as in Japanese and Korean rules), with komi for White. Dead stones come from the territory marks most Go programs write into the SGF at the end of a game, from your own list, or from a rough computer estimate. You get the result in SGF form (B+3.5), the count for both sides, a picture of the final board with territory and dead stones, and the SGF with the counted territory. The Playcards Go table scores with the same engine.

Inputs of Go Score Counter (SGF)
FieldTypeDefaultDescription
sgftextarea"(;GM[1]FF[4]SZ[9]KM[7.5]RU[Chinese]PB[Black]PW[White]RE[B+1.5]\nAB[ea][eb][ec][SGF game. A Go game in SGF: (;GM[1]SZ[9]KM[7.5];B[ee];W[gc]…). Only the main line is read. Setup stones (AB/AW) count as part of the position.
deadFromselect (marks, list, estimate)"marks"Dead stones
deadStonestext—Dead stones (optional). Points like D4 (A1 = bottom left, no letter I) or SGF pairs like dd. One stone marks its whole chain as dead.
rulesselect (sgf, area, territory)"sgf"Scoring
komitext—Komi (optional). Points for White. Empty: the KM property, else 7.5 (area) or 6.5 (territory).

Example request

Finished 9×9 game with territory marks (area scoring)

curl -X POST https://playcardsgoscore.usefulweb.app/api/v1/calculate -H 'content-type: application/json' -d '{"sgf":"(;GM[1]FF[4]SZ[9]KM[7.5]RU[Chinese]PB[Black]PW[White]RE[B+1.5]\nAB[ea][eb][ec][ed][ee][ef][eg][eh][ei][hh]\nAW[fa][fb][fc][fd][fe][ff][fg][fh][fi][bb]\nTB[aa][ab][ac][ad][ae][af][ag][ah][ai][ba][bb][bc][bd][be][bf][bg][bh][bi][ca][cb][cc][cd][ce][cf][cg][ch][ci][da][db][dc][dd][de][df][dg][dh][di]\nTW[ga][gb][gc][gd][ge][gf][gg][gh][gi][ha][hb][hc][hd][he][hf][hg][hh][hi][ia][ib][ic][id][ie][if][ig][ih][ii])"}'

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://playcardsgoscore.usefulweb.app/mcp – protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake).
  • Tools: playcards_go_score
  • Local stdio connector: node src/mcp-stdio.ts --tool=playcards-go-score
{
  "mcpServers": {
    "playcards-go-score": { "type": "http", "url": "https://playcardsgoscore.usefulweb.app/mcp" }
  }
}