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.
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
Input — press_keys (sequences + shift+enter combos), key_hold,
type_text, mouse_move, mouse_click, mouse_drag, scroll, macro
(fully timed low-level sequences), wait.
Perception — capture (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).
Profiles — load_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_inforeports elevation so the server warns instead of misfiring.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。