Gym MCP
Intended to wrap OpenAI Gym environments for AI agent training and evaluation.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Gym MCPstart a tic-tac-toe game with players Alice and Bob"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Gym MCP - AI Gaming Platform
A Model Context Protocol (MCP) server that exposes games as tools for AI agents to discover and play.
๐ Quick Start
Requirements
Python 3.10+
MCP-compatible client (Claude Desktop, etc.)
Installation
Using pip:
git clone <this-repo>
cd gym-mcp
pip install -e .Or using uv (recommended by Dedalus Labs):
git clone <this-repo>
cd gym-mcp
uv syncRun the Server
# With pip
python main.py
# With uv
uv run mainTest the Server
python test_fastmcp.pyRelated MCP server: Agent Arcade MCP Server
๐ฎ Available Games
Tic-Tac-Toe: Classic 3x3 grid game with X and O
๐ ๏ธ Available Tools
Core Game Tools
list_games- Discover available games and active instancesstart_game- Initialize a new game with playersmake_move- Execute game actionsget_game_state- View current game statereset_game- Reset game to initial state
Game-Specific Tools
tic_tac_toe_place_mark- Place X or O on the board
๐ Claude Desktop Integration
Add to your Claude Desktop claude_desktop_config.json:
{
"mcpServers": {
"gym-mcp": {
"command": "python",
"args": ["main.py"],
"cwd": "/path/to/gym-mcp"
}
}
}๐ฏ Example Usage
# Discover available games
list_games()
# Start a tic-tac-toe game
start_game(game_type="tic-tac-toe", players=["Alice", "Bob"])
# Make moves using generic tool
make_move(game_id="uuid", action_type="place_mark", payload={"row": 1, "col": 1}, player="Alice")
# Or use game-specific tool
tic_tac_toe_place_mark(game_id="uuid", row=0, col=0, player="Bob")
# Check current state
get_game_state(game_id="uuid")๐๏ธ Architecture
Core Components
FastMCP: Simple, decorator-based MCP server
Game Registry: Manages available game types and active instances
Game Interface: Abstract base class defining game contract
Dynamic Tools: Each game registers custom MCP tools
Per-Game Tools
Each game can define its own specific tools:
Tic-Tac-Toe:
tic_tac_toe_place_mark(game_id, row, col, player)Future games: Chess could have
chess_castle,chess_en_passant, etc.
Stateless Design
Games stored in memory per server session
No authentication required
Clean separation between game logic and MCP protocol
๐ง Adding New Games
Create game class inheriting from
Game:class Chess(Game): def start(self, players): ... def make_move(self, action): ... def get_state(self): ... # etc.Define game-specific tools:
@classmethod def get_tool_definitions(cls): return [GameToolDefinition( name="chess_castle", description="Perform castling move", input_schema={...} )]Register in the registry:
registry.register_game_type(Chess)Add FastMCP tool handlers in
server.py
๐ Future Plans
OpenAI Gym Integration: Wrap Gymnasium environments
PettingZoo Support: Multi-agent games (Chess, Poker, etc.)
Real-time Games: WebSocket support for faster interactions
Tournament Mode: AI vs AI competitions
Spectator Tools: Watch games in progress
๐๏ธ Architecture Benefits
For AI Researchers
Standardized game testing environments
Consistent APIs across all games
Easy benchmarking and evaluation
For Developers
Simple game integration (just implement the interface)
Automatic MCP tool generation
Built-in state management
For AI Agents
Unified discovery mechanism (
list_games)Consistent interaction patterns
Game-specific optimization opportunities
Built with FastMCP following Dedalus Labs MCP Guidelines
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
AlicenseAqualityBmaintenanceEnables AI agents to deploy multiplayer web games as playable URLs with rooms, live state sync, and leaderboards, all through a single tool call.Last updated47234Inno Setup- Alicense-qualityDmaintenanceEnables AI agents to play games like Chess, Go, and Trading against each other with Elo rankings through registration, matchmaking, and move submission.Last updated44MIT
- Alicense-qualityBmaintenanceEnables AI agents to build and test games headlessly using the llmgine game engine, with tools for world creation, prefab definition, spawning, acting, and simulation.Last updated1MIT
- Flicense-qualityBmaintenanceEnables AI agents to play local Windows games through low-level keyboard/mouse input, screen capture, OCR, and per-game profiles for semantic actions.Last updated
Related MCP Connectors
Build, validate, and deploy multi-agent AI solutions from any AI environment.
Search and discover advertiser products through an open marketplace for AI agents.
Create and manage AI agents that collaborate and solve problems through natural language interactiโฆ
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/IshanTiwari0112/gym-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server