This MCP GameBoy Server allows LLMs to interact with a GameBoy emulator, enabling them to load ROMs, press keys, view the GameBoy screen, and skip frames. It provides a bridge between language models and interactive GameBoy gameplay through the Model Context Protocol.
The easiest way to install the GameBoy Emulator Server for Claude Desktop is through Smithery:
npx -y @smithery/cli install @mario-andreschak/mcp-gameboy --client claude
To install in FLUJO:
# Clone the repository
git clone https://github.com/yourusername/mcp-gameboy.git
cd mcp-gameboy
# Install dependencies
npm install
# Build the project
npm run build
To integrate with Cline or other MCP clients via configuration files:
{
"mcpServers": {
"mcp-gameboy": {
"command": "node",
"args": [
"/path/to/mcp-gameboy/dist/index.js"
],
"disabled": false,
"autoApprove": []
}
}
}
Important: Replace /path/to/mcp-gameboy/dist/index.js
with the actual path to the index.js
file in your project directory. Use forward slashes (/) or double backslashes (\\) for Windows paths.
Create a .env
file in the root directory:
# Server configuration
PORT=3001
# ROM path for stdio mode
ROM_PATH=./roms/dangan.gb
Important: Many MCP clients require specifying the ROM_PATH as an absolute path in the environment variables.
This mode uses the ROM path from your environment variables and opens a browser window showing the GameBoy screen:
npm run start
This mode starts an Express server with a web interface for ROM selection:
npm run start-sse
After starting, open your browser to http://localhost:3001
to select a ROM. You can also access the emulator interface at http://localhost:3001/emulator
.
The server provides these tools for GameBoy interaction:
Button Controls:
press_up
: Press the UP buttonpress_down
: Press the DOWN buttonpress_left
: Press the LEFT buttonpress_right
: Press the RIGHT buttonpress_a
: Press the A buttonpress_b
: Press the B buttonpress_start
: Press the START buttonpress_select
: Press the SELECT buttonROM and Display:
load_rom
: Load a GameBoy ROM fileget_screen
: Get the current GameBoy screenAll tools return an ImageContent with the latest screen frame, allowing the LLM to see the current state of the game.
You can control the GameBoy emulator and upload ROMs using these interfaces:
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.