local-game-mcp

local-game-mcp

Enables AI agents to play local Windows games through low-level keyboard/mouse input, screen capture, OCR, and per-game profiles for semantic actions.

Category
Visit Server

README

local-game-mcp

A universal game-input MCP server for Windows. It lets an AI agent (Claude, or any MCP client) play local games through the same input layer a human uses: scan-code keyboard events, mouse, timed macro sequences, and fast DXGI frame capture — plus per-game profiles that turn raw input into semantic commands like action("end_turn") or action("move_to_tile", {q: 3, r: -1}).

Games see ordinary HID-level input. No screenshot-and-pixel-hunt loop, no game-engine coupling.

See DESIGN.md for the full architecture.

Status

Phase Scope State
0 Scaffold, capture, window info
1 Scan-code keyboard, mouse, macros, timing engine
2 Profiles, hex/square/iso grids, semantic actions ✅ (Civ VI profile needs in-game calibration)
2.5 Live OCR perception (Windows.Media.Ocr)
3 Virtual gamepad (ViGEmBus) planned
4 Game-state bridges (Lua/mod → JSON) planned

Requirements

  • Windows 10/11
  • Python 3.11+ (3.12 recommended)
  • The game running non-elevated on the primary monitor, preferably in borderless-windowed mode

Install

git clone https://github.com/rrhoopes3/local-game-MCP.git
cd local-game-MCP
py -3.12 -m venv .venv
.venv\Scripts\pip install -e .[dev]
.venv\Scripts\pytest        # should be green

Hook into Claude Code

claude mcp add local-game -- "<absolute path>\.venv\Scripts\local-game-mcp.exe"

Hook into Claude Desktop

{
  "mcpServers": {
    "local-game": {
      "command": "<absolute path>\\.venv\\Scripts\\local-game-mcp.exe"
    }
  }
}

Tools

Inputpress_keys (sequences + shift+enter combos), key_hold, type_text, mouse_move, mouse_click, mouse_drag, scroll, macro (fully timed low-level sequences), wait.

Perceptioncapture (region-cropped, downscaled JPEG), probe_pixels (cheap RGB point checks), check_probe, window_info, plus OCR via the built-in Windows engine (no cloud, ~tens of ms): read_text (text + clickable word boxes), read_hud (all profile [text_regions] as one labeled dict — exact state for ~50 tokens instead of a screenshot), and wait_for_text (blocks server-side until a regex appears in a region — end the turn, wake up when the turn counter changes; no polling through the model).

Profilesload_profile, list_profiles, action, focus_game.

Raw tools always work without a profile. Coordinates use three spaces: screen (desktop px), window (0–1 over the game's client rect, resolution-independent), and grid (tile coordinates — axial hex, square, or isometric — defined per profile).

Profiles

One TOML file per game in profiles/. profiles/civ6.toml ships as the reference; its hotkeys are the verified game defaults, while grid origin/ size and UI points are marked CALIBRATE (they depend on resolution and UI scale — capture a frame, measure, fill in).

Scope & fair play

This project targets single-player, local, and moddable games. Kernel anti-cheat systems detect synthetic input and virtual drivers; using this in online competitive games violates game ToS and risks bans, and no detection-evasion features will be added. For the planned Mechabellum profile that means vs-AI / practice modes.

Known limitations (v1)

  • Primary monitor only for capture.
  • Mouse-look in some Raw-Input engines ignores synthetic relative moves — the phase-3 gamepad backend is the fallback for camera control.
  • Windows silently drops input to elevated windows (UIPI); window_info reports elevation so the server warns instead of misfiring.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured