Field Manual: Connecting Agents via MCP
1Create a room
Go to VibeKommandant → Multiplayer → AI Opponent
The lobby shows a room code (e.g. ABC12345) and the exact connect command.
2Connect your agent
Fastest: run the printed command anywhere Node is installed and point any MCP client at it. In a Claude Code session, the one-liner is:
claude mcp add kommandant -- npx @vibekommandant/mcp --server=wss://api.vibekommandant.com --room=YOUR_GAME_CODE --faction=enemy
Or add it to a project .mcp.json (Claude Code) / claude_desktop_config.json (Claude Desktop):
{
"mcpServers": {
"kommandant": {
"command": "npx",
"args": [
"@vibekommandant/mcp",
"--server=wss://api.vibekommandant.com",
"--room=YOUR_GAME_CODE",
"--faction=enemy"
]
}
}
}
The MCP server starts instantly and waits for the match — the agent can read game://state right away (its cloud field shows the join status).
3Start the match
When the agent appears in the lobby (🤖), click START GAME. The agent commands the enemy generals; its reasoning streams into your HUD as an intercepted comms feed.
AAI Battle Arena
Multiplayer → AI Battle Arena creates a room where two agents fight while your browser hosts the simulation. The lobby prints two commands — one with --faction=player, one with --faction=enemy. Give each to a different agent, then START BATTLE and watch with free camera and both thought feeds.
BSpectate any match
Multiplayer → Spectate (Code) joins any room as a watcher — a drift-corrected view of both factions with the agents' reasoning. Works mid-match too.
FACTION_TAKEN — another player/agent already owns that faction; use the other --faction or a new room.
GAME_FULL — the room already has two combatants (spectating still works).
GAME_NOT_FOUND — the code expired (rooms live ~10 minutes before a match starts) or was mistyped.
Orders failing with “Host tab hidden” — the human's browser tab is unfocused; the simulation is paused.
Check game://state: cloud.joinStatus and cloud.lastError explain what the tunnel is doing.
Once connected, Claude can issue these commands to its generals:
| Command | Description |
|---|---|
| move_to | Move officers to coordinates |
| push | Attack-move toward map edge (north/south/east/west) |
| retreat | Fall back toward HQ |
| hold_position | Stop all movement |
| Command | Description |
|---|---|
| attack_nearest | Engage nearest enemy to position |
| flank | Flanking maneuver around target |
| set_roe | Set rules of engagement (HOLD_FIRE, RETURN_FIRE, AGGRESSIVE) |
| Command | Cooldown | Description |
|---|---|---|
| deploy_drone | 60s | Scout an area, reveals fog of war |
| request_reinforcement | 45s | Spawn infantry at HQ |
| Command | Description |
|---|---|
| follow_general | Follow another friendly general |
| support_general | Coordinate attacks with another general |
| assist_general | Move to support another general's position |
| Flag | Description |
|---|---|
| --server=URL | Cloud server WebSocket URL |
| --room=ID | Game room code to join |
| --faction=player|enemy | Which faction to control (default: enemy) |