CheatEngineGM broker — MCP HTTP server, browser dashboard, and LLM client over miscusi-peek/cheatengine-mcp-bridge.
Project description
broker/ — CEGM Python broker
The long-running broker. Auto-spawned by plugin/cegm.lua on Cheat Engine startup. Hosts an MCP Streamable HTTP server, a built-in browser dashboard, and a WebSocket event stream — all on http://127.0.0.1:27077 by default. Spawns the vendored miscusi-peek/cheatengine-mcp-bridge Python child as a stdio MCP server and proxies its tools through.
See docs/ARCHITECTURE.md and ADR-0004.
Stack
- Python 3.12+
mcp1.27+ (FastMCP merged in-tree)starlette+uvicorn[standard]for HTTP + WebSocketopenaiSDK with custombase_urlfor LLM (default DeepSeek)anyiofor async,pydanticv2 for models,psutilfor parent-PID watchingruff(format + lint),mypy --strict,pytest+pytest-asynciouvfor env management and distribution (uv tool install cegm-broker)
Layout (Phase 1)
broker/
├── pyproject.toml # PEP 621 metadata, all deps + dev deps, tool configs
├── .python-version # 3.12
├── README.md
├── src/cegm_broker/
│ ├── __init__.py # __version__
│ ├── __main__.py # python -m cegm_broker -> cli.main()
│ ├── cli.py # argparse: --port, --parent-pid, --log-level, --print-config
│ ├── config.py # %LOCALAPPDATA%/CEGM/config.json loader (Pydantic)
│ ├── _logging.py # JSONL logger to file + stderr
│ ├── server.py # Starlette app, route mount
│ ├── mcp_proxy.py # spawns miscusi-peek child, forwards tools/list + tools/call
│ ├── mcp_extras.py # CEGM-namespaced @mcp.tool definitions
│ ├── llm.py # openai SDK wrapper, tool-call routing for /api/chat
│ ├── event_bus.py # asyncio fan-out to WebSocket subscribers
│ ├── ws.py # WebSocket handler at /events
│ ├── api.py # /api/chat, /api/config REST endpoints
│ ├── parent_watch.py # exits broker when CE PID disappears
│ └── snapshots.py # snapshot store under %LOCALAPPDATA%/CEGM/snapshots/
└── tests/
├── conftest.py
├── test_smoke.py # imports work; CLI prints help
├── test_mcp_proxy.py # spawn fake child, verify tool listing + call
├── test_event_bus.py
└── test_extras_cegm.py # cegm.preview_write/commit/cancel round-trip
Run (developer)
cd broker
uv sync # creates .venv, installs deps + dev deps
uv run cegm-broker --help
uv run cegm-broker --port 27077 --log-level debug
Run (end-user, once published)
uv tool install cegm-broker # one-time
# then CE plugin spawns it automatically; manual run is also fine:
cegm-broker --port 27077
Logging
Structured JSONL to %LOCALAPPDATA%\CEGM\logs\broker-YYYYMMDD.jsonl and mirrored to stderr. Stdout is reserved (kept clean in case we ever support MCP stdio transport). Activity events (tool calls, chat turns) are also appended to a session-specific file at %LOCALAPPDATA%\CEGM\activity\<session_id>.jsonl.
Status
Scaffold only — see docs/ROADMAP.md Phase 1.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cegm_broker-0.1.0a1.tar.gz.
File metadata
- Download URL: cegm_broker-0.1.0a1.tar.gz
- Upload date:
- Size: 42.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
14e82297548cf1ecde6b7fdfc0bbe04675db9b21053db083658f483f5677a891
|
|
| MD5 |
426900bbec12908bda017f8dd66d4dfd
|
|
| BLAKE2b-256 |
2764d524472041657c6f22022f5e96b998142dbe43ddb5a7cf1f8fe4ae2d30b8
|
Provenance
The following attestation bundles were made for cegm_broker-0.1.0a1.tar.gz:
Publisher:
release.yml on dwgx/CEGM
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cegm_broker-0.1.0a1.tar.gz -
Subject digest:
14e82297548cf1ecde6b7fdfc0bbe04675db9b21053db083658f483f5677a891 - Sigstore transparency entry: 1436435290
- Sigstore integration time:
-
Permalink:
dwgx/CEGM@c819f712f38b27390d528fe2beda54f441876cbf -
Branch / Tag:
refs/tags/v0.1.0a1 - Owner: https://github.com/dwgx
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c819f712f38b27390d528fe2beda54f441876cbf -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file cegm_broker-0.1.0a1-py3-none-any.whl.
File metadata
- Download URL: cegm_broker-0.1.0a1-py3-none-any.whl
- Upload date:
- Size: 42.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
695f62479f24cf0c2f385b19f49b85390c401cedb8885ab583d4abab26f07768
|
|
| MD5 |
19d997ce37fb8ca642b5dedd281c81fc
|
|
| BLAKE2b-256 |
02b2590da6f007eb23e233dc1259cf79f0d6d81cf4e6b39764a741ce7d4b7239
|
Provenance
The following attestation bundles were made for cegm_broker-0.1.0a1-py3-none-any.whl:
Publisher:
release.yml on dwgx/CEGM
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cegm_broker-0.1.0a1-py3-none-any.whl -
Subject digest:
695f62479f24cf0c2f385b19f49b85390c401cedb8885ab583d4abab26f07768 - Sigstore transparency entry: 1436435321
- Sigstore integration time:
-
Permalink:
dwgx/CEGM@c819f712f38b27390d528fe2beda54f441876cbf -
Branch / Tag:
refs/tags/v0.1.0a1 - Owner: https://github.com/dwgx
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c819f712f38b27390d528fe2beda54f441876cbf -
Trigger Event:
workflow_dispatch
-
Statement type: