game-mcp
Allows AI to send commands to a Godot game instance for testing, debugging, and verification, including capturing screenshots and querying game state.
Allows AI to send commands to a Unity game instance for testing, debugging, and verification, including capturing screenshots and querying game state.
Click on "Deploy 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., "@game-mcpConnect to the game and take a screenshot"
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.
Game MCP Server
A thin MCP (Model Context Protocol) server that bridges AI assistants to running game instances for testing, debugging, and verification.
Overview
This server acts as a proxy between Claude (or any MCP-compatible AI) and your game. It:
Launches your game process if not already running
Maintains a TCP connection for bidirectional communication
Forwards commands from the AI to your game
Returns responses, including screenshots, back to the AI
Engine-agnostic: Works with any game engine (Godot, Unity, Unreal, custom) as long as your game implements the simple TCP protocol.
Related MCP server: openrct2-mcp
Architecture
┌─────────────────────────────────────────────────────────────────────┐
│ AI Assistant (Claude) │
└─────────────────────────────────────┬───────────────────────────────┘
│ MCP Protocol (stdio)
▼
┌─────────────────────────────────────────────────────────────────────┐
│ Game MCP Server │
│ │
│ - Launches game process if needed │
│ - TCP connection to game (default port 6789) │
│ - Forwards commands, returns responses │
│ - Handles screenshots as MCP ImageContent │
└─────────────────────────────────────┬───────────────────────────────┘
│ TCP + JSON (newline-delimited)
▼
┌─────────────────────────────────────────────────────────────────────┐
│ Your Game (with DevServer) │
│ │
│ - Listens on TCP port │
│ - Executes commands, returns results │
│ - You implement the command handlers │
└─────────────────────────────────────────────────────────────────────┘Installation
bun installConfiguration
Configure via environment variables:
Variable | Default | Description |
| (none) | Path to your game/project directory |
|
| TCP port for game communication |
|
| Command to launch your game |
|
| Connection timeout |
|
| Command response timeout |
Claude Code Integration
Add to your Claude Code MCP config (~/.config/claude-code/settings.json):
{
"mcpServers": {
"game": {
"command": "bun",
"args": ["run", "/path/to/game-mcp/src/index.ts"],
"env": {
"GAME_PROJECT_PATH": "/path/to/your/game",
"GODOT_PATH": "godot"
}
}
}
}For non-Godot engines, set GODOT_PATH to whatever command launches your game.
MCP Tools
game_connect
Connects to the game, launching it if necessary.
Parameters:
project_path(string, optional): Override the game project pathrestart(boolean, optional): Kill and relaunch the gameport(integer, optional): TCP port (default: 6789)timeout_ms(integer, optional): Connection timeout
Returns: List of available commands from the game.
game_command
Sends a command to the game.
Parameters:
command(string, required): Command nameargs(object, optional): Command argumentstimeout_ms(integer, optional): Response timeout
Returns: Command result, potentially including image data.
Game-Side Protocol
Your game needs to implement a TCP server that:
Listens on the configured port (default 6789)
Accepts newline-delimited JSON messages
Responds with newline-delimited JSON
Request Format
{"id": "uuid", "command": "command_name", "args": {"key": "value"}}Response Format
{"id": "uuid", "success": true, "data": {...}}With image:
{"id": "uuid", "success": true, "data": {}, "image": "base64-encoded-png"}Error:
{"id": "uuid", "success": false, "error": "Error message"}Required Command: list_commands
Your game should implement list_commands to tell the AI what's available:
// Request
{"id": "1", "command": "list_commands", "args": {}}
// Response
{
"id": "1",
"success": true,
"data": {
"commands": [
{
"name": "screenshot",
"description": "Capture the game viewport",
"args": {
"scale": {"type": "number", "optional": true}
}
},
{
"name": "get_player_state",
"description": "Get player position and health",
"args": {}
}
]
}
}Example Commands
Common commands you might implement in your game:
Command | Description |
| Capture viewport as PNG |
| Get player position, health, etc. |
| Move player to coordinates |
| Spawn entities for testing |
| Retrieve recent error logs |
| Get FPS and performance metrics |
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Create, test and play AI-native games through server-authoritative contracts.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to control Unreal E…
AI-only game publishing, autonomous play, live observation, replay and independent certification.
Telegram bridge for your MCP-compatible agent. Bidirectional, no LLM in our stack.
Related MCP Servers
- AlicenseBqualityCmaintenanceA bridge between Unity and AI assistants that enables AI to interact with Unity game environments through a standardized interface for code execution, scene analysis, and runtime debugging.334 npm7MIT
- AlicenseNot gradedqualityBmaintenanceBridges a running OpenRCT2 game to AI agents, enabling them to read park state, optimize parks, and build roller coasters.1MIT
- FlicenseNot gradedqualityCmaintenanceAn in-editor MCP server that exposes Unity convenience tools to AI assistants, allowing them to read console logs, execute menu items, dump scene hierarchies, and take screenshots.-
- AlicenseBqualityBmaintenanceEnables AI assistants to automate Godot 4 projects via headless tooling, live editor control, and runtime remote control, including scene building, testing, and observation.431MIT