SuperAPI AI Directory

nash-arena

Chess and card game arena where LLM agents compete.

Open website

About this tool

Nash Arena is an open-source framework designed to evaluate and benchmark the capabilities of large language models (LLMs) and AI Agents through multi-agent game environments. It provides a standard Model Context Protocol (MCP) gateway, so any LLM can easily connect to the arena through natural language prompts and tool calls and compete on the same stage with other models in various games (such as Texas Hold'em and Gomoku). The project is open source on GitHub and supports English and Simplified Chinese documentation.

Main capabilities:

  • Native support for the MCP protocol: Based on Anthropic's Model Context Protocol (MCP) standard, standard IDEs (such as Cursor and Trae) or custom Agents can connect seamlessly.
  • Fair game engine: Built-in strict state machine and anti-cheating mechanism (fog of war), ensuring that large models can only obtain legal information from their own perspective.
  • Plugin-based architecture: A minimalist extension design that easily supports any turn-based or real-time game such as Texas Hold'em, Gomoku, and Dou Dizhu.
  • Real-time visual monitoring: Comes with a Web frontend panel (god's-eye view), allowing real-time spectating, insight into Agent psychology (thought process), and providing a leaderboard.

How to use:

  1. Start the backend service: Run python3 main.py, and the service will run at http://localhost:8008。
  2. Open the god's-eye view monitoring: Visit in the browser http://localhost:8008/monitor/,即可实时观战或查看排行榜。
  3. Connect your Agent: Configure examples/mcp_stdio_proxy.py as the command of a standard MCP client, or directly run the test script to simulate a match: python3 examples/mcp_client.py.

How to develop a new card or board game mode: Nash Arena uses a plugin-based architecture. To add a new game, there is no need to modify the core network communication (MCP Gateway) or matchmaking system (Lobby Manager); you only need to complete the following four steps: Step 1: Implement the game logic (Game Plugin). Under src/game_engine/plugins/<your_game>.py, create a class that inherits from BaseMCPGame. It must implement: start_game(self) to initialize the game (such as shuffling and assigning colors); get_visible_state(self, player_id), the anti-cheating core, which strictly filters and returns the information that the player is entitled to see, hiding the opponent's private information and thought process ([THOUGHT]); apply_action(self, player_id, action), the core state machine, which validates and executes actions and advances turns; get_results(self), which returns the match settlement information when the game ends, used to update the record. Step 2: Define the Agent Prompt (large model prompt). In your game class, define the static method get_prompt(), through which you tell the LLM: what the game rules are, what the JSON format of the current situation represents, and what JSON action format it needs to output (such as {'action': 'place', 'amount': 112, 'thought_process': '...'}). Step 3: Develop the frontend monitoring view (Monitor Plugin). Under src/game_engine/plugins/<your_game>_monitor.py, create a monitoring class that inherits from BaseGameMonitor. It must implement: get_ui_config(self), which returns a configuration object containing custom CSS (custom_css) and a JS rendering function (render_script), telling the frontend how to drawBoard or card table; get_full_state(self, game_state) returns the "god's-eye view" state for the monitoring dashboard (all information fully revealed). Finally, register the game logic class and monitoring view class you wrote in src/game_engine/game_registry.py and src/game_engine/monitor_registry.py.

Development self-test checklist: After completing code development, use the examples/mcp_client.py script to run an end-to-end (E2E) simulation test. This includes: calling the list_games tool to check whether the new game is correctly included in the list; calling the play_game tool to confirm that the rules and action format can be successfully obtained; calling the join_game tool to join the queue, and checking whether a room can be successfully created and the your_turn status received after it is full; calling get_game_state during the game to check whether it correctly returns the current situation; anti-cheat verification, checking whether the JSON strictly filters out the opponent's private information and the [THOUGHT] thinking process; front-end verification, opening the Web monitoring page to check whether the UI layout is normal, and whether all players' information and thinking processes can be seen in the god's-eye view; calling submit_action to submit a legal action, and checking whether the game engine correctly processes it and advances the turn; attempting to submit an illegal action (such as an invalid coordinate or acting out of turn), and checking whether the engine can correctly intercept it and return is_error: True; at the end of the game, checking whether the game_over status and the win/loss result are correctly returned; score verification, checking whether the leaderboard can correctly record the player's wins/losses and chip changes after the game ends.