A Windows-only local bridge that exposes MCStudio Apollo projects, logs, and operations through one local MCP proxy shared by Codex and the Web Manager.
Allurix runs inside MCStudio and uses MCStudio's loaded Apollo project model. MCP clients do not receive Apollo credentials and do not replay authenticated Apollo HTTP requests.
Codex
-> lightweight mcp_stdio_client.py per task
-> Streamable HTTP at 127.0.0.1:19132/mcp
-> stable shared allurix_bridge tool
Web Manager
-> legacy SSE at 127.0.0.1:19132/sse
mcp_proxy.py
-> one shared BridgeSupervisor and generation
-> legacy SSE client to 127.0.0.1:19131/sse
-> injected MCStudio allurix_bridge
-> tool DLLs in mcstudio_bridge/bin/tools
-> MCStudio Apollo project state
BRegister.dll is injected into the MCStudio process that owns port 19131.
It stops the native MCP server, registers allurix_bridge, and starts the
native server again. start-allurix-bridge.bat starts one mcp_proxy.py
service if port 19132 is not already listening. The service exposes
Streamable HTTP on /mcp, keeps /sse for Web Manager compatibility, and
connects to the native legacy SSE server on 19131/sse in the background.
When Codex starts first, mcp_stdio_client.py uses a cross-process lock to
start the same singleton service automatically. Per-task stdio adapters never
connect to 19131 and never own bridge state.
The supervisor states are starting, waiting_for_sse,
waiting_for_bridge, ready, suspended, stopping, and stopped.
Read-only calls wait up to 60 seconds for recovery; state-changing calls fail
immediately and are never replayed. Reconnect delays are 0.5, 1, 2, then 5
seconds. Every client observes the same generation, session, tool cache, and
fixed allurix_bridge tool.
Apollo HTTP is not an MCP fallback. All MCP operations go through the injected bridge and MCStudio's in-process state.
- Windows and MCStudio with its native MCP server enabled.
- Python 3.10 or newer. A virtual environment is optional.
- Visual Studio Build Tools with the x86 C++/CLI toolchain.
- MCStudio's
mcp_csharp_bridge.dll. - Administrator access if Windows denies opening the MCStudio process for DLL injection.
The scripts default to D:\MCStudio. Override MCSTUDIO_DIR and
MCSTUDIO_EXE when MCStudio is installed elsewhere.
Install the Python package and MCP dependency:
py -3 -m pip install -e .Build the x86 bridge from a Visual Studio Developer Command Prompt:
set MCSTUDIO_DIR=D:\MCStudio
build-bridge.batBuild output is written to the ignored mcstudio_bridge\bin directory.
Run:
set MCSTUDIO_EXE=D:\MCStudio\MCStudio.exe
start-allurix-bridge.batThe script performs this sequence:
- Starts the singleton MCP proxy on port
19132if needed. - Starts MCStudio if it is not already running.
- Waits for MCStudio's native MCP server on port
19131. - Finds the MCStudio process that owns port
19131. - Injects
BRegister.dllinto that exact process. - Waits for the bootstrap to register
allurix_bridgeand restart native MCP.
After changing AllurixBridge.cs, BRegister.cpp, or the injector, restart
MCStudio before rebuilding and injecting. Windows keeps those loaded binaries
locked. Tool DLLs are loaded from bytes and can be refreshed with the bridge's
reload command after replacement.
Register the lightweight stdio adapter:
codex mcp add allurix-bridge -- C:\Python314\python.exe D:\_Development\_Nightbreak\allurix-netease-mcp\mcp_stdio_client.py --proxy-url http://127.0.0.1:19132/mcp
codex mcp listRestart or open a new Codex task after adding the server. The MCP tool exposed
to Codex is named allurix_bridge.
Equivalent ~/.codex/config.toml configuration:
[mcp_servers.allurix-bridge]
command = "C:\\Python314\\python.exe"
args = [
"D:\\_Development\\_Nightbreak\\allurix-netease-mcp\\mcp_stdio_client.py",
"--proxy-url", "http://127.0.0.1:19132/mcp"
]
startup_timeout_sec = 10
tool_timeout_sec = 120127.0.0.1:19132/mcp is the Codex Streamable HTTP endpoint.
127.0.0.1:19132/sse remains available for legacy clients. Port 19131 is
only the proxy's MCStudio upstream and must not be configured as a Codex MCP
server.
All functionality is routed through one MCP tool:
{
"name": "allurix_bridge",
"arguments": {
"tool": "status",
"arguments": {}
}
}Always call projects first and use the returned project and node IDs. Do not
hardcode an Apollo project ID or assume that lobby/game node counts are fixed.
tool |
Arguments | Behaviour |
|---|---|---|
status |
{} |
Reports native MCP status, port, loaded tool count, tool directory, and DLL load errors. |
list |
{} |
Lists every loaded bridge tool. |
reload |
{} |
Reloads tool DLLs from disk without reinjecting the main bridge. |
projects |
{} |
Lists Apollo projects and all currently known lobby, game, master, service, and proxy nodes. |
logs |
apollo_id, server_id, optional lines, offset |
Reads Apollo server logs. Use lines: -200, offset: -1 for the latest window. |
client_logs |
optional tail_lines |
Reads the latest 1-1000 lines from MCStudio's local-client log buffer; default 200. |
confirm_redeploy |
apollo_id, confirmation |
Confirms the visible MCStudio redeploy dialog in-process; no mouse or keyboard automation. |
live_logs |
optional server_id |
Reads the Server Log window currently open in MCStudio. If supplied, server_id must match that window. |
deploy_logs |
apollo_id |
Reads deployment activity/history available in the loaded project. |
hotfix |
apollo_id, confirmation, optional client |
Queues server hotfix, or client hotfix when client: true. |
development_test |
apollo_id, confirmation |
Queues MCStudio's native development-test command. |
clear |
apollo_id, confirmation |
Queues stop-and-clear for the project. This interrupts its servers. |
redeploy |
apollo_id, confirmation |
Queues MCStudio's native redeploy flow. |
Discover projects and nodes:
{"tool":"projects","arguments":{}}Read the latest 200 lines from one returned node:
{
"tool": "logs",
"arguments": {
"apollo_id": 12345,
"server_id": 4000,
"lines": -200,
"offset": -1
}
}Read deployment logs:
{"tool":"deploy_logs","arguments":{"apollo_id":12345}}Read the latest local-client lines:
{"tool":"client_logs","arguments":{"tail_lines":200}}client_logs requires a local client launched through MCStudio.
live_logs requires the MCStudio Server Log window to be open.
Operation confirmations are exact and case-sensitive. MCStudio must also hold
server control for the selected Apollo project; otherwise the queued operation
is rejected with 未锁定服务器控制权,请锁定后重试。:
{"tool":"hotfix","arguments":{"apollo_id":12345,"confirmation":"HOTFIX 12345","client":false}}{"tool":"hotfix","arguments":{"apollo_id":12345,"confirmation":"HOTFIX 12345","client":true}}{"tool":"development_test","arguments":{"apollo_id":12345,"confirmation":"DEVELOPMENT TEST 12345"}}{"tool":"clear","arguments":{"apollo_id":12345,"confirmation":"CLEAR 12345"}}{"tool":"redeploy","arguments":{"apollo_id":12345,"confirmation":"REDEPLOY 12345"}}After the native redeploy confirmation dialog appears, confirm it in-process:
{"tool":"confirm_redeploy","arguments":{"apollo_id":12345,"confirmation":"CONFIRM REDEPLOY 12345"}}The confirmation tool only accepts the visible MCStudio redeploy dialog. It
invokes the unique enabled 确定 button through Windows UI Automation and
never uses mouse, keyboard, or Computer Use automation.
A request_queued response means the operation was submitted to MCStudio's UI
Dispatcher. It does not claim that the operation completed; observe MCStudio
and the relevant logs for completion.
The adapter reconnects after a stale native SSE session, but never replays the
interrupted call. The caller receives upstream_disconnected; a later call is
forwarded after recovery. This applies equally to read and state-changing
commands, preventing ambiguous duplicate execution.
Check the native endpoint:
netstat -ano | findstr :19131Enable/start MCP in MCStudio, then rerun start-allurix-bridge.bat.
Restart MCStudio, rebuild, then inject again. The main bridge and bootstrap are loaded modules and cannot be overwritten safely while MCStudio is using them.
Inspect:
mcstudio_bridge\bin\allurix_bootstrap.log
Then call allurix_bridge with status. A healthy response has
mcp_status: "Running", the expected tool count, and an empty load_errors
array. If the bootstrap DLL was already loaded, restart MCStudio before
injecting again.
Check the listener:
netstat -ano | findstr :19132Port 19132 must have exactly one mcp_proxy.py listener. Stop stale proxy
processes before starting the service again. Upstream reconnects happen inside
that process and do not replace the listener.
Read deploy_logs for the project. If it reports
未锁定服务器控制权,请锁定后重试。, acquire server control in MCStudio and
retry the operation. A queued response only confirms Dispatcher submission.
These tools read MCStudio UI buffers; they do not create or select their UI.
Launch a local client before using client_logs, and open the desired Server
Log window before using live_logs.
Run the local checks:
py -3 -m unittest discover -s tests -v
py -3.14 -m compileall -q apollo_core mcp_proxy.pyBuild validation covers the x86 C# bridge, injector, all tool DLLs, and the C++/CLI bootstrap.
mcp_proxy.py Singleton Streamable HTTP + legacy SSE proxy
mcp_stdio_client.py Lightweight Codex stdio adapter and singleton launcher
apollo_core/ Explicit read-oriented Apollo helpers
mcstudio_bridge/ Bridge, injector, bootstrapper, and MCP tool sources
Build output, runtime logs, local notes, tests, local captures, and editor metadata are ignored.
Licensed under the MIT License.