simrig-mcp 0.1.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- simrig_mcp-0.1.1/.github/scripts/install-mcp-publisher.sh +16 -0
- simrig_mcp-0.1.1/.github/workflows/ci.yml +35 -0
- simrig_mcp-0.1.1/.github/workflows/publish.yml +58 -0
- simrig_mcp-0.1.1/.gitignore +9 -0
- simrig_mcp-0.1.1/LICENSE +21 -0
- simrig_mcp-0.1.1/PKG-INFO +166 -0
- simrig_mcp-0.1.1/README.md +149 -0
- simrig_mcp-0.1.1/docs/assetto-corsa-csp-openxr-eye-tracked-vrs.md +120 -0
- simrig_mcp-0.1.1/pyproject.toml +45 -0
- simrig_mcp-0.1.1/registry/ac-config-mcp.server.json +50 -0
- simrig_mcp-0.1.1/registry/pimax-mcp.server.json +42 -0
- simrig_mcp-0.1.1/run.cmd +12 -0
- simrig_mcp-0.1.1/src/simrig_mcp/__init__.py +1 -0
- simrig_mcp-0.1.1/src/simrig_mcp/__main__.py +21 -0
- simrig_mcp-0.1.1/src/simrig_mcp/acconfig/__init__.py +0 -0
- simrig_mcp-0.1.1/src/simrig_mcp/acconfig/ini.py +99 -0
- simrig_mcp-0.1.1/src/simrig_mcp/acconfig/paths.py +122 -0
- simrig_mcp-0.1.1/src/simrig_mcp/acconfig/server.py +40 -0
- simrig_mcp-0.1.1/src/simrig_mcp/acconfig/store.py +414 -0
- simrig_mcp-0.1.1/src/simrig_mcp/compat.py +10 -0
- simrig_mcp-0.1.1/src/simrig_mcp/pimax/__init__.py +0 -0
- simrig_mcp-0.1.1/src/simrig_mcp/pimax/cli.py +67 -0
- simrig_mcp-0.1.1/src/simrig_mcp/pimax/logs.py +137 -0
- simrig_mcp-0.1.1/src/simrig_mcp/pimax/server.py +94 -0
- simrig_mcp-0.1.1/tests/conftest.py +34 -0
- simrig_mcp-0.1.1/tests/test_acconfig.py +145 -0
- simrig_mcp-0.1.1/tests/test_ini.py +48 -0
- simrig_mcp-0.1.1/tests/test_install_mod.py +66 -0
- simrig_mcp-0.1.1/tests/test_pimax.py +109 -0
- simrig_mcp-0.1.1/tests/test_release.py +46 -0
- simrig_mcp-0.1.1/tests/test_servers.py +34 -0
- simrig_mcp-0.1.1/uv.lock +1260 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Downloads mcp-publisher for Linux x64 and checks its Sigstore signature before extracting it.
|
|
3
|
+
set -euo pipefail
|
|
4
|
+
version="${MCP_PUBLISHER_VERSION:?set MCP_PUBLISHER_VERSION}"
|
|
5
|
+
archive="mcp-publisher_linux_amd64.tar.gz"
|
|
6
|
+
base_url="https://github.com/modelcontextprotocol/registry/releases/download/${version}"
|
|
7
|
+
curl --fail --location --silent --show-error --output "$archive" "$base_url/$archive"
|
|
8
|
+
curl --fail --location --silent --show-error --output "$archive.sigstore.json" "$base_url/$archive.sigstore.json"
|
|
9
|
+
cosign verify-blob \
|
|
10
|
+
--bundle "$archive.sigstore.json" \
|
|
11
|
+
--certificate-identity "https://github.com/modelcontextprotocol/registry/.github/workflows/release.yml@refs/tags/${version}" \
|
|
12
|
+
--certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
|
|
13
|
+
"$archive"
|
|
14
|
+
tar xzf "$archive" mcp-publisher
|
|
15
|
+
rm -f "$archive" "$archive.sigstore.json"
|
|
16
|
+
./mcp-publisher --version || true
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
test:
|
|
10
|
+
runs-on: windows-latest
|
|
11
|
+
strategy:
|
|
12
|
+
fail-fast: false
|
|
13
|
+
matrix:
|
|
14
|
+
python: ["3.10", "3.13"]
|
|
15
|
+
mcp: ["mcp>=1.2,<2", "mcp>=2"]
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v5
|
|
18
|
+
- uses: astral-sh/setup-uv@v6
|
|
19
|
+
with:
|
|
20
|
+
python-version: ${{ matrix.python }}
|
|
21
|
+
- run: uv sync
|
|
22
|
+
- run: uv pip install "${{ matrix.mcp }}"
|
|
23
|
+
- run: uv run --no-sync ruff check .
|
|
24
|
+
- run: uv run --no-sync pytest -q
|
|
25
|
+
|
|
26
|
+
registry:
|
|
27
|
+
runs-on: ubuntu-latest
|
|
28
|
+
env:
|
|
29
|
+
MCP_PUBLISHER_VERSION: v1.8.1
|
|
30
|
+
steps:
|
|
31
|
+
- uses: actions/checkout@v5
|
|
32
|
+
- uses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 # v4.1.2
|
|
33
|
+
- run: bash .github/scripts/install-mcp-publisher.sh
|
|
34
|
+
- run: |
|
|
35
|
+
for f in registry/*.server.json; do ./mcp-publisher validate "$f"; done
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
name: Publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
check:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
env:
|
|
11
|
+
MCP_PUBLISHER_VERSION: v1.8.1
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v5
|
|
14
|
+
- name: Tag matches package version
|
|
15
|
+
run: |
|
|
16
|
+
version=$(grep -m1 '^version = ' pyproject.toml | cut -d'"' -f2)
|
|
17
|
+
test "${GITHUB_REF_NAME}" = "v${version}" || { echo "tag ${GITHUB_REF_NAME} != v${version}"; exit 1; }
|
|
18
|
+
- uses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 # v4.1.2
|
|
19
|
+
- run: bash .github/scripts/install-mcp-publisher.sh
|
|
20
|
+
- run: |
|
|
21
|
+
for f in registry/*.server.json; do ./mcp-publisher validate "$f"; done
|
|
22
|
+
|
|
23
|
+
pypi:
|
|
24
|
+
needs: check
|
|
25
|
+
runs-on: ubuntu-latest
|
|
26
|
+
environment: pypi
|
|
27
|
+
permissions:
|
|
28
|
+
id-token: write
|
|
29
|
+
contents: read
|
|
30
|
+
steps:
|
|
31
|
+
- uses: actions/checkout@v5
|
|
32
|
+
- uses: astral-sh/setup-uv@v6
|
|
33
|
+
- run: uv build
|
|
34
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
35
|
+
|
|
36
|
+
registry:
|
|
37
|
+
needs: pypi
|
|
38
|
+
runs-on: ubuntu-latest
|
|
39
|
+
permissions:
|
|
40
|
+
id-token: write
|
|
41
|
+
contents: read
|
|
42
|
+
env:
|
|
43
|
+
MCP_PUBLISHER_VERSION: v1.8.1
|
|
44
|
+
steps:
|
|
45
|
+
- uses: actions/checkout@v5
|
|
46
|
+
- name: Wait until PyPI serves the new version
|
|
47
|
+
run: |
|
|
48
|
+
version=$(grep -m1 '^version = ' pyproject.toml | cut -d'"' -f2)
|
|
49
|
+
for i in $(seq 1 30); do
|
|
50
|
+
curl --fail --silent --output /dev/null "https://pypi.org/pypi/simrig-mcp/${version}/json" && exit 0
|
|
51
|
+
sleep 10
|
|
52
|
+
done
|
|
53
|
+
echo "PyPI did not serve ${version} in 5 minutes"; exit 1
|
|
54
|
+
- uses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 # v4.1.2
|
|
55
|
+
- run: bash .github/scripts/install-mcp-publisher.sh
|
|
56
|
+
- run: ./mcp-publisher login github-oidc
|
|
57
|
+
- run: |
|
|
58
|
+
for f in registry/*.server.json; do ./mcp-publisher publish "$f"; done
|
simrig_mcp-0.1.1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Luan Gomes
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: simrig-mcp
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: MCP servers for sim racing on Windows: Assetto Corsa / CSP / Content Manager config and Pimax VR headsets.
|
|
5
|
+
Project-URL: Homepage, https://github.com/luangrezende/simrig-mcp
|
|
6
|
+
Project-URL: Issues, https://github.com/luangrezende/simrig-mcp/issues
|
|
7
|
+
Project-URL: Guide, https://github.com/luangrezende/simrig-mcp/blob/main/docs/assetto-corsa-csp-openxr-eye-tracked-vrs.md
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Keywords: assetto-corsa,content-manager,csp,mcp,openxr,pimax,sim-racing,vr
|
|
11
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Topic :: Games/Entertainment :: Simulation
|
|
14
|
+
Requires-Python: >=3.10
|
|
15
|
+
Requires-Dist: mcp>=1.2
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
|
|
18
|
+
# simrig-mcp
|
|
19
|
+
|
|
20
|
+
[](https://github.com/luangrezende/simrig-mcp/actions/workflows/ci.yml)
|
|
21
|
+
[](LICENSE)
|
|
22
|
+
|
|
23
|
+
Two [MCP](https://modelcontextprotocol.io) servers that let an AI assistant (Claude Code, Claude Desktop, Cursor, ...)
|
|
24
|
+
work on a Windows sim racing rig the way a careful engineer would: read the real configuration, change one thing,
|
|
25
|
+
keep a backup, measure, and roll back if it got worse.
|
|
26
|
+
|
|
27
|
+
| Server | What it does |
|
|
28
|
+
|---|---|
|
|
29
|
+
| **`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. |
|
|
30
|
+
| **`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. |
|
|
31
|
+
|
|
32
|
+
## Why I built this
|
|
33
|
+
|
|
34
|
+
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
|
|
35
|
+
bass shakers, vibration motors, wind and an active belt tensioner, mostly driving Assetto Corsa with CSP.
|
|
36
|
+
|
|
37
|
+
Anyone with a rig like that knows the pain: hundreds of settings spread across `video.ini`, CSP overrides, Content
|
|
38
|
+
Manager presets, Pimax Play and the runtime, and every forum thread swears by a different combination. I wanted an
|
|
39
|
+
AI assistant to help me tune it like an engineer would: look at the real config, change one thing at a time,
|
|
40
|
+
measure, and roll back if it got worse. So I built these servers to give it exactly that, safely.
|
|
41
|
+
|
|
42
|
+
The first thing it helped me find was something I couldn't find written anywhere: a guide to
|
|
43
|
+
[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).
|
|
44
|
+
I'm sharing it all in case it saves other sim racers some evenings of trial and error.
|
|
45
|
+
|
|
46
|
+
## Why not just edit the files?
|
|
47
|
+
|
|
48
|
+
You can. The point is letting an assistant do it **safely**:
|
|
49
|
+
|
|
50
|
+
- **Backup before every write**, one folder per change with a manifest, plus a JSON-lines `changes.log`.
|
|
51
|
+
- **`ac_undo`** restores any backup (and backs up the current state first, so undo is undoable).
|
|
52
|
+
Files a change created are removed on undo.
|
|
53
|
+
- **Edits are surgical**: comments, BOM and CRLF line endings survive; only the key you set changes.
|
|
54
|
+
- **Paths are fenced** to known roots and text extensions. No `..`, no executables, no arbitrary files.
|
|
55
|
+
- **Mod install is dry-run by default**, refuses zip-slip paths, never copies `.exe/.dll/.bat/.ps1/...`,
|
|
56
|
+
and refuses to run while the game is open.
|
|
57
|
+
- **Pimax changes need `confirm=True`**, which the tool description tells the model to pass only after you approve.
|
|
58
|
+
Values are validated against a closed list.
|
|
59
|
+
- **Read-only mode**: set `AC_CONFIG_MCP_READ_ONLY=1` / `PIMAX_MCP_READ_ONLY=1` and the write tools are not even registered.
|
|
60
|
+
|
|
61
|
+
## Requirements
|
|
62
|
+
|
|
63
|
+
- Windows, Python 3.10+
|
|
64
|
+
- `ac-config-mcp`: Assetto Corsa (Steam). CSP and Content Manager are optional but most tools assume them.
|
|
65
|
+
- `pimax-mcp`: Pimax Play running (tested with Pimax Play 2.0.4 and a Crystal OG). The CLI ships with Pimax Play.
|
|
66
|
+
|
|
67
|
+
## Install
|
|
68
|
+
|
|
69
|
+
Published on [PyPI](https://pypi.org/project/simrig-mcp/) and in the official
|
|
70
|
+
[MCP Registry](https://registry.modelcontextprotocol.io) as `io.github.luangrezende/ac-config-mcp` and
|
|
71
|
+
`io.github.luangrezende/pimax-mcp`. With [uv](https://docs.astral.sh/uv/) there is nothing to install by hand:
|
|
72
|
+
the client runs `uvx simrig-mcp acconfig` / `uvx simrig-mcp pimax`.
|
|
73
|
+
|
|
74
|
+
### Claude Code
|
|
75
|
+
|
|
76
|
+
```powershell
|
|
77
|
+
claude mcp add acconfig -- uvx simrig-mcp acconfig
|
|
78
|
+
claude mcp add pimax -- uvx simrig-mcp pimax
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Any MCP client (JSON)
|
|
82
|
+
|
|
83
|
+
```json
|
|
84
|
+
{
|
|
85
|
+
"mcpServers": {
|
|
86
|
+
"acconfig": { "command": "uvx", "args": ["simrig-mcp", "acconfig"] },
|
|
87
|
+
"pimax": { "command": "uvx", "args": ["simrig-mcp", "pimax"] }
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Without uv: `pip install simrig-mcp` puts `ac-config-mcp` and `pimax-mcp` on your PATH.
|
|
93
|
+
From source: `git clone https://github.com/luangrezende/simrig-mcp`, then `uv sync` (servers end up in `.venv\Scripts\`).
|
|
94
|
+
|
|
95
|
+
<!-- mcp-name: io.github.luangrezende/ac-config-mcp -->
|
|
96
|
+
<!-- mcp-name: io.github.luangrezende/pimax-mcp -->
|
|
97
|
+
|
|
98
|
+
## Configuration
|
|
99
|
+
|
|
100
|
+
Everything is auto-detected; override only if needed.
|
|
101
|
+
|
|
102
|
+
| Variable | Default |
|
|
103
|
+
|---|---|
|
|
104
|
+
| `AC_ROOT` | Steam library containing `steamapps\common\assettocorsa` (reads `libraryfolders.vdf`) |
|
|
105
|
+
| `AC_DOCUMENTS` | `<Documents>\Assetto Corsa` (follows OneDrive folder redirection) |
|
|
106
|
+
| `CM_PRESETS` | `%LOCALAPPDATA%\AcTools Content Manager\Presets` |
|
|
107
|
+
| `AC_CONFIG_MCP_HOME` | `%LOCALAPPDATA%\ac-config-mcp` (backups and `changes.log`) |
|
|
108
|
+
| `AC_CONFIG_MCP_READ_ONLY` | off |
|
|
109
|
+
| `PIMAX_CLI` | `%ProgramFiles%\Pimax\PimaxClient\pimaxui\resources\pimaxcli\pimax.exe` |
|
|
110
|
+
| `PIMAX_MCP_HOME` | `%LOCALAPPDATA%\pimax-mcp` (`changes.log`) |
|
|
111
|
+
| `PIMAX_MCP_READ_ONLY` | off |
|
|
112
|
+
|
|
113
|
+
## Tools
|
|
114
|
+
|
|
115
|
+
### ac-config-mcp
|
|
116
|
+
|
|
117
|
+
Files are addressed as `<root>/<relative path>`:
|
|
118
|
+
`cfg/` (Documents\Assetto Corsa\cfg), `ext/` (CSP overrides), `pure/`, `sys/` (game `system\cfg`),
|
|
119
|
+
`apps/`, `extcfg/` (`extension\config-ext`), `acroot/` (only `opencomposite.ini`).
|
|
120
|
+
|
|
121
|
+
| Read | Write (backup + log + undo) |
|
|
122
|
+
|---|---|
|
|
123
|
+
| `ac_status` - AC/CM running, roots, last changes | `ac_set`, `ac_set_many` - set ini keys |
|
|
124
|
+
| `ac_list_files`, `ac_read` - ini files as values | `ac_apply_video_preset`, `ac_save_video_preset` |
|
|
125
|
+
| `ac_csp_doc` - CSP default + inline docs + your override | `ac_apply_csp_preset`, `ac_save_csp_preset` |
|
|
126
|
+
| `ac_list_presets`, `ac_read_video_preset` | `ac_set_pp_filter`, `ac_set_python_app` |
|
|
127
|
+
| `ac_list_pp_filters`, `ac_list_apps` | `ac_write_text`, `ac_replace_text` - Lua/Python/config text |
|
|
128
|
+
| `ac_read_text`, `ac_list_backups` | `ac_install_mod` (dry run by default), `ac_undo` |
|
|
129
|
+
|
|
130
|
+
Notes: Content Manager does not watch these files, so an open CM may show old values until it reloads.
|
|
131
|
+
With AC running, most changes apply on the next session.
|
|
132
|
+
|
|
133
|
+
### pimax-mcp
|
|
134
|
+
|
|
135
|
+
| Tool | Source |
|
|
136
|
+
|---|---|
|
|
137
|
+
| `pimax_status`, `pimax_doctor` | Pimax CLI |
|
|
138
|
+
| `pimax_settings` | Pimax CLI: quality, brightness, local dimming, overlay scale, eye tracking |
|
|
139
|
+
| `pimax_runtime_state` | PiService log: per-app render scale, FOV, foveated/quad views, smart smoothing, upscaling actually read by the runtime |
|
|
140
|
+
| `pimax_runtime_stats` | Compositor log: app vs compositor FPS, % missed frames, stale/discarded, GPU%/CPU% per session (`exe="acs"` for AC) |
|
|
141
|
+
| `pimax_set` | Pimax CLI, closed list of settings, `confirm=True` required |
|
|
142
|
+
|
|
143
|
+
Refresh rate, FOV, foveated rendering and Smart Smoothing are not exposed by the Pimax CLI; change them in Pimax Play.
|
|
144
|
+
The PimaxClient `config.json` (login token) is never read.
|
|
145
|
+
|
|
146
|
+
## Example session
|
|
147
|
+
|
|
148
|
+
> "AC in VR feels choppy on the straight after turn 1. Check what the Pimax runtime is doing and suggest one change."
|
|
149
|
+
|
|
150
|
+
The assistant reads `pimax_runtime_stats(exe="acs")` (missed frames, GPU%), `pimax_runtime_state` and
|
|
151
|
+
`ac_read("ext/vr_tweaks.ini")`, proposes a single change, applies it with `ac_set` after you agree, and after
|
|
152
|
+
your next stint compares the stats again. If it got worse: `ac_undo`.
|
|
153
|
+
|
|
154
|
+
## Development
|
|
155
|
+
|
|
156
|
+
```powershell
|
|
157
|
+
uv sync
|
|
158
|
+
uv run pytest
|
|
159
|
+
uv run ruff check .
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Tests run against temporary folders and fake processes; they never touch a real game or headset.
|
|
163
|
+
|
|
164
|
+
## License
|
|
165
|
+
|
|
166
|
+
MIT. Not affiliated with Kunos Simulazioni, Ilja Jusupov (CSP / Content Manager) or Pimax.
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# simrig-mcp
|
|
2
|
+
|
|
3
|
+
[](https://github.com/luangrezende/simrig-mcp/actions/workflows/ci.yml)
|
|
4
|
+
[](LICENSE)
|
|
5
|
+
|
|
6
|
+
Two [MCP](https://modelcontextprotocol.io) servers that let an AI assistant (Claude Code, Claude Desktop, Cursor, ...)
|
|
7
|
+
work on a Windows sim racing rig the way a careful engineer would: read the real configuration, change one thing,
|
|
8
|
+
keep a backup, measure, and roll back if it got worse.
|
|
9
|
+
|
|
10
|
+
| Server | What it does |
|
|
11
|
+
|---|---|
|
|
12
|
+
| **`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. |
|
|
13
|
+
| **`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. |
|
|
14
|
+
|
|
15
|
+
## Why I built this
|
|
16
|
+
|
|
17
|
+
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
|
|
18
|
+
bass shakers, vibration motors, wind and an active belt tensioner, mostly driving Assetto Corsa with CSP.
|
|
19
|
+
|
|
20
|
+
Anyone with a rig like that knows the pain: hundreds of settings spread across `video.ini`, CSP overrides, Content
|
|
21
|
+
Manager presets, Pimax Play and the runtime, and every forum thread swears by a different combination. I wanted an
|
|
22
|
+
AI assistant to help me tune it like an engineer would: look at the real config, change one thing at a time,
|
|
23
|
+
measure, and roll back if it got worse. So I built these servers to give it exactly that, safely.
|
|
24
|
+
|
|
25
|
+
The first thing it helped me find was something I couldn't find written anywhere: a guide to
|
|
26
|
+
[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).
|
|
27
|
+
I'm sharing it all in case it saves other sim racers some evenings of trial and error.
|
|
28
|
+
|
|
29
|
+
## Why not just edit the files?
|
|
30
|
+
|
|
31
|
+
You can. The point is letting an assistant do it **safely**:
|
|
32
|
+
|
|
33
|
+
- **Backup before every write**, one folder per change with a manifest, plus a JSON-lines `changes.log`.
|
|
34
|
+
- **`ac_undo`** restores any backup (and backs up the current state first, so undo is undoable).
|
|
35
|
+
Files a change created are removed on undo.
|
|
36
|
+
- **Edits are surgical**: comments, BOM and CRLF line endings survive; only the key you set changes.
|
|
37
|
+
- **Paths are fenced** to known roots and text extensions. No `..`, no executables, no arbitrary files.
|
|
38
|
+
- **Mod install is dry-run by default**, refuses zip-slip paths, never copies `.exe/.dll/.bat/.ps1/...`,
|
|
39
|
+
and refuses to run while the game is open.
|
|
40
|
+
- **Pimax changes need `confirm=True`**, which the tool description tells the model to pass only after you approve.
|
|
41
|
+
Values are validated against a closed list.
|
|
42
|
+
- **Read-only mode**: set `AC_CONFIG_MCP_READ_ONLY=1` / `PIMAX_MCP_READ_ONLY=1` and the write tools are not even registered.
|
|
43
|
+
|
|
44
|
+
## Requirements
|
|
45
|
+
|
|
46
|
+
- Windows, Python 3.10+
|
|
47
|
+
- `ac-config-mcp`: Assetto Corsa (Steam). CSP and Content Manager are optional but most tools assume them.
|
|
48
|
+
- `pimax-mcp`: Pimax Play running (tested with Pimax Play 2.0.4 and a Crystal OG). The CLI ships with Pimax Play.
|
|
49
|
+
|
|
50
|
+
## Install
|
|
51
|
+
|
|
52
|
+
Published on [PyPI](https://pypi.org/project/simrig-mcp/) and in the official
|
|
53
|
+
[MCP Registry](https://registry.modelcontextprotocol.io) as `io.github.luangrezende/ac-config-mcp` and
|
|
54
|
+
`io.github.luangrezende/pimax-mcp`. With [uv](https://docs.astral.sh/uv/) there is nothing to install by hand:
|
|
55
|
+
the client runs `uvx simrig-mcp acconfig` / `uvx simrig-mcp pimax`.
|
|
56
|
+
|
|
57
|
+
### Claude Code
|
|
58
|
+
|
|
59
|
+
```powershell
|
|
60
|
+
claude mcp add acconfig -- uvx simrig-mcp acconfig
|
|
61
|
+
claude mcp add pimax -- uvx simrig-mcp pimax
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Any MCP client (JSON)
|
|
65
|
+
|
|
66
|
+
```json
|
|
67
|
+
{
|
|
68
|
+
"mcpServers": {
|
|
69
|
+
"acconfig": { "command": "uvx", "args": ["simrig-mcp", "acconfig"] },
|
|
70
|
+
"pimax": { "command": "uvx", "args": ["simrig-mcp", "pimax"] }
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Without uv: `pip install simrig-mcp` puts `ac-config-mcp` and `pimax-mcp` on your PATH.
|
|
76
|
+
From source: `git clone https://github.com/luangrezende/simrig-mcp`, then `uv sync` (servers end up in `.venv\Scripts\`).
|
|
77
|
+
|
|
78
|
+
<!-- mcp-name: io.github.luangrezende/ac-config-mcp -->
|
|
79
|
+
<!-- mcp-name: io.github.luangrezende/pimax-mcp -->
|
|
80
|
+
|
|
81
|
+
## Configuration
|
|
82
|
+
|
|
83
|
+
Everything is auto-detected; override only if needed.
|
|
84
|
+
|
|
85
|
+
| Variable | Default |
|
|
86
|
+
|---|---|
|
|
87
|
+
| `AC_ROOT` | Steam library containing `steamapps\common\assettocorsa` (reads `libraryfolders.vdf`) |
|
|
88
|
+
| `AC_DOCUMENTS` | `<Documents>\Assetto Corsa` (follows OneDrive folder redirection) |
|
|
89
|
+
| `CM_PRESETS` | `%LOCALAPPDATA%\AcTools Content Manager\Presets` |
|
|
90
|
+
| `AC_CONFIG_MCP_HOME` | `%LOCALAPPDATA%\ac-config-mcp` (backups and `changes.log`) |
|
|
91
|
+
| `AC_CONFIG_MCP_READ_ONLY` | off |
|
|
92
|
+
| `PIMAX_CLI` | `%ProgramFiles%\Pimax\PimaxClient\pimaxui\resources\pimaxcli\pimax.exe` |
|
|
93
|
+
| `PIMAX_MCP_HOME` | `%LOCALAPPDATA%\pimax-mcp` (`changes.log`) |
|
|
94
|
+
| `PIMAX_MCP_READ_ONLY` | off |
|
|
95
|
+
|
|
96
|
+
## Tools
|
|
97
|
+
|
|
98
|
+
### ac-config-mcp
|
|
99
|
+
|
|
100
|
+
Files are addressed as `<root>/<relative path>`:
|
|
101
|
+
`cfg/` (Documents\Assetto Corsa\cfg), `ext/` (CSP overrides), `pure/`, `sys/` (game `system\cfg`),
|
|
102
|
+
`apps/`, `extcfg/` (`extension\config-ext`), `acroot/` (only `opencomposite.ini`).
|
|
103
|
+
|
|
104
|
+
| Read | Write (backup + log + undo) |
|
|
105
|
+
|---|---|
|
|
106
|
+
| `ac_status` - AC/CM running, roots, last changes | `ac_set`, `ac_set_many` - set ini keys |
|
|
107
|
+
| `ac_list_files`, `ac_read` - ini files as values | `ac_apply_video_preset`, `ac_save_video_preset` |
|
|
108
|
+
| `ac_csp_doc` - CSP default + inline docs + your override | `ac_apply_csp_preset`, `ac_save_csp_preset` |
|
|
109
|
+
| `ac_list_presets`, `ac_read_video_preset` | `ac_set_pp_filter`, `ac_set_python_app` |
|
|
110
|
+
| `ac_list_pp_filters`, `ac_list_apps` | `ac_write_text`, `ac_replace_text` - Lua/Python/config text |
|
|
111
|
+
| `ac_read_text`, `ac_list_backups` | `ac_install_mod` (dry run by default), `ac_undo` |
|
|
112
|
+
|
|
113
|
+
Notes: Content Manager does not watch these files, so an open CM may show old values until it reloads.
|
|
114
|
+
With AC running, most changes apply on the next session.
|
|
115
|
+
|
|
116
|
+
### pimax-mcp
|
|
117
|
+
|
|
118
|
+
| Tool | Source |
|
|
119
|
+
|---|---|
|
|
120
|
+
| `pimax_status`, `pimax_doctor` | Pimax CLI |
|
|
121
|
+
| `pimax_settings` | Pimax CLI: quality, brightness, local dimming, overlay scale, eye tracking |
|
|
122
|
+
| `pimax_runtime_state` | PiService log: per-app render scale, FOV, foveated/quad views, smart smoothing, upscaling actually read by the runtime |
|
|
123
|
+
| `pimax_runtime_stats` | Compositor log: app vs compositor FPS, % missed frames, stale/discarded, GPU%/CPU% per session (`exe="acs"` for AC) |
|
|
124
|
+
| `pimax_set` | Pimax CLI, closed list of settings, `confirm=True` required |
|
|
125
|
+
|
|
126
|
+
Refresh rate, FOV, foveated rendering and Smart Smoothing are not exposed by the Pimax CLI; change them in Pimax Play.
|
|
127
|
+
The PimaxClient `config.json` (login token) is never read.
|
|
128
|
+
|
|
129
|
+
## Example session
|
|
130
|
+
|
|
131
|
+
> "AC in VR feels choppy on the straight after turn 1. Check what the Pimax runtime is doing and suggest one change."
|
|
132
|
+
|
|
133
|
+
The assistant reads `pimax_runtime_stats(exe="acs")` (missed frames, GPU%), `pimax_runtime_state` and
|
|
134
|
+
`ac_read("ext/vr_tweaks.ini")`, proposes a single change, applies it with `ac_set` after you agree, and after
|
|
135
|
+
your next stint compares the stats again. If it got worse: `ac_undo`.
|
|
136
|
+
|
|
137
|
+
## Development
|
|
138
|
+
|
|
139
|
+
```powershell
|
|
140
|
+
uv sync
|
|
141
|
+
uv run pytest
|
|
142
|
+
uv run ruff check .
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Tests run against temporary folders and fake processes; they never touch a real game or headset.
|
|
146
|
+
|
|
147
|
+
## License
|
|
148
|
+
|
|
149
|
+
MIT. Not affiliated with Kunos Simulazioni, Ilja Jusupov (CSP / Content Manager) or Pimax.
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# Assetto Corsa in CSP's native OpenXR mode with eye-tracked foveated rendering (Pimax)
|
|
2
|
+
|
|
3
|
+
Most Assetto Corsa VR guides for Pimax headsets go through **OpenComposite**: AC speaks OpenVR, OpenComposite
|
|
4
|
+
translates it to the Pimax OpenXR runtime. That works, but the OpenVR API has no gaze data, so **no foveated
|
|
5
|
+
rendering in CSP can follow your eyes** on that path.
|
|
6
|
+
|
|
7
|
+
CSP 0.3.x ships its own OpenXR client. With it, CSP's variable rate shading (VRS) can follow the headset's eye
|
|
8
|
+
tracker. This page shows how to switch it on and what happened when I measured it. It is undocumented in the
|
|
9
|
+
community guides I found, so treat it as experimental.
|
|
10
|
+
|
|
11
|
+
## Test system
|
|
12
|
+
|
|
13
|
+
| | |
|
|
14
|
+
|---|---|
|
|
15
|
+
| Headset | Pimax Crystal OG (eye tracking), 90 Hz |
|
|
16
|
+
| Runtime | Pimax Play 2.0.4, Pimax OpenXR runtime active |
|
|
17
|
+
| PC | RTX 4090 (driver 621.14), Ryzen 7 7800X3D, Windows 11 |
|
|
18
|
+
| Game | Assetto Corsa + CSP 0.3.1 + Content Manager, Pure 3.x |
|
|
19
|
+
|
|
20
|
+
## How it was found
|
|
21
|
+
|
|
22
|
+
Strings inside CSP 0.3.1 (`dwrite.dll`) show an OpenXR client (`xrCreateInstance`, `OpenXR: instance ready`), the
|
|
23
|
+
camera mode value `__EXT_OPENXR` next to `OCULUS` / `OPENVR`, the message *"OpenXR requested; ACS will construct
|
|
24
|
+
StereoCameraVive"*, and a request for `XR_EXT_eye_gaze_interaction`. The Pimax OpenXR runtime
|
|
25
|
+
(`PiOpenXR_64.dll`) exposes that extension. CSP's own `extension\config\vr_tweaks.ini` documents
|
|
26
|
+
`[OPENXR_TWEAKS] EYE_TRACKING=1`: *"detailed areas of VRS follow the gaze, as long as the runtime provides that data"*.
|
|
27
|
+
|
|
28
|
+
## Setup
|
|
29
|
+
|
|
30
|
+
Take a backup of `Documents\Assetto Corsa\cfg` first (or let `ac-config-mcp` do it, see the end).
|
|
31
|
+
|
|
32
|
+
1. **Pimax Play**: calibrate eye tracking, turn **Pimax Play foveated rendering off** (do not stack two foveation layers).
|
|
33
|
+
2. **`Documents\Assetto Corsa\cfg\video.ini`**:
|
|
34
|
+
```ini
|
|
35
|
+
[CAMERA]
|
|
36
|
+
MODE=__EXT_OPENXR
|
|
37
|
+
```
|
|
38
|
+
The Content Manager build I used has no UI entry for this value. Save it as a separate CM video preset so your normal
|
|
39
|
+
OpenVR preset stays one click away, and re-check the file after picking a preset in CM.
|
|
40
|
+
3. **`Documents\Assetto Corsa\cfg\extension\vr_tweaks.ini`** (CSP overrides):
|
|
41
|
+
```ini
|
|
42
|
+
[SINGLE_PASS_STEREO]
|
|
43
|
+
USE_VRS=1
|
|
44
|
+
VRS_PRESET=PIMAX_RECOMMENDED
|
|
45
|
+
VRS_GAZE_DEBUG=1 ; first launch only: draws the VRS areas so you can see them follow your eyes
|
|
46
|
+
|
|
47
|
+
[OPENXR_TWEAKS]
|
|
48
|
+
EYE_TRACKING=1
|
|
49
|
+
RESOLUTION_MULTIPLIER=0.8
|
|
50
|
+
```
|
|
51
|
+
When CM applies a CSP preset it drops keys that equal the CSP default (`USE_VRS=1`, `EYE_TRACKING=1` may vanish
|
|
52
|
+
from the file). They are still active.
|
|
53
|
+
4. Launch from Content Manager. It opens directly in the headset; OpenComposite is not used in this mode.
|
|
54
|
+
|
|
55
|
+
### Check it is really working
|
|
56
|
+
|
|
57
|
+
`Documents\Assetto Corsa\logs\custom_shaders_patch.log` should mention the OpenXR session, `eye gaze tracking` and
|
|
58
|
+
`VRS gaze from eye tracker`. With `VRS_GAZE_DEBUG=1` the sharp area visibly follows your eyes. Turn the debug
|
|
59
|
+
overlay off afterwards; it costs performance.
|
|
60
|
+
|
|
61
|
+
## Results
|
|
62
|
+
|
|
63
|
+
Fixed scenario: BMW Z4 GT3, Red Bull Ring GP, clear 12:00, no AI, 90 Hz, Pimax render quality "high".
|
|
64
|
+
Frame times from [XRFrameTools](https://github.com/fredemmott/XRFrameTools) (OpenXR API layer, per frame);
|
|
65
|
+
missed frames from the Pimax compositor log (`pimax_runtime_stats` in this repo).
|
|
66
|
+
|
|
67
|
+
| Run | Per-eye resolution | Avg FPS | GPU render p95 | App CPU p95 | Late frames (> 1.5× budget) | Pimax missed |
|
|
68
|
+
|---|---|---|---|---|---|---|
|
|
69
|
+
| OpenXR + gaze VRS, multiplier 1.0, mirror 256 | 4560×5396 | 60 | 18.1 ms | 14.2 ms | 46% | n/a |
|
|
70
|
+
| OpenXR + gaze VRS, multiplier 0.8, mirror 1024 (2 per frame) | ≈3648×4317 | **88.7** | **10.4 ms** | 1.3 ms | **0.5%** | 1.4% |
|
|
71
|
+
|
|
72
|
+
The 90 Hz budget is 11.1 ms. The second run holds it, with little headroom.
|
|
73
|
+
|
|
74
|
+
**Read this honestly:**
|
|
75
|
+
- One run per condition; my own protocol asks for three. Driving variation is not ruled out.
|
|
76
|
+
- Run 2 changed several things at once; most of the gain is the resolution multiplier (−36% pixels). The gaze-driven
|
|
77
|
+
VRS is what makes 0.8 look acceptable in the centre of view, but its isolated cost/benefit was not measured.
|
|
78
|
+
- I did **not** measure the OpenComposite path on the same scenario, so this is not a proof that OpenXR mode beats it.
|
|
79
|
+
It is proof that eye-tracked VRS works in AC on a Pimax, and a working starting point.
|
|
80
|
+
- `RESOLUTION_MULTIPLIER` belongs to `[OPENXR_TWEAKS]` and only applies in this mode. On the OpenComposite path the
|
|
81
|
+
game renders at the full Pimax resolution, which matters if you compare the two.
|
|
82
|
+
|
|
83
|
+
## What crashed or did not help (CSP 0.3.1, driver 621.14)
|
|
84
|
+
|
|
85
|
+
| Change | Result |
|
|
86
|
+
|---|---|
|
|
87
|
+
| `VRS_PRESET=CUSTOM` with narrow areas (`VRS_RATE=6`, `VRS_AREA=4`) | Crash in the NVIDIA driver (`nvwgf2umx`) ~9 ms after "VRS gaze from eye tracker", twice. Stick to the built-in presets. |
|
|
88
|
+
| DLSS (CSP `[FSR] OLD_IMPLEMENTATION=3`) **with** VRS, two variants | Crash in `nvwgf2umx` during load, both times. **DLSS + VRS = crash** on this combination. |
|
|
89
|
+
| DLSS **without** VRS, multiplier 1.0, MSAA off | Ran: 86.6 FPS, GPU p95 11.1 ms. No FPS gain over gaze VRS and visibly softer at distance. Dropped. |
|
|
90
|
+
| `VRS_PRESET=PIMAX_LOW` instead of `PIMAX_RECOMMENDED` | No gain (GPU p95 11.3 vs 10.4 ms, late frames 2.7% vs 0.5%, one run). Kept RECOMMENDED. |
|
|
91
|
+
| DLSS log says *"Failed to activate ... enable Allow in VR"* | Needs `ALLOW_IN_VR=1` in `extra_fx.ini`; did not avoid the crash. |
|
|
92
|
+
|
|
93
|
+
## Small fixes found along the way
|
|
94
|
+
|
|
95
|
+
- **Apps taskbar pops up in VR**: CSP's `[CONTROLLERS_INTEGRATION] INTERACT_WITH_UI=1` turns the Pimax controller into
|
|
96
|
+
a pointer; resting near the edge opens the taskbar. `gui.ini [HIDE] HIDE_TASKBAR=1` in the VR CSP preset fixes it
|
|
97
|
+
and the pointer still clicks menus.
|
|
98
|
+
- **First launch closed while loading**: another process (a local LLM server) held ~18 GB of VRAM. After closing it,
|
|
99
|
+
the session loaded normally. Check VRAM before the first OpenXR launch; CSP rebuilds shader caches then.
|
|
100
|
+
- **Image too dark** at Pimax local dimming 100: 60 looked better on the Crystal OG (`pimax_set local_dimming 60`).
|
|
101
|
+
|
|
102
|
+
## Doing it with the MCP servers
|
|
103
|
+
|
|
104
|
+
The whole procedure is a handful of `ac-config-mcp` calls, each backed up and undoable:
|
|
105
|
+
|
|
106
|
+
```text
|
|
107
|
+
ac_set_many([
|
|
108
|
+
{file: "cfg/video.ini", section: "CAMERA", key: "MODE", value: "__EXT_OPENXR"},
|
|
109
|
+
{file: "ext/vr_tweaks.ini", section: "SINGLE_PASS_STEREO", key: "USE_VRS", value: "1"},
|
|
110
|
+
{file: "ext/vr_tweaks.ini", section: "SINGLE_PASS_STEREO", key: "VRS_PRESET", value: "PIMAX_RECOMMENDED"},
|
|
111
|
+
{file: "ext/vr_tweaks.ini", section: "OPENXR_TWEAKS", key: "EYE_TRACKING", value: "1"},
|
|
112
|
+
{file: "ext/vr_tweaks.ini", section: "OPENXR_TWEAKS", key: "RESOLUTION_MULTIPLIER", value: "0.8"}
|
|
113
|
+
])
|
|
114
|
+
ac_save_video_preset("VR (OpenXR CSP)")
|
|
115
|
+
ac_save_csp_preset("VR gaze VRS")
|
|
116
|
+
# drive, then:
|
|
117
|
+
pimax_runtime_stats(exe="acs")
|
|
118
|
+
# not happy:
|
|
119
|
+
ac_undo()
|
|
120
|
+
```
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling>=1.25"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "simrig-mcp"
|
|
7
|
+
version = "0.1.1"
|
|
8
|
+
description = "MCP servers for sim racing on Windows: Assetto Corsa / CSP / Content Manager config and Pimax VR headsets."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
license-files = ["LICENSE"]
|
|
12
|
+
requires-python = ">=3.10"
|
|
13
|
+
dependencies = ["mcp>=1.2"]
|
|
14
|
+
keywords = ["mcp", "assetto-corsa", "csp", "content-manager", "pimax", "openxr", "vr", "sim-racing"]
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Operating System :: Microsoft :: Windows",
|
|
17
|
+
"Programming Language :: Python :: 3",
|
|
18
|
+
"Topic :: Games/Entertainment :: Simulation",
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
[project.urls]
|
|
22
|
+
Homepage = "https://github.com/luangrezende/simrig-mcp"
|
|
23
|
+
Issues = "https://github.com/luangrezende/simrig-mcp/issues"
|
|
24
|
+
Guide = "https://github.com/luangrezende/simrig-mcp/blob/main/docs/assetto-corsa-csp-openxr-eye-tracked-vrs.md"
|
|
25
|
+
|
|
26
|
+
[project.scripts]
|
|
27
|
+
simrig-mcp = "simrig_mcp.__main__:main"
|
|
28
|
+
ac-config-mcp = "simrig_mcp.acconfig.server:main"
|
|
29
|
+
pimax-mcp = "simrig_mcp.pimax.server:main"
|
|
30
|
+
|
|
31
|
+
[dependency-groups]
|
|
32
|
+
dev = ["pytest>=8", "ruff>=0.6"]
|
|
33
|
+
|
|
34
|
+
[tool.hatch.build.targets.wheel]
|
|
35
|
+
packages = ["src/simrig_mcp"]
|
|
36
|
+
|
|
37
|
+
[tool.pytest.ini_options]
|
|
38
|
+
testpaths = ["tests"]
|
|
39
|
+
|
|
40
|
+
[tool.ruff]
|
|
41
|
+
line-length = 130
|
|
42
|
+
target-version = "py310"
|
|
43
|
+
|
|
44
|
+
[tool.ruff.lint]
|
|
45
|
+
select = ["E", "F", "W", "I", "B", "UP"]
|