Expand description
§rpfm_server
Backend process for Rusted PackFile Manager. Hosts the heavy work
that the Qt6 UI (rpfm_ui) and AI / MCP clients drive remotely:
Pack I/O, schema decoding, diagnostics, search, dependencies, optimisation
and so on.
§Architecture
The server is built on [axum] (HTTP + WebSocket) and [tokio]. It binds
to 127.0.0.1:45127 by default and exposes three endpoints:
| Endpoint | Method | Purpose |
|---|---|---|
/ws | GET | WebSocket upgrade. Carries the rpfm_ipc command/response protocol. |
/sessions | GET | REST: list every active session (used by the UI session picker). |
/mcp | * | MCP StreamableHttpService exposing the same surface to AI / MCP clients. |
Every client connection is wrapped in a session::Session managed by a
session::SessionManager. Each session owns a dedicated background
thread (see background_thread) that processes commands serially against
its own in-memory state (open packs, dependency cache, settings cache),
so multiple concurrent clients can’t step on each other.
§Modules
background_thread— central command dispatcher; one async loop per session.comms— generic mpsc-based request/response abstraction used to talk to the background thread.server_websocket—/wsupgrade handler and message multiplexer.server_mcp—/mcpendpoint: tools, prompts, resources for MCP clients.session—SessionManager,Session, lifecycle and timeout handling.settings— JSON-backed settings store with batch-write optimisation.updater— self-update checks against GitHub releases.
§Telemetry
Logging, panic capture and action telemetry are wired through
rpfm_telemetry. The Sentry guard returned by Logger::init is held
for the process lifetime in main.
Modules§
- background_
thread - Per-session command dispatcher — where every Pack, schema, search, diagnostics and dependency operation actually runs.
- comms
- Inter-thread communication primitives.
- server_
mcp - Model Context Protocol server exposed at the
/mcpendpoint. - server_
websocket - WebSocket upgrade handler and message multiplexer for the
/wsendpoint. - session
- Per-client session state and lifecycle.
- settings
- Persistent settings store and config-path helpers.
- updater
- Self-update checks against GitHub releases.
Macros§
- set_
batch - Macro to set a batch of settings in one go in an efficient way.
Constants§
- APP_
NAME 🔒 - Application name used to derive the OS-specific config directory.
- DEFAULT_
ADDRESS 🔒 - Default IP address the HTTP server binds to (
127.0.0.1/ loopback). - DEFAULT_
PORT 🔒 - Default TCP port the HTTP server listens on.
- ORG_
DOMAIN 🔒 - Organisation domain used to derive the OS-specific config directory
(mirrors
QCoreApplication::organizationDomainon the UI side). - ORG_
NAME 🔒 - Organisation name used to derive the OS-specific config directory.
- SENTRY_
DSN_ 🔒KEY - Sentry DSN used for crash reports and action telemetry.
Statics§
- GLOBAL 🔒
Functions§
- main 🔒
- Process entry point.
- sessions_
handler 🔒 - REST endpoint to get information about all active sessions.