# ElfDeckAI

> ElfDeckAI is an open-source MCP server for games and play. Virtual keyboard, gamepad and mouse plus screenshots so an AI can play on Linux. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** Linux, CLI
- **Repository:** https://github.com/garthnesss/elfdeckai
- **MCP Registry name:** io.github.Garthnesss/elfdeckai
- **Categories:** [games and play](https://ai-powered.com/categories/games-and-play), [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-23

## About

ElfDeckAI lets an assistant such as Claude see the screen and press the buttons itself, with Steam Deck as its main target. Three small single-file Python programs create virtual input devices through the Linux kernel's /dev/uinput: a keyboard, an Xbox 360-class gamepad with analog triggers, two sticks and a D-pad, and a mouse that can click an exact point. Games and Steam see them as real hardware, so nothing depends on a particular game or emulator.

The MCP server exposes 22 tools over stdio, including a screenshot tool that returns a PNG so the agent can look, act and look again. Mouse coordinates are in pixels of the most recent screenshot, and large screens are scaled down to 1280 pixels by default. On a Steam Deck the PC's AI app launches the server over SSH, and the setup scripts configure Claude Desktop. It also works in Gaming and Desktop Mode, on wlroots compositors and X11.

The README says it played Pokemon FireRed in RetroArch through the first rival battle using screenshots alone, and that turn-based games, RPGs, puzzles and menus work best because each move takes a second or more.

## Features

- **Virtual gamepad:** Emulates an Xbox 360-class controller that SDL, Steam Input and RetroArch recognise.
- **Virtual keyboard and mouse:** Taps keys and clicks exact screen points.
- **Screenshot loop:** Returns a PNG so the agent can look, act and look again.
- **Steam Deck setup:** Install and PC setup scripts configure Claude Desktop over SSH.
- **Validated calls:** Each tool call is checked before anything is written.
- **No dependencies:** Single-file Python using only the standard library.

## Good for

- Let an AI play a turn-based game on a Steam Deck
- Automate menu navigation on a Linux desktop
- Drive an emulator through its gamepad input
- Test a Linux UI with simulated mouse and keyboard

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
claude mcp add elfdeckai -- uvx elfdeckai
```

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

### Claude Code: Or share it with your project (.mcp.json)

```json
{
  "mcpServers": {
    "elfdeckai": {
      "command": "uvx",
      "args": [
        "elfdeckai"
      ]
    }
  }
}
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "elfdeckai": {
      "command": "uvx",
      "args": [
        "elfdeckai"
      ]
    }
  }
}
```

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "elfdeckai": {
      "command": "uvx",
      "args": [
        "elfdeckai"
      ]
    }
  }
}
```

Use .cursor/mcp.json in a project to share it with the project.

### VS Code (~/.copilot/mcp-config.json)

```json
{
  "mcpServers": {
    "elfdeckai": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "elfdeckai"
      ]
    }
  }
}
```

Or put the same entry in .mcp.json at your workspace root to share it.

### Codex: Add with the CLI (Terminal)

```sh
codex mcp add elfdeckai -- uvx elfdeckai
```

### Codex: Or add to config.toml (~/.codex/config.toml)

```toml
[mcp_servers.elfdeckai]
command = "uvx"
args = ["elfdeckai"]
```

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

```json
{
  "mcpServers": {
    "elfdeckai": {
      "command": "uvx",
      "args": [
        "elfdeckai"
      ]
    }
  }
}
```

Or run: gemini mcp add -s user elfdeckai uvx -- elfdeckai

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

```json
{
  "mcpServers": {
    "elfdeckai": {
      "command": "uvx",
      "args": [
        "elfdeckai"
      ]
    }
  }
}
```

Use .agents/mcp_config.json to add it to one workspace only.

### Devin Desktop (~/.config/devin/mcp_config.json)

```json
{
  "mcpServers": {
    "elfdeckai": {
      "command": "uvx",
      "args": [
        "elfdeckai"
      ]
    }
  }
}
```

On Windows the file is %APPDATA%\\devin\\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

### Cline (cline_mcp_settings.json)

```json
{
  "mcpServers": {
    "elfdeckai": {
      "command": "uvx",
      "args": [
        "elfdeckai"
      ]
    }
  }
}
```

Open it from the MCP Servers icon → Configure → Configure MCP Servers.

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "elfdeckai": {
      "command": "uvx",
      "args": [
        "elfdeckai"
      ]
    }
  }
}
```

Open it with zed: open settings file. Merge context_servers into the settings you already have.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

```json
{
  "mcpServers": {
    "elfdeckai": {
      "command": "uvx",
      "args": [
        "elfdeckai"
      ]
    }
  }
}
```

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

```json
{
  "mcpServers": {
    "elfdeckai": {
      "command": "uvx",
      "args": [
        "elfdeckai"
      ]
    }
  }
}
```

Use .junie/mcp/mcp.json to share it with a project.

### Kiro (~/.kiro/settings/mcp.json)

```json
{
  "mcpServers": {
    "elfdeckai": {
      "command": "uvx",
      "args": [
        "elfdeckai"
      ]
    }
  }
}
```

Use .kiro/settings/mcp.json to add it to one workspace only.

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "elfdeckai": {
      "command": "uvx",
      "args": [
        "elfdeckai"
      ]
    }
  }
}
```

## Tools

From the tool list in its README, going by the names, 2 of 22 tools change data; 20 names don't say. From the server's own tool labels and tool names; not verified by us.

- `key_tap`: Taps a keyboard key.
- `key_down`: Holds a keyboard key.
- `key_up`: Releases a held key.
- `key_release`: Releases every held key.
- `pad_press`: Taps a gamepad button or D-pad direction.
- `pad_down`: Holds a gamepad button.
- `pad_up`: Releases a gamepad button.
- `pad_stick`: Sets an analog stick position.
- `pad_trigger`: Sets an analog trigger.
- `pad_center`: Returns sticks, triggers and D-pad to neutral.
- `pad_reset`: Releases everything on the gamepad.
- `mouse_click_at`: Clicks at pixel coordinates from the latest screenshot.
- `mouse_move_to` (name suggests: changes): Moves the pointer to screenshot pixel coordinates.
- `mouse_move` (name suggests: changes): Moves the pointer relatively.
- `mouse_click`: Clicks a mouse button.
- `mouse_down`: Holds a mouse button.
- `mouse_up`: Releases a mouse button.
- `mouse_scroll`: Scrolls vertically.
- `mouse_hscroll`: Scrolls horizontally.
- `mouse_release`: Releases all mouse buttons.
- `screenshot`: Captures the screen as a PNG.
- `wait`: Pauses between actions.

## FAQ

### Which games work best?

Turn-based games, RPGs, puzzles and menus; fast action games are out of reach.

### Does ElfDeckAI work outside Steam Deck?

Yes, on other Linux machines, with a udev rule for /dev/uinput on most distributions.

### How does the PC connect to the Deck?

Over SSH using a key, started by the AI app on the Deck.

### How many tools are there?

22 across keyboard, gamepad, mouse, vision and timing.

### Is ElfDeckAI free?

Yes. ElfDeckAI is open source, so you can use and self-host it for free.

### How do I add ElfDeckAI to Claude Code?

Run this command in your terminal: claude mcp add elfdeckai -- uvx elfdeckai

### What are the best alternatives to ElfDeckAI?

The closest alternatives to ElfDeckAI are REA, Context7, Chrome DevTools MCP, Codebase Memory and GitHub.

## Where this comes from

- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Context7](https://ai-powered.com/mcp/context7): Context7 is a freemium MCP server for developer tools.
- [Chrome DevTools MCP](https://ai-powered.com/mcp/chrome-devtools-mcp-2): Chrome DevTools MCP is an open-source MCP server for browser automation.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [awesome-mcp-servers](https://ai-powered.com/mcp/awesome-mcp-servers-2): awesome-mcp-servers is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.

---
Source: https://ai-powered.com/mcp/elfdeckai
