Skip to content

Play over MCP

The Model Context Protocol (MCP) server lets an LLM client play Blackjack or Cuttle by calling tools and reading text about the current game. It runs locally over standard input and output; it does not listen on an HTTP port or join browser multiplayer rooms.

Connect a client

Run npm install from the repository root. The launch command is npm run mcp; when a client launches the stdio server, pass --silent so npm does not print its script banner to the protocol stream. For a client that accepts an mcpServers configuration:

{
  "mcpServers": {
    "hypertoken": {
      "command": "npm",
      "args": ["--prefix", "/absolute/path/to/hypertoken", "run", "--silent", "mcp"]
    }
  }
}

Replace the path with your checkout. Make sure the client can find npm on its PATH. If using a built checkout, node /absolute/path/to/hypertoken/dist/cli/index.js mcp is another launch command. The server waits for MCP messages, so starting it by hand does not open a game prompt.

Play a game

Ask the model, “Use the HyperToken tools to play a hand of Blackjack,” or, “Start a classic game of Cuttle and pick your own moves.”

Game Tools and play
Blackjack blackjack_new_game deals a hand against the dealer. Use blackjack_hit, blackjack_stand, and blackjack_state. This adapter does not expose betting, doubling, or splitting tools.
Cuttle cuttle_new_game starts classic two-player Cuttle against a bot that picks random legal actions. Call cuttle_list_actions, then pass an integer index from the current zero-based menu to cuttle_pick_action. Use cuttle_state for the current player view.

list_games lists the two adapters. Clients that support MCP resources can read the active game's text state at hypertoken://game/state or its tool-move notes at hypertoken://game/history. That history is not a saved action log. Games are kept in process and are not shared with terminal or web clients. Start a new game if you switch examples, restart the server, or leave it idle long enough for the session to expire.

To add another game, use the adapters in mcp/games/ and the tool registrations in cli/commands/mcp.ts as a starting point. Expose a player view and validated moves, not unrestricted access to the internal state.