fivem-mcp-server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| FIVEM_HOST | No | Machine running the FiveM client (devcon host) | 127.0.0.1 |
| FIVEM_QUIET_MS | No | Consider command output done after this quiet period | 400 |
| FIVEM_MCP_DEBUG | No | `1` traces devcon frames and RCON round-trips on stderr | |
| FIVEM_EXECUTABLE | No | FiveM.exe for the `launch` tool | %LOCALAPPDATA%\FiveM\FiveM.exe |
| FIVEM_MCPB_TOKEN | No | Matches `mcpb_token` on the server; sent with every bridge request | |
| FIVEM_SERVER_LOG | No | Path to FXServer's redirected stdout; enables server-side `read_console` / `wait_for_console`. Not needed by the bridge since v0.5 | |
| FIVEM_RCON_ADDRESS | No | FXServer game port (UDP RCON + getinfo) | FIVEM_HOST:30120 |
| FIVEM_RCON_PASSWORD | No | Matches `rcon_password` in `server.cfg`; needed by `server_command` | |
| FIVEM_CONSOLE_CAPACITY | No | Client console lines kept in the ring buffer | 5000 |
| FIVEM_CLIENT_DEVCON_PORT | No | Override the client devcon port | 29200 then 29300 |
| FIVEM_COMMAND_TIMEOUT_MS | No | Default max wait for `client_command` output | 5000 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| logging | {} |
| prompts | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| statusA | Report RCON configuration for the server, the devcon connection to the FiveM client console, and the server log-file tailer. Call this first. |
| server_infoA | Ask the server's getinfo out-of-band endpoint: hostname, players online, max clients, protocol, game build. Works without rcon_password; use it to confirm which server you are pointed at. |
| server_commandA | Execute a command on the server console over UDP RCON (any command the console accepts: ensure/stop/restart, convars, registered commands). The reply carries the command's captured console output. Needs |
| client_commandA | Type a LOCAL console command into the running Legacy client's F8 console over devcon — no screen focus needed, nothing is typed into the game window. This is the process's console context (connect, quit, tooling commands), NOT the chat command layer: commands registered with RegisterCommand are chat commands and live in a different system (run them through server_command, which has console privileges, or drive the chat UI with the M2 input tools). Waits until output goes quiet and returns the lines the client console printed. |
| read_consoleA | Return recent console lines without running anything. For 'client', reads the devcon line buffer (live from the moment this server first connected; supports afterSeq paging). For 'server', tails FIVEM_SERVER_LOG (FXServer's redirected stdout) — the last 512 KB, filtered; afterSeq is not supported there. |
| wait_for_consoleA | Block until a line matching a regex appears. 'client' watches the live devcon stream; 'server' polls FIVEM_SERVER_LOG for newly written lines (only lines appended after the call count). Use after a fire-and-forget command, to watch for a resource's startup banner, an error, or a scripted RESULT: line. |
| list_commandsA | The devcon handshake streams every command the client console knows (CVAR frames). For server commands, run 'help' through server_command instead. Filter with a case-insensitive substring. |
| launchA | Launch FiveM, optionally straight into a server via the fivem://connect link. Default target is the configured game port. Returns immediately — watch window_status/client_command to see when the game is up. |
| quit_gameA | Graceful path: prints 'quit' to the client console over devcon and waits for the game to close (nothing is typed into the window). force: true kills the FiveM process tree instead — use it only when the game is wedged. |
| window_statusA | Whether the FiveM game window exists, its title/pid, on-screen rect, and whether it is the foreground window. Input/screenshot tools focus it automatically. |
| focus_windowA | Restores/minimizes-out if needed and steals foreground (remembering the previous window for restore_focus). Every input/screenshot tool calls this automatically. |
| restore_focusA | Returns foreground to whatever window was focused before this tool focused the game. |
| screenshotA | PNG of the FiveM window (PrintWindow with PW_RENDERFULLCONTENT; falls back to a screen BitBlt of the window rect when the swapchain returns black, which means whatever covers the window is also captured — the game is focused first). Downscaled so vision models can read it cheaply. COST WARNING: every screenshot stays in the transcript and is re-sent on every later turn - many shots multiply session latency. Prefer text probes (read_console, wait_for_console, bridge ops); when pixels are the evidence, keep maxSide small (640 suffices for layout checks) and crop to the panel of interest. |
| press_keyA | Press and release a key (scan codes — what GTA's DirectInput/raw input reads). Key name: W A S D E F Q space enter esc tab shift ctrl alt arrows up down left right, f1-f12, letters/digits. |
| hold_keyA | Key stays pressed until release_key. Use for movement (W) and camera. Key name: W A S D E F Q space enter esc tab shift ctrl alt arrows up down left right, f1-f12, letters/digits. Held keys are released if this process exits. |
| release_keyA | Release one held key, or all of them with key='all'. |
| type_textA | Sends Unicode key events — the F8 console and chat/NUI inputs read these normally. Open the target input first (e.g. client_command to focus, or a chat key like T). Does not press Enter. |
| mouse_moveA | Relative dx/dy drives the in-game camera; absolute x/y (screen pixels) positions the real cursor for NUI elements. |
| clickA | Click at the current cursor position (position it with mouse_move absolute first for NUI). |
| scrollA | Scroll the wheel (positive = up). NUI lists respond to it. |
| waitA | Sleep between actions — loading screens, walk cycles, held-key sequences. |
| read_client_logA | Tail the newest CitizenFX_log_*.log under the FiveM install — the same stream as read_console(client) but persisted across sessions, without the channel tags. |
| bridgeA | Runs an operation through the mcpb bridge resource — the half neither devcon nor RCON can reach. Server ops (target=server): ping, players, poll, call_export, trigger_event, wait; call_export {resource, method, args}, trigger_event {event, args, toClient?, player?} (event names must be in mcpb_event_allowlist). Client ops (target=client, needs src): ping, position, teleport, freeze, call_native, send_nui, nui_callback; teleport {x,y,z,heading?}, freeze {freeze}, call_native {name, args}, send_nui {resource, message, event?}, nui_callback {resource, endpoint, payload}. Client results are collected in-band via the bridge's poll queue — no FIVEM_SERVER_LOG needed. The bridge must be installed, started and enabled (mcpb_enabled true). |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| test_resource | Drive a resource from a clean restart through in-game behavior and produce an evidence-backed PASS/FAIL report. Needs a running server and (for the game-side steps) a connected client with the mcpb bridge installed. |
| smoke_check | Fast 'is anything on fire?' pass over the server and the running client — connections, errors, window state. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 23 tools
Most tools target distinct capabilities (input vs window vs console vs bridge), and descriptions go to lengths to clarify boundaries (e.g., server_command vs client_command vs the chat layer). However there is genuine overlap among the read/inspect tools (read_console, read_client_log, list_commands) and between the multi-purpose bridge and server_command/client_command, which could still cause misselection.
Many tools follow a verb_noun or clear noun pattern (read_console, hold_key, focus_window, window_status), but others are bare verbs or nouns (bridge, status, launch, click, scroll, wait) with no single governing convention. It stays readable but is a mixed bag rather than a predictable scheme.
23 tools is on the heavy side, but the surface spans genuinely separate domains — RCON server control, devcon client console, the mcpb bridge, raw input, and window/screenshot management — so nearly every tool earns its place. It is slightly over what feels ideal but not padded.
Coverage is broad and coherent: server and client command execution, console reading/waiting, bridge ops, full keyboard/mouse/text input, window focus, and screenshots. Minor gaps remain, such as a dedicated chat-send or screenshot-crop helper, but agents can work around these with existing primitives.