Skip to main content
Glama
README.md
# TabletopMCP — Open-Source MCP Server, Common Skill & AI Connectors

**English** | [简体中文](./README.zh-CN.md) | [日本語](./README.ja.md) | [한국어](./README.ko.md)

Play **18+ classic 3D board games** right alongside your AI assistant on [tabletopmcp.com](https://tabletopmcp.com) — Chess, Xiangqi (Chinese Chess), Shogi, Gomoku, Four in a Row, Reversi, Checkers, Backgammon, Dominoes, Jungle (Dou Shou Qi), Aeroplane Chess, Chinese Checkers, Mancala, Nine Men's Morris, Dots and Boxes, Sea Grid, Snakes and Ladders, and more.

Say *"Let's play Aeroplane Chess"* in **Claude Desktop, Cursor, Claude Code, Codex, or OpenClaw** — your AI creates a live room, **automatically opens the 3D board in your browser already seated**, plays + chats with you in real time, and remembers your playstyle per game in `.tabletopmcp/`.

---

## Repository Structure

```text
tabletop-mcp/
├── packages/
│   └── mcp-server/       # @tabletopmcp/server — Official stdio MCP server (npm)
├── skills/
│   └── tabletopmcp/      # Common Agent Skill (Codex, Claude Code, OpenClaw)
└── plugins/              # Platform plugins (DSH, Workbuddy, LobeChat, etc.)
```

---

## Quick Start (`@tabletopmcp/server`)

1. Get a free API key at [tabletopmcp.com/en/account/#api-key](https://tabletopmcp.com/en/account/#api-key) (no sign-up required; optional for browsing games, required to create rooms).
2. Add to **Claude Desktop** (`claude_desktop_config.json`) or **Cursor** (`.cursor/mcp.json`):

```json
{
  "mcpServers": {
    "tabletopmcp": {
      "command": "npx",
      "args": ["-y", "@tabletopmcp/server"],
      "env": {
        "TABLETOPMCP_API_KEY": "tt_live_your_key_here"
      }
    }
  }
}
```

Or add to **Claude Code**:
```bash
claude mcp add tabletopmcp -e TABLETOPMCP_API_KEY=tt_live_your_key_here -- npx -y @tabletopmcp/server
```

Or connect directly via **Remote Streamable HTTP** (no local install):
```
https://api.tabletopmcp.com/mcp
```
with header `Authorization: Bearer tt_live_your_key_here`.

---

## 4-Tool Chain (`status` + `next_action`)

Every response returns `status` and `next_action` (including `suggested_wait_ms` and `max_wait_remaining_s` when waiting), forming an unbroken agent loop:

| Tool | Role |
| --- | --- |
| `list_games` | Browse all 18+ playable 3D board games (`category`, `player_count`, `query`, `lang`). |
| `start_game` | Unified entry: `mode: "create"` (auto-opens 3D board for the human), `"join_invite"` (accept invite URL/code), or `"invite"` (shareable invite). Loads `.tabletopmcp/` memory. |
| `handle_game` | Aggregated loop driver: execute `action` (`take_seat`, `move`, `wait`, `chat`, `state`, `rules`, `release`, `resign`) + optional `chat` / `memory_note` sub-actions + bounded async waiting (default 5s, max 20s). |
| `review_game` | Fetch move-by-move review, highlights, and replay URL after a match, optionally send post-game `chat`, and persist `memory_note` to `.tabletopmcp/games/<game_id>.md`. |

---

## Built-in Common Skill & Per-Game Memory (`.tabletopmcp/`)

- **Built-in Skill**: Exposed automatically via MCP `instructions`, Resource `tabletopmcp://skill/common`, Prompt `play_board_game`, and `skills/tabletopmcp/SKILL.md`.
- **Per-Game Local Memory**: Automatically creates `.tabletopmcp/profile.md` and `.tabletopmcp/games/<game_id>.md` in your workspace so your AI remembers your favorite games, opening habits, and match history across sessions. Set `TABLETOPMCP_MEMORY=0` to disable or `TABLETOPMCP_MEMORY_DIR` to customize the path.

---

## Development

```bash
pnpm install
pnpm build
pnpm typecheck
pnpm test
```

## License

MIT © [TabletopMCP](https://tabletopmcp.com)