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. |
/version | GET | REST: report the server build version + pid. |
/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§
- api
- Dispatcher of the API, translating
RpcRequests intoSessionStateoperations. - background_
thread - Per-session request loop.
- ceo_
builder - CEO Builder backend logic.
- jobs
- State of the jobs of a session. See
rpfm_ipc::api::jobs. - 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.
- state
- Per-session state, and the operations a session can run on it.
- translation_
hub - Submission of translations to the Translation Hub, and the GitHub sign-in it needs.
- updater
- Self-update checks against GitHub releases.
Constants§
- 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.
- GITHUB_
OAUTH_ CLIENT_ ID - Client ID of RPFM’s GitHub OAuth App, used to sign in to submit translations.
- POSTHOG_
API_ 🔒KEY_ VALUE - PostHog project API key used for telemetry and feedback.
- SENTRY_
DSN_ 🔒KEY - Sentry DSN used for crash reports.
Statics§
- GLOBAL 🔒
Functions§
- allowed_
origins - Returns the browser origins allowed to send requests to the server: only its own, as it serves no pages that call it.
- apply_
telemetry_ settings - Applies the telemetry toggles and the anonymous telemetry ID of the provided settings to the whole process.
- main 🔒
- Process entry point.
- sessions_
handler 🔒 - REST endpoint to get information about all active sessions.
- version_
handler 🔒 - REST endpoint reporting the server’s build version and process id.