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 "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., "@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: YetAnotherUnityMcp
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 installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- 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/lauripiispanen/game-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server