simrig-mcp
# simrig-mcp
[](https://github.com/luangrezende/simrig-mcp/actions/workflows/ci.yml)
[](LICENSE)
Three [MCP](https://modelcontextprotocol.io) servers that let an AI assistant (Claude Code, Claude Desktop, Cursor, ...)
work on a Windows sim racing rig the way a careful engineer would: read the real configuration, change one thing,
keep a backup, measure, and roll back if it got worse.
| Server | What it does |
|---|---|
| **`ac-config-mcp`** | Reads and edits **Assetto Corsa**, **Custom Shaders Patch** and **Content Manager** configuration: `video.ini`, CSP overrides, Pure config, CM video/CSP presets, post-processing filters, Python/Lua apps, mod install from a zip. Every write is backed up and undoable. |
| **`pimax-mcp`** | Reads and adjusts a **Pimax** headset through the official Pimax Play CLI, and parses the Pimax runtime logs for what the CLI does not show: the render settings actually in effect per game, and per-session app/compositor FPS with missed, stale and discarded frames. |
| **`shakeit-mcp`** | Audits **SimHub ShakeIt** haptics (bass shakers, every motor output such as Arduino, Fanatec or Simagic, and a SimParts belt): the same event on several devices, continuous effects stacked on one shaker, redundant effect pairs, gain headroom, filters and motor effects that are on but routed nowhere. Read-only. Also a plain CLI: `uvx simrig-mcp shakeit-audit`. |
Two guides came out of this work and are useful without any AI at all:
[eye-tracked foveated rendering in Assetto Corsa on a Pimax](docs/assetto-corsa-csp-openxr-eye-tracked-vrs.md) and
[SimHub haptics: one event, one owner](docs/simhub-haptics-one-event-one-owner.md).
## Why I built this
I'm a huge sim racing fan. My rig is a Fanatec direct drive wheel, a Pimax Crystal in VR and a SimHub setup with
bass shakers, vibration motors, wind and an active belt tensioner, mostly driving Assetto Corsa with CSP.
Anyone with a rig like that knows the pain: hundreds of settings spread across `video.ini`, CSP overrides, Content
Manager presets, Pimax Play and the runtime, and every forum thread swears by a different combination. I wanted an
AI assistant to help me tune it like an engineer would: look at the real config, change one thing at a time,
measure, and roll back if it got worse. So I built these servers to give it exactly that, safely.
The first thing it helped me find was something I couldn't find written anywhere: a guide to
[running AC in CSP's native OpenXR mode with eye-tracked foveated rendering on a Pimax](docs/assetto-corsa-csp-openxr-eye-tracked-vrs.md).
I'm sharing it all in case it saves other sim racers some evenings of trial and error.
## Why not just edit the files?
You can. The point is letting an assistant do it **safely**:
- **Backup before every write**, one folder per change with a manifest, plus a JSON-lines `changes.log`.
- **`ac_undo`** restores any backup (and backs up the current state first, so undo is undoable).
Files a change created are removed on undo.
- **Edits are surgical**: comments, BOM and CRLF line endings survive; only the key you set changes.
- **Paths are fenced** to known roots and text extensions. No `..`, no executables, no arbitrary files.
- **Mod install is dry-run by default**, refuses zip-slip paths, never copies `.exe/.dll/.bat/.ps1/...`,
and refuses to run while the game is open.
- **Pimax changes need `confirm=True`**, which the tool description tells the model to pass only after you approve.
Values are validated against a closed list.
- **Read-only mode**: set `AC_CONFIG_MCP_READ_ONLY=1` / `PIMAX_MCP_READ_ONLY=1` and the write tools are not even registered.
## Requirements
- Windows, Python 3.10+
- `ac-config-mcp`: Assetto Corsa (Steam). CSP and Content Manager are optional but most tools assume them.
- `pimax-mcp`: Pimax Play running (tested with Pimax Play 2.0.4 and a Crystal OG). The CLI ships with Pimax Play.
- `shakeit-mcp`: SimHub installed (it reads the settings files; SimHub does not need to be running).
## Install
Published on [PyPI](https://pypi.org/project/simrig-mcp/) and in the official
[MCP Registry](https://registry.modelcontextprotocol.io) as `io.github.luangrezende/ac-config-mcp`,
`io.github.luangrezende/pimax-mcp` and `io.github.luangrezende/shakeit-mcp`. With [uv](https://docs.astral.sh/uv/)
there is nothing to install by hand: the client runs `uvx simrig-mcp acconfig|pimax|shakeit`.
### Claude Code
```powershell
claude mcp add acconfig -- uvx simrig-mcp acconfig
claude mcp add pimax -- uvx simrig-mcp pimax
claude mcp add shakeit -- uvx simrig-mcp shakeit
```
### Any MCP client (JSON)
```json
{
"mcpServers": {
"acconfig": { "command": "uvx", "args": ["simrig-mcp", "acconfig"] },
"pimax": { "command": "uvx", "args": ["simrig-mcp", "pimax"] },
"shakeit": { "command": "uvx", "args": ["simrig-mcp", "shakeit"] }
}
}
```
Without uv: `pip install simrig-mcp` puts `ac-config-mcp` and `pimax-mcp` on your PATH (and `simrig-mcp shakeit`).
From source: `git clone https://github.com/luangrezende/simrig-mcp`, then `uv sync` (servers end up in `.venv\Scripts\`).
<!-- mcp-name: io.github.luangrezende/ac-config-mcp -->
<!-- mcp-name: io.github.luangrezende/pimax-mcp -->
<!-- mcp-name: io.github.luangrezende/shakeit-mcp -->
## Configuration
Everything is auto-detected; override only if needed.
| Variable | Default |
|---|---|
| `AC_ROOT` | Steam library containing `steamapps\common\assettocorsa` (reads `libraryfolders.vdf`) |
| `AC_DOCUMENTS` | `<Documents>\Assetto Corsa` (follows OneDrive folder redirection) |
| `CM_PRESETS` | `%LOCALAPPDATA%\AcTools Content Manager\Presets` |
| `AC_CONFIG_MCP_HOME` | `%LOCALAPPDATA%\ac-config-mcp` (backups and `changes.log`) |
| `AC_CONFIG_MCP_READ_ONLY` | off |
| `PIMAX_CLI` | `%ProgramFiles%\Pimax\PimaxClient\pimaxui\resources\pimaxcli\pimax.exe` |
| `PIMAX_MCP_HOME` | `%LOCALAPPDATA%\pimax-mcp` (`changes.log`) |
| `PIMAX_MCP_READ_ONLY` | off |
| `SIMHUB_DIR` | `%ProgramFiles(x86)%\SimHub` (settings read from `PluginsData\Common`) |
## Tools
### ac-config-mcp
Files are addressed as `<root>/<relative path>`:
`cfg/` (Documents\Assetto Corsa\cfg), `ext/` (CSP overrides), `pure/`, `sys/` (game `system\cfg`),
`apps/`, `extcfg/` (`extension\config-ext`), `acroot/` (only `opencomposite.ini`).
| Read | Write (backup + log + undo) |
|---|---|
| `ac_status` - AC/CM running, roots, last changes | `ac_set`, `ac_set_many` - set ini keys |
| `ac_list_files`, `ac_read` - ini files as values | `ac_apply_video_preset`, `ac_save_video_preset` |
| `ac_csp_doc` - CSP default + inline docs + your override | `ac_apply_csp_preset`, `ac_save_csp_preset` |
| `ac_list_presets`, `ac_read_video_preset` | `ac_set_pp_filter`, `ac_set_python_app` |
| `ac_list_pp_filters`, `ac_list_apps` | `ac_write_text`, `ac_replace_text` - Lua/Python/config text |
| `ac_read_text`, `ac_list_backups` | `ac_install_mod` (dry run by default), `ac_undo` |
Notes: Content Manager does not watch these files, so an open CM may show old values until it reloads.
With AC running, most changes apply on the next session.
### pimax-mcp
| Tool | Source |
|---|---|
| `pimax_status`, `pimax_doctor` | Pimax CLI |
| `pimax_settings` | Pimax CLI: quality, brightness, local dimming, overlay scale, eye tracking |
| `pimax_runtime_state` | PiService log: per-app render scale, FOV, foveated/quad views, smart smoothing, upscaling actually read by the runtime |
| `pimax_runtime_stats` | Compositor log: app vs compositor FPS, % missed frames, stale/discarded, GPU%/CPU% per session (`exe="acs"` for AC) |
| `pimax_set` | Pimax CLI, closed list of settings, `confirm=True` required |
Refresh rate, FOV, foveated rendering and Smart Smoothing are not exposed by the Pimax CLI; change them in Pimax Play.
The PimaxClient `config.json` (login token) is never read.
### shakeit-mcp
| Tool | What it returns |
|---|---|
| `shakeit_audit` | Findings for the active bass and motor profiles, following [one event, one owner](docs/simhub-haptics-one-event-one-owner.md) |
| `shakeit_effects` | Effects of the active `bass` or `motors` profile: enabled, gain, filter, output, routed |
| `shakeit_outputs` | Shaker sound outputs (filters, latency mode, channels) and the motor routing table per output |
The same audit runs without any AI: `uvx simrig-mcp shakeit-audit` (add `--json` for the full result).
## Example session
> "AC in VR feels choppy on the straight after turn 1. Check what the Pimax runtime is doing and suggest one change."
The assistant reads `pimax_runtime_stats(exe="acs")` (missed frames, GPU%), `pimax_runtime_state` and
`ac_read("ext/vr_tweaks.ini")`, proposes a single change, applies it with `ac_set` after you agree, and after
your next stint compares the stats again. If it got worse: `ac_undo`.
## Development
```powershell
uv sync
uv run pytest
uv run ruff check .
```
Tests run against temporary folders and fake processes; they never touch a real game or headset.
## License
MIT. Not affiliated with Kunos Simulazioni, Ilja Jusupov (CSP / Content Manager) or Pimax.
TDQS
Scored across 22 tools
Most tools target a clearly distinct resource+action (presets, apps, pp filters, backups, mods), and bulk variants like ac_set_many vs ac_set are obvious. The one soft spot is the read family: ac_read (ini values), ac_read_text (scripts), and ac_csp_doc (CSP option docs) all read file content, and agents may occasionally pick the wrong one. Descriptions largely resolve this, keeping it from being a real hazard.
Nearly everything is ac_ + verb_noun (ac_list_files, ac_apply_video_preset, ac_set_pp_filter), which is predictable. The deviations are bare-verb/noun forms like ac_read, ac_set, and ac_status, where identically-shaped tools (ac_read vs ac_read_text, ac_set vs ac_set_pp_filter) differ in granularity. Minor but consistent enough to be readable.
22 tools sits at the upper end, but the domain is genuinely broad (ini editing, CM presets, apps, pp filters, mod install, backups/undo) and each tool maps to a real operation with little duplication. No obvious throwaway tools, though a couple of read variants could theoretically be merged.
Strong lifecycle coverage: read/write/replace/set/set_many for config, list/read/apply/save for both preset families, app and pp-filter toggling, mod install with dry-run, plus backups and undo. Gaps are minor: no key/file deletion, no dedicated mod uninstall (only undo), and no search across config files. Agents can work around all of these.