MCP Games Server
Provides tools to start, reset, act in, and inspect OpenAI Gym/Gymnasium environments, including CartPole, MountainCar, FrozenLake, and Atari Breakout, with textual and visual state rendering.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
MCP Games Server
A Model Context Protocol (MCP) server that provides AI agents with access to a variety of classic games, Gymnasium environments, and board games through a unified tool interface.
Features
33+ MCP Tools for game interaction
Visual Rendering - Returns game states as base64 PNG images or SVG
Multiple Game Types - Classic control, board games, Atari games
Unified Interface - Consistent API across all game types
Rich Game State - Visual and textual game state information
Related MCP server: Gym MCP
Installation
# Clone the repository
git clone https://github.com/itsish/mcp-games-public
cd mcp-games-public
# Install dependencies
pip install -r requirements.txt
# Run the server
python -m src.mainQuick Start
For Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"mcp-games": {
"command": "python",
"args": ["-m", "src.main"],
"cwd": "/path/to/mcp-games-public"
}
}
}For MCP Inspector
npx @modelcontextprotocol/inspector python -m src.mainSupported Games
Classic Control (Gymnasium)
CartPole-v1 - Balance a pole on a moving cart
MountainCar-v0 - Drive a car up a steep mountain
FrozenLake-v1 - Navigate a frozen lake avoiding holes
Atari Games
Breakout - Classic brick-breaking arcade game
Board Games
Tic-Tac-Toe - Classic 3x3 grid game
Chess - Complete chess implementation with legal move validation
Connect Four - Drop pieces to connect four in a row
Blackjack - Casino card game (hit or stand to reach 21)
Multi-Agent Games (PettingZoo)
Chess (PettingZoo) - Two-player chess with full rule implementation
Available Tools
Game Management
list_games- List all available gamesstart_game- Start a new game instanceget_game_state- Get current game state with visual renderingreset_game- Reset game to initial stateend_game- End and cleanup game instance
CartPole Actions
cartpole_move_left- Move cart leftcartpole_move_right- Move cart rightcartpole_get_state- Get cart position, velocity, pole angle
MountainCar Actions
mountaincar_accelerate_left- Accelerate car leftmountaincar_accelerate_right- Accelerate car rightmountaincar_coast- Coast without acceleration
Breakout Actions
breakout_start- Start new Breakout gamebreakout_move- Move paddle (left/right/stay)breakout_get_state- Get game state with visual frame
Blackjack Actions
blackjack_start- Start new Blackjack gameblackjack_hit- Draw another cardblackjack_stand- Keep current handblackjack_get_state- Get current hand and dealer's visible card
Tic-Tac-Toe Actions
tictactoe_start- Start new Tic-Tac-Toe gametictactoe_place- Place X or O at positiontictactoe_get_state- Get board state
FrozenLake Actions
frozenlake_move_up- Move player upfrozenlake_move_down- Move player downfrozenlake_move_left- Move player leftfrozenlake_move_right- Move player right
Chess Actions
chess_move- Make a chess move (e.g., "e2e4")chess_get_legal_moves- Get all legal moves for current positionchess_analyze_position- Get position analysis and evaluation
Connect Four Actions
connectfour_start- Start new Connect Four gameconnectfour_drop_piece- Drop piece in column (0-6)connectfour_get_state- Get board state with visualconnectfour_get_valid_moves- Get list of valid columnsconnectfour_undo_move- Undo last moveconnectfour_get_winner- Check if game has a winner
PettingZoo Chess Actions
pettingzoo_chess_start- Start PettingZoo chess gamepettingzoo_chess_move- Make move using action indexpettingzoo_chess_get_state- Get board observationpettingzoo_chess_get_legal_actions- Get legal action indices
Example Usage
# Start a game
response = await start_game(game_type="CartPole-v1", player_name="AI_Agent")
# Get visual state
state = await cartpole_get_state(game_id=response.game_id)
# Returns state with base64 PNG image of current frame
# Make a move
result = await cartpole_move_right(game_id=response.game_id)
# For chess
await chess_move(game_id=chess_id, move="e2e4")
legal_moves = await chess_get_legal_moves(game_id=chess_id)Visual Rendering
All games support visual rendering in responses:
PNG Images: Returned as base64-encoded strings for pixel-based games
SVG Rendering: Vector graphics for board games and simple environments
Automatic Format Selection: Games choose the best visualization format
Architecture
FastMCP Framework: Simple, decorator-based MCP server implementation
Game Registry: Centralized management of game types and instances
Gymnasium Integration: Direct integration with OpenAI Gym environments
Modular Design: Easy to add new games and environments
Requirements
Python 3.10+
See
requirements.txtfor package dependencies
License
MIT License
Contributing
Contributions welcome! Feel free to:
Add new games or environments
Improve visualization rendering
Enhance game state representations
Fix bugs or improve documentation
Support
For issues or questions, please open an issue on GitHub.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Games for AI agents. Each game runs inside a single context window.
The game engine built for AI. Any agent makes a multiplayer game and publishes it.
Games for AI agents: negotiation, social deduction, racing and puzzles, vs bots and agents.
Agent-only board-game hall: 12 verifiable games — chess, Go, backgammon, and 8-seat Werewolf.
Related MCP Servers
FlicenseAqualityDmaintenanceEnables AI agents to deploy multiplayer web games as playable URLs with rooms, live state sync, and leaderboards, all through a single tool call.45-- FlicenseNot gradedqualityDmaintenanceEnables AI agents to discover and play games like Tic-Tac-Toe through a standardized interface, with plans to integrate more environments.1-
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to create, run, and debug 2D games in a sandboxed engine, providing tools for simulation, state inspection, and quality validation.1MIT
- AlicenseAqualityBmaintenanceEnables LLM agents to play full games of Civilization VI by connecting to running game instances via the FireTuner debug interface, with 76 tools for units, cities, diplomacy, research, and turn management, plus narration of game state through rule-enforcing APIs without requiring vision models.80MIT