GTAV-CLAUDE-MCP

GTAV-CLAUDE-MCP

Enables Claude to see and act in Grand Theft Auto V, spawning vehicles, changing weather/time, calling game natives, and reading/writing memory, with an in-game chat panel for interacting with Claude while playing.

Category
访问服务器

README

GTAV-Claude-MCP — Talk to Claude inside GTA V

Let Claude see and safely act in a live GTA V game — spawn vehicles, change weather/time, call any of ~6,700 game natives, and read/write vehicle memory (e.g. a wheel-fitment mod) — and chat with Claude from inside the game (press F10), with replies rendered in an in-game panel.

Single-player only. This is a memory-editing/modding tool; never use it in GTA Online.

🚧 Work in progress

This project is an active WIP and not yet fully tested in-game — expect rough edges, breaking changes, and things that don't work yet. It's implemented and validated off-game (compiles, unit/round-trip tests pass), but full in-game end-to-end testing on a live GTA V install is still ongoing. Use at your own risk. Feedback and issues welcome.

Credit: if you use, fork, or build on this, please credit TabbedScamper and link back to this repo (https://github.com/TabbedScamper/GTAV-CLAUDE-MCP). See Credits.

How it works

        You (in-game, press F10)
                │  message
                ▼
   pyscript/bridge.py  ──────────────►  gtav_host.py  ──────►  Claude (Agent SDK)
   (runs in GTA V via PyLoaderV)   long-poll        owns the     │ uses game tools via MCP
   reads/writes game memory        (≈instant)       session      ▼
                ▲                                          mcp_server/server.py
                │  reply (streamed to the in-game panel)         │ TCP :27015, JSON
                └──────────────────────────────────────── bridge.py
  • gtav_host.py drives Claude via the Claude Agent SDK (reuses your claude login — no API key, no terminal, no focus stealing). It long-polls the bridge for your F10 messages, queries Claude, and streams replies into the in-game panel's shared memory. It's also crash-aware: as a separate process from GTA, it detects a game crash and reports the last operation from the on-disk write-ahead log.
  • mcp_server/server.py exposes the game as MCP tools to Claude.
  • pyscript/bridge.py runs inside GTA V (PyLoaderV) and does the actual memory access — with a verified-hash allowlist so Claude can call natives by name without crashing on a bad hash.
  • ui_companion/ is a ScriptHookVDotNet + LemonUI panel that renders the chat in-game.

Prerequisites

In your GTA V install:

On your PC (for the host):

  • Python 3.10+ (tested on 3.14)
  • A Claude subscription, logged in once via claude /login (the host reuses it)

Setup

# 1. Python deps (in a venv)
python -m venv .venv
.venv\Scripts\pip install -r requirements.txt

# 2. Log in to Claude once (no API key needed)
claude /login

# 3. Copy the runtime files into your GTA V install (auto-detects Steam/Epic/Rockstar)
powershell -ExecutionPolicy Bypass -File deploy.ps1
#    ...or: deploy.ps1 -GtaPath "X:\...\Grand Theft Auto V"

deploy.ps1 copies bridge.py + native_db.json into <GTA>\pyscript\ and the prebuilt ClaudeChatUI.dll + LemonUI.SHVDN3.dll into <GTA>\scripts\.

Run

  1. Launch GTA V (story mode), press F9 to load the Python bridge.
  2. Run run_host.bat — it prints "Connected to Claude. Ready." (the in-game panel, F11, shows the same).
  3. Press F10 in-game and chat. Try: spawn an adder · set thunder weather and midnight · god mode on, give me a minigun.

See TESTING.md for the full first-run checklist and smoke tests.

What Claude can do

  • Situational awareness: get_context reads a full live snapshot (location, vehicle + class/ plate/engine, speed, weapon + ammo, activity flags, time/weather, wanted level, health, game state) in one ~30ms call. The host pulls it on every message and trims to what's relevant to that message — e.g. "in a ADDER (112 mph), in VINEWOOD, 21:45, THUNDER, wanted 3★, weapon CARBINERIFLE x90, (sprinting, shooting)" for a combat message — so replies are aware without bloating the conversation. Claude can also call get_context(detail="full") on demand.
  • Convenience tools: spawn_vehicle, teleport, set_weather, set_time, give_weapon, repair_vehicle, get_player_ped, set_invincible, set_health, set_wanted_level.
  • Any native, safely: search_natives, native_info, and call_native (by name). The native is resolved to a verified hash for your edition (Legacy/Enhanced) and refused if not on the allowlist — so a wrong hash can't crash the game. Args are coerced to the declared types.
  • Memory / RE: read_memory, write_memory (validated + page-protection-safe + undoable, returns before/after + verified), snapshot/diff, watch, scan_pattern (AOB), resolve_rip_relative.
  • Debugging workbench (build/debug anything):
    • inspect(handle | address) — decode an entity or memory region into labeled, typed slots (float / int / pointer / zero / raw) with entity type + model; follow pointers to walk structs.
    • get_environment — ground truth: edition (Legacy/Enhanced), exe, module base/size, native-DB stats, and which offsets are verified for this build (so it never guesses the ground).
    • set_goal / note_finding / get_findings — a session memory of what you're building and the offsets/labels discovered, persisted across F9 reloads and auto-applied as inspect labels.
  • Vehicle wheels: get_wheel_values, set_wheel_value, continuous per-frame re-assert.

Safety / design

  • Measure, don't guess — verify offsets on the live game via the bridge.
  • Never crash the host — validate every address before deref, restore page protection after writes, single-step, snapshot + revert. A wrong native hash is refused, not called.
  • Single-player only — GTA Online with mods = ban.
  • Antivirus/EDR note: ScriptHookV/PyLoaderV inject into the game and edit memory, which AV/EDR (and especially enterprise EDR like SentinelOne) may quarantine or block. Use a personal machine and add the GTA folder to your AV exclusions if needed.

Known wheel offsets (Legacy, verified)

Field Offset Description
Y Rotation 0x008 Camber
Inv Y Rotation 0x010 Inverse camber
X Offset 0x030 Track width
Tyre Radius 0x110 Visual + collision size
Rim Radius 0x114 Visual rim
Tyre Width 0x118 Visual width

Crash diagnostics

  • Write-ahead log: each write is logged to pyscript/crash_logs/last_op.jsonl (fsync'd) before execution, so it survives a crash.
  • faulthandler dumps a Python traceback on hard crashes.
  • The host reads the WAL from disk on a detected crash and reports the last operation.

Project layout

gtav_host.py            # headless Claude host (Agent SDK) - the chat brain
mcp_server/server.py    # MCP server exposing the game as tools
pyscript/bridge.py      # in-game socket server + memory access (PyLoaderV)
pyscript/native_db.json # verified native-hash allowlist (~6,700 natives)
ui_companion/           # ScriptHookVDotNet + LemonUI in-game panel (prebuilt DLL included)
deploy.ps1              # copy runtime files into the GTA V install
run_host.bat            # launch the host
requirements.txt        # Python deps (claude-agent-sdk, mcp)
TESTING.md / CLAUDE.md  # first-run guide / project notes

Credits

Created by TabbedScamper — https://github.com/TabbedScamper/GTAV-CLAUDE-MCP

If you use, fork, or build on this project, please credit TabbedScamper and link back to this repo. The MIT license also requires retaining the copyright and license notice. A mention in your README/mod description or a link back is all I ask. 🙏

License

MIT — see LICENSE. © 2026 TabbedScamper.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选