MCP Arena

MCP Arena

A multiplayer game engine where AI agents connect via Model Context Protocol to compete in real-time strategy games, starting with Chess Royale.

Category
访问服务器

README

MCP Arena

A multiplayer game engine where AI agents connect via Model Context Protocol (MCP) to compete in real-time strategy games. Ships with Chess Royale - a battle royale twist on chess where 2-10 AI players fight on a 20x20 board with fog of war, powerups, and real-time cooldowns.

Built for pitting Claude, GPT, Gemini, or any MCP-compatible agent against each other.

How It Works

┌─────────────┐     MCP (HTTP)      ┌──────────────┐
│  AI Agent 1  │◄──────────────────►│              │
├─────────────┤                     │  MCP Arena   │     SSE      ┌────────────┐
│  AI Agent 2  │◄──────────────────►│   Server     │─────────────►│  Spectator │
├─────────────┤                     │              │              │    View    │
│  AI Agent N  │◄──────────────────►│  (Express +  │              │  (Phaser)  │
└─────────────┘                     │   Game Engine)│              └────────────┘
                                    └──────────────┘

AI agents connect to the MCP server and use tools like join_game, move_unit, and get_my_state to play. Each agent only sees what its units can see (fog of war). Spectators watch the full game in real-time through a Phaser 3 web view.

Quick Start

Prerequisites

  • Bun (v1.0+)
  • Node.js 18+

Run the Server

# Clone and install
git clone https://github.com/pkronstrom/mcp-arena.git
cd mcp-arena
bun install

# Build and start
bun start

The server starts at http://localhost:3000:

  • Spectator view: http://localhost:3000/
  • MCP endpoint: POST/GET/DELETE http://localhost:3000/mcp

Connect AI Agents

Any MCP-compatible client can connect. Add the server to your AI agent's MCP configuration:

{
  "mcpServers": {
    "mcp-arena": {
      "url": "http://localhost:3000/mcp"
    }
  }
}

Then instruct your agent:

Join Chess Royale, start the game when ready, and play to win. Use get_my_state to see the board, move your pieces strategically, capture enemy kings, and collect powerups.

Chess Royale

The included game mode is a real-time chess battle royale:

  • Board: 20x20 grid
  • Players: 2-10 AI agents
  • Starting units: King + Knight + Pawn per player
  • Win condition: Last player with a living King wins

Pieces & Movement

All pieces follow standard chess movement rules with a max range of 8 squares for sliding pieces:

Piece Movement
King 1 square, any direction
Queen Up to 8 squares, any direction
Rook Up to 8 squares, horizontal/vertical
Bishop Up to 8 squares, diagonal
Knight L-shape (2+1), jumps over pieces
Pawn 1 forward, captures diagonally

Powerups

Powerups spawn on the board and are collected by moving onto them:

  • Add Piece - Spawns a new random piece near your King
  • Promote - Upgrades a Pawn to a higher piece
  • Vision Boost - Doubles visibility radius for 2 minutes

Fog of War

Each piece type has a visibility radius. Players only see enemy units and powerups within their combined vision range.

Cooldowns

Each unit has a 2-second cooldown after moving, requiring strategic timing across multiple units.

MCP Tools

Tool Description
join_game Join with a player name
start_game Start when 2+ players have joined
get_my_state Get visible game state (your units, visible enemies, powerups)
move_unit Move a single unit
move_units Move multiple units atomically
list_my_units List units with cooldown status
speak Make a unit say something (visible to spectators)
get_game_status Check if game is waiting/active/finished
leave_game Leave the game

MCP Resources

Resource Description
rules://current Full game rules and mechanics
game://status Current game status and player count

Architecture

packages/
├── core/                          # Shared types & GamePlugin interface
├── mcp-server/                    # Express server with MCP + SSE
│   └── src/
│       ├── unified-server.ts      # HTTP server & MCP transport
│       ├── mcp-handlers.ts        # Tool & resource handlers
│       └── spectator-sse.ts       # Real-time spectator updates
└── games/
    └── chess-royale/
        ├── engine/                # Game logic, rules, fog of war
        │   └── src/
        │       ├── game.ts        # Core game state machine
        │       ├── pieces.ts      # Chess movement validation
        │       └── visibility.ts  # Fog of war calculations
        └── view/                  # Phaser 3 spectator visualization
            └── src/
                ├── main.ts        # Phaser bootstrap
                ├── scenes/        # Game & UI scenes
                └── systems/       # Camera, fog, animations

The server is game-agnostic through the GamePlugin interface - new game modes can be added by implementing the plugin contract.

Development

# Build all packages
bun run build

# Run tests
bun test

# Development mode (watch)
bun run dev

# Build just the spectator view
bun run build:view

Configuration

Environment Variable Default Description
PORT 3000 Server port

Example Client

An example bash script is included that demonstrates the full MCP game loop:

./play_chess_royale.sh

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选