HexSet MCP Server
Provides ONNX model inference support, allowing the server to load and run ONNX checkpoint files as bot opponents and validate them against the ONNX model contract.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
HexSet
HexSet implements a hex-tile trading and building game based on the rules of Settlers of Catan: a NumPy rules engine, ONNX model inference, a browser interface, HTTP and MCP interfaces, Gymnasium and PettingZoo adapters, and batched environments for training and evaluation.
The engine covers resource production, construction, development cards, the robber, victory conditions and player trading. It owns the rules, information sets, encoding, game loops, seating and board pairing, records and replay, and trade evaluation. A training project supplies the model runtime and the learning algorithm through those interfaces; neural-network training and checkpoint export live in the sibling HexN project.
HexSet ships no playing bots. Its entrants are random (uniform over legal
actions), retired (an empty seat), the network:, mcts: and rollout:
checkpoint kinds (one forward per decision, PUCT search, paired rollouts),
which need a model runtime, and catanatron, Catanatron's alpha-beta player
seated at a HexSet table as an external reference (optional extra). The
coalition: and handoff: wrappers seat any of them as a coalition member
or hand a seat from one bot to another at a round. Every other bot is
registered in process or joins over the API.
Documentation
Start with guide.md; the rest are listed by name.
Document | Contents |
JSON routes, seat tokens, client identity and reclaim | |
Designing a comparison, the intervals the runners report, experiment records | |
Running games, trade rounds, implementing and registering a bot, records, bench commands, the public interface | |
A bot seat at a table hosted elsewhere: the observed game it plays forward | |
MCP tools and their semantics | |
Native game lanes: the optional C++ core, batched native requests, native playout copies | |
The ONNX model contract: record and decision graphs, metadata, committees, and checking a file against it | |
Running the server: configuration, Docker, saved games, the rankings | |
Markers, optional extras, a complete check | |
Trading's three parts: the table's rules, a gate's own | |
Batched collection, the driver, model runtimes, search, decision observations, PettingZoo and Gymnasium adapters | |
Cached votes over sampled worlds |
Related MCP server: rain-go
Your own bots
A bot is anything with choose(game) -> Action; trading is an optional gate
(hexset.bots.Bot, TradeGate). It reaches a table in process or over the
API.
In process. A module registers how to build it when imported:
from hexset.arena import Entrant, register_entrant_kind, register_preset
register_entrant_kind("mybot", lambda entrant, board, rng: MyBot(board, rng))
register_preset("mybot", Entrant("mybot", kind="mybot"))Every command that names bots takes --runtime <module> (repeatable) and
imports it first, in each worker process too:
python -m hexset.bench.duel mybot random --runtime mybots --games 400
python -m hexset.server.web --runtime mybotsHexSetEnv(opponents=("mybot",) * 3, runtime=("mybots",)) seats it in the
Gymnasium wrapper. hexset.arena.load_runtime("mybots") is the same import in
code; register_spec adds a parsed spelling (mybot:depth=3) beside a
preset. A name means one bot: registering a different one under a taken name
raises ValueError, HexSet's own names (random, retired, catanatron)
and prefixes (network:, mcts:, rollout:, catanatron:, coalition:,
handoff:) are refused, and
unregister_* frees a name (docs/guide.md).
Over the API. A bot in any language joins a served table as a player
(POST /api/join), reads /api/state and acts through /api/action, as a
browser does (docs/api.md). python -m hexset.clients.botclient is an example of such a client. A Python bot
that keeps an engine-side game in step with a table hosted elsewhere uses
hexset.seat.Seat (docs/hosted.md).
Installation
Requires Python 3.11 or later. From the repository root:
pip install -e .The base installation requires only NumPy. Installation also builds two optional C++17 extensions, a road-query core and the native game core (native.md); where no compiler is found it goes on without them and the Python engine plays every game. Install extras for the interfaces you use:
Extra | Provides |
| ONNX Runtime for embedded model opponents |
| ONNX Runtime for standalone model clients |
| Gymnasium and PettingZoo environments |
| greenlet, so |
| Catanatron integration, pinned to a specific Git commit |
| ONNX and ONNX Runtime libraries; no training or export command is included |
| Playwright, for the browser tests; the browser itself is |
| pytest |
Extras can be combined, for example pip install -e ".[server,gym,test]".
Play in a browser
python -m hexset.server.webThe server listens on http://127.0.0.1:8770 (--host, --port) and opens
that URL in a browser unless --no-browser is given. Share a game's URL to
invite other players. The New game button asks for the board (spiral, the
default, or random) and whether to play the duel rules (15 points, discard
above 9, a friendly robber and balanced dice, at two seats). A new game seats
its creator and leaves the other seats open: all four without duel rules, and
one with them, the other two closed for good. Fill open seats with people or
bots, or close a seat with the picker's none option. Play starts once every
seat is filled or closed. Until the first move a seat can be closed, reopened
or given a bot, except at a duel table; after it the seats are fixed.
The opponent picker lists every preset a --runtime registered, catanatron
when its extra is installed, and each *.onnx file in models/ (or
$HEXSET_UI_MODELS_DIR) by the name its metadata declares, at the game
types its modes declare (standard only when it declares none); the filename
plays no part, its version is shown with it, and a file declaring no name is
not listed. One name may be one file at some game types and another at the
rest; two files offering one name at one game type are neither offered there.
python -m hexset.clients.onnxmeta stamp names a file. The directory is
rescanned on each listing, so a file dropped there appears without a restart;
it must meet the ONNX model contract.
A bot or open seat's name opens the bot cards: one per bot the table's game type offers, with its version and the description its profile declares. Tapping a card seats that bot; before the first move the seat can be left open or closed instead.
The page plays other seats' actions back as they happen: captions at the foot of the board name each one, cards drawn as their glyphs, newest at the bottom; the dice roll, pieces drop in, the robber moves, and each seat's row shows the cards the action gained or lost it. Each action is held long enough to read, and a click on the board finishes the playback. A seat's own moves are drawn at once. A hex whose number comes up under the robber flashes red. A table's bots send each move as soon as they decide it. The speaker button in the board's top-left corner turns sound on for every seat's moves, off until a browser asks for it: recorded card, chip and dice clips and two end-of-game jingles, CC0, from Kenney's Casino Audio and Music Jingles.
The trade modal makes bank and port trades, offers to other players, and answers to their offers. A bot seat makes as many offers a turn as its own gate declares and waits for manual seats to answer. A manual seat has no card limit beyond its hand, and one holding no resource cards is passed on every offer.
GET /api/table/<code> needs no seat token and returns the whole game: every
hand, development card and victory point. Anyone with the game URL can read
it, players at that table included, so a served game does not keep hands
secret between participants. Reads with a seat token filter hidden
information.
A server started with --ranker also shows rankings at /rankings, and as
a tab of the game page's menu. Only ranked games count: tables the server deals
from a queue that API clients and models join, never the page. The server
only shows them: the function --ranker names makes them from every ranked
game
(docs/server.md).
Configuration, Docker, journals and recovery are in docs/server.md.
Repository layout
Path | Contents |
| Rules, board topology, state, ledger, encoding, records, search, and arena |
| The bot and trade-gate protocols, |
| Duels, baselines, trade censuses, throughput measurements and record generation |
| Seats a Catanatron |
| HTTP and MCP server, sessions, journals, and static browser UI |
| Runtime-independent policy, trade, and search interfaces; ONNX inference; bot clients |
| Lane, driver, PettingZoo, and Gymnasium environments |
| The optional C++ game core and its Python bindings: native state, batched requests, playout copies |
| Engine and integration tests |
| ONNX opponents the server's picker lists; empty as shipped |
| The documents indexed above |
Tests
pip install -e ".[test,server,export,catanatron,gym,browser]"
playwright install chromium
pytest
pytest -m slowThe default run excludes tests marked slow; pytest -m "" runs every
marker. Tests for an optional dependency skip themselves when it is absent, so
the installed extras decide what a green run covered.
docs/testing.md maps each extra to its tests, including the
browser tests, which need a Chromium download beyond their extra.
License and attribution
HexSet is licensed under GPL-3.0-only. See LICENSE. Development history is in CHANGELOG.md; each release is also one commit here, whose message is that version's entry.
Dependencies are installed from PyPI or from git, never vendored into this
repository, and each carries its own licence; the set and their extras are
declared in pyproject.toml. Catanatron is GPL-3.0. The
browser interface in
hexset/server/static/index.html loads no third-party scripts, stylesheets or
web fonts; its system font stack names fonts already on the user's device.
CATAN and SETTLERS OF CATAN are trademarks of Catan GmbH and Catan Studio. HexSet is not affiliated with, endorsed by, or sponsored by either company. The names identify the game whose rules this project implements.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Make games with AI: one MCP server that connects your agent to Unity, Unreal and Godot editors.
Create and manage trading strategies, bots, webhooks and signals from any MCP client.
Verified component catalog over remote MCP: agents pick component ids and get a stamped project repo that builds. Connect at https://www.botkelp.com/mcp. Auth: MCP OAuth 2.1, or a Bearer bk_live_ API key; initialize and tools/list are open.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables any local AI agent to play turn-based games over MCP by exposing reset, observe, and act verbs with structured observations and validated legal actions.61MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI and humans to play 10 board, card, and dice games together via MCP tools, with seat-based multiplayer and server-side hidden-hand isolation.21MIT
- AlicenseAqualityCmaintenanceEnables MCP-compatible AI agents to play full Civilization VI games by reading game state and issuing rule-enforced actions such as moving units, managing cities, conducting diplomacy, and ending turns.76MIT
- AlicenseNot gradedqualityCmaintenanceEnables MCP clients to connect to a running browser-based strategy game server and inspect state, issue validated moves and actions, manage cities, units, research, and production, chat, and receive turn/chat events without browser automation.AGPL 3.0