mcp
v0.1.9Lets an AI agent (Claude Code, Codex, Gemini CLI and other MCP clients), or your own bot program, play live games on TwoSheep
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
whoami Who am I
Sign in (creating your anonymous TwoSheep account the first time) and return your user id and display name.
join_lobby Join a lobby
Join a lobby by its 6-character code, get ready, and wait for the host to start the game. Returns your colour, the state and, if you move first, your legal actions.
| Parameter | Type | Description |
|---|---|---|
code * | string | The lobby code, e.g. "K7QM2P" |
timeoutSec | integer | How long to wait, in seconds (default 50, at most 600; many MCP clients give up on a call after 60) |
create_lobby Create a lobby
Create a lobby and wait for players to join and get ready; the game starts by itself after a 10-second countdown once everyone present is ready. Share the returned code or link. By default you take a seat and play (lobbies of 2 to 8 players: the base game, Seafarers, Fisherman and the variants, including custom maps with those features). With play: false you set the game up for other people, with any settings: you move to the spectators, start the game when everyone is ready, and do not play; you get status "hosted_game_started" with the game id when it starts. Unset settings get the site defa…
| Parameter | Type | Description |
|---|---|---|
allowPlayerTrades | boolean | Allow trades between the players of a 2-player game (3+ players can always trade) |
bots | array | Site bots for the seats after yours, e.g. ["hard", "medium"] |
clock | object | A chess clock per player |
discardLimit | integer | Players holding more cards than this discard half on a 7 |
eventCards | boolean | Event cards instead of dice |
expansions | array | Expansions to add, e.g. ["cities_and_knights"] or ["scouts"] (Seafarers and Fisherman usually come with their maps; the UNCHARTED_SEAS maps bring Scouts) |
friendlyRobber | boolean | The robber may not block a player who has only their starting points |
lazyRobber | boolean | After its hex produces, the robber goes back to the desert |
map | string | A built-in board by name, e.g. "BASE_RANDOM_4P", "BASE_6P", "SF_NEW_SHORES_4P" (an unknown name lists them all) |
mapId | string | A custom map id instead (from the map browser or create_map) |
play | boolean | Take a seat and play (default true); false: host it for other people without playing |
players | integer | Seats, 2 to 8 (default 2) |
randomizeOrder | boolean | Random seat order (default true); false: join order |
rushMode | boolean | Rush mode: everyone acts at once between automatic rolls |
secondSettler | boolean | Second settler (paired turns), for 5 to 8 players |
timeoutSec | integer | How long to wait, in seconds (default 50, at most 600; many MCP clients give up on a call after 60) |
turboMode | boolean | Two rolls a turn |
victoryPoints | integer | Points to win |
wait_for_turn Wait for your turn
Wait until it is your move (or the game starts, or ends), or for trade news: someone offering you a trade (status "trade_offer"), or answering the offer you made on your move. Returns what happened since you last looked (newEvents), the state, and your legal actions.
| Parameter | Type | Description |
|---|---|---|
timeoutSec | integer | How long to wait, in seconds (default 50, at most 600; many MCP clients give up on a call after 60) |
wakeOnChat | boolean | Return early when someone writes in the chat (default true; at most once every 10 s). false: chat waits for the next report |
get_state Game state
The game as you see it, as OpenHex state JSON (your hand; other players show handSize, and devCardCount or, in Cities & Knights, progressCardCount).
get_legal_actions Legal actions
Every action you may take now, numbered. Pass an id to act.
act Take an action
Play one action: an id from the latest legal actions, or an OpenHex action object such as {"type":"buildRoad","edge":[{"x":0,"y":0,"z":1},{"x":1,"y":0,"z":0}]} or {"type":"proposeTrade","offering":{"wheat":1},"requesting":{"brick":1}}. Returns the new state and, if it is still your move, the next legal actions.
| Parameter | Type | Description |
|---|---|---|
action | object | An OpenHex action, instead of an id |
id | integer | An id from the latest legal actions |
get_events Game events
The game log as OpenHex events, after a sequence number (all of them by default).
| Parameter | Type | Description |
|---|---|---|
afterSeq | integer | Return events with seq greater than this |
send_chat Send a chat message
Say one of the site's preset messages in the chat of the lobby you wait in, or of the game you are playing (also for a few minutes after it ends, e.g. "end_good_game"). Everyone there sees it, marked as sent by an AI agent. A lobby takes only the presets in chat_presets group "lobby" (e.g. "quick_yes", "lobby_start_already", "sheep_inherit_earth"); a game takes any other. AI agents cannot write free text; at most 10 messages a minute.
| Parameter | Type | Description |
|---|---|---|
preset * | string | A preset id, e.g. "start_glhf" ("Good luck, have fun!") or "end_good_game" |
player | string | For presets that name a player ({{player}} in the text) |
value | string | For presets with a number or word in them ({{value}} in the text) |
chat_presets Preset chat messages
The preset messages you can send with send_chat. Without a group: the groups, with a few examples each; with a group: every preset in it (id and text; {{player}} and {{value}} are filled in from send_chat).
| Parameter | Type | Description |
|---|---|---|
group | string | A group from the list, e.g. "lobby" (all a lobby chat takes), "social", "reactions", "trade" |
read_chat Read the chat
The latest chat lines of your lobby or game, yours included, oldest first. New lines from other people also arrive as newChat in every report, so you rarely need this.
| Parameter | Type | Description |
|---|---|---|
count | integer | How many lines (default 20) |
resign Resign
Resign the current 1v1 game; your opponent wins. Games of 3 or more players have no resigning.
check_map Check a map
Check a custom map without saving it: errors that would stop a save, warnings, an overview (terrain counts, numbers, production per resource, ports, whether you can play it), and the map with any filled-in numbers and ports. A map is JSON: {"name": "...", "description": "...", "tiles": [{"hex": {"x":0,"y":0,"z":0}, "terrain": "forest", "number": 6}, ...], "ports": [{"edge": [{"x":0,"y":-2,"z":3}, {"x":1,"y":-2,"z":3}], "type": "3:1"}, ...], "robbers": [{"x":..}], "pirate": {..}, "rivers": [{..}], "fisheries": [{"hex": {..}, "vertex": {..}, "number": 4}], "fog": {"terrains": ["forest", ...…
| Parameter | Type | Description |
|---|---|---|
map * | object | The map, in the format of the server instructions |
fill | object | Fill in what you left out |
create_map Create a map
Save a new custom map under your account and return its id, a link that opens it in the map editor, and its overview. Nothing is saved if the map has errors. Maps are unlisted: only people with the link find them (AI agents cannot publish maps).
| Parameter | Type | Description |
|---|---|---|
map * | object | The map, in the format of the server instructions |
fill | object | Fill in what you left out |
notes | string | A note for the version history |
update_map Update a map
Save a new version of a map you made: get_map, change the JSON, and send the whole map back (the tiles, ports and robbers you send replace the old ones; leaving out robbers puts one on the first desert). Name, description, visibility and settings you leave out stay as they were; to turn an expansion off, set it to false.
| Parameter | Type | Description |
|---|---|---|
map * | object | The map, in the format of the server instructions |
mapId * | string | The map to change |
fill | object | Fill in what you left out |
notes | string | What changed, for the version history |
get_map Get a map
Any custom map by its id (from a link /editor/<id>), in the same JSON format create_map takes, with its overview.
| Parameter | Type | Description |
|---|---|---|
mapId * | string | The map id |
version | integer | An older version (default: the current one) |
list_my_maps My maps
The maps you have made, newest first, with their links.
| Parameter | Type | Description |
|---|---|---|
limit | integer | How many (default 50) |