2 online 26 members  + Join RP Base  +
FreeScript

fivem-mcp

by VIRUXE  ·  version 2026.09.19  ·  updated 22 days ago

No reviews yet

Downloads
0
Reviews
0
Size
46 KB
Code check
Clean
Licence
Unlicense
Released
Nov 2026

MCP server for driving a FiveM client — input, screenshots, console commands over the client's devcon socket, logs, and RCON

fivem-mcp
fivem-mcp
An MCP server that lets an AI agent drive a FiveM client: launch it, connect
to a server, press keys and move the mouse, take screenshots, run console
commands, read the client log, and ask the game where the player is. It
speaks plain MCP over stdio, so any MCP client can use it; Claude Code is
what it was built and tested against. The server runs on the same machine
as the game, since it drives the client through local Windows APIs and
sockets.
Contents
  • Install (no build required)
  • How it works
  • Build from source
  • Register with an MCP client
  • Tools
  • Launching the client
  • The console: devcon, read_console and read_log
  • When RCON is worth configuring
  • The mcp_bridge companion resource
  • Things worth knowing
  • Troubleshooting
  • Development
Install (no build required)
This section is for people who just want to use fivem-mcp. If you want to
build it yourself, see Build from source.

  1. Download the latest release zip, fivem-mcp-v-win-x64.zip, from
the releases page.
Unzip it somewhere permanent, for example %LOCALAPPDATA%\fivem-mcp.

  1. Install the .NET 11 runtime if you do not already have it: get the
Windows x64 .NET Runtime (not the SDK) from
dotnet.microsoft.com/download/dotnet/11.0.
Check what is installed with:

   dotnet --list-runtimes

  1. Register the server with your MCP client. For Claude Code:

   claude mcp add fivem -- %LOCALAPPDATA%\fivem-mcp\FiveMMcp.exe

For other MCP clients, see the JSON snippet under
Register with an MCP client.

  1. Optional: the companion resource. Two of the tools, notify and
get_position, need resources/mcp_bridge running on the FiveM server;
everything else works without it. Download mcp_bridge-v.zip
from the same release and unzip it into the server's resources folder,
for example resources/[dev]/mcp_bridge. The zip is source, not a
built resource: build the two projects inside it once with `dotnet
build, then ensure mcp_bridge`. See
The mcp_bridge companion resource
for the build commands and what it registers.

  1. Optional: RCON. Most tools do not need it; it only matters when no
client is running or your player lacks permissions for a command. See
When RCON is worth configuring.

  1. First run: launch FiveM, either through the launch tool or by hand,
and connect to a server. Then check that everything works:

   get_window_status
   screenshot
   read_log

If the launcher refuses to start FiveM, set FIVEM_LAUNCH=explorer; see
Launching the client.

  1. Updating: download the new release zip and replace the contents of your
install folder with it. The MCP client keeps the old binary loaded until
it reconnects, so it needs to reconnect to pick up the new one (in
Claude Code: /mcp, then reconnect).
How it works
  MCP client (Claude Code, ...)
        |  stdio, MCP
        v
  FiveMMcp.exe ---------------------------------------------------+
SendInput (scan codes, Unicode)   -> keyboard and mouse
Win32 window APIs + screen capture-> screenshot, focus
TCP 127.0.0.1:29200 "devcon"      -> console_command,
notify, get_position,
read_console (tap)
file tail                          -> read_log
UDP/TCP rcon to the game server   -> rcon_command
   +-----------------------------------------------------------+

        v                                           v
  FiveM client (this machine)               FXServer (anywhere)
   devcon socket, F8 console, CitizenFX log   rcon, resources incl. mcp_bridge

Console commands (connect, quit, restart , admin commands) go
over the client's local devcon socket, so nothing appears on screen and
the F8 console never opens. That path needs no RCON password and works on
servers you do not administer, because a command the client does not handle
is forwarded to the server with the player's own permissions.

Keyboard and mouse input is synthesised with SendInput, because that is
the only way to actually play: to move, and to work NUI dialogs. Those tools
bring the game to the foreground; restore_focus hands your window back
afterwards.
Build from source
This section is for developers building fivem-mcp itself. If you just want
to use it, see Install (no build required).

  • Windows
  • .NET 11 SDK (pinned in global.json)
  • FiveM installed at %LOCALAPPDATA%\FiveM\FiveM.exe, or FIVEM_EXECUTABLE
pointing at it

Debug build with dotnet build, or dotnet publish -c Release for faster
startup in daily use. While an MCP client has the server running, the
binaries are locked; see Development.
Register with an MCP client
The server is a stdio MCP server, configured like any other. For Claude
Code, point it at the built executable with
claude mcp add fivem -- \bin\Release\net11.0-windows\FiveMMcp.exe,
or run from source with claude mcp add fivem -- dotnet run --project .

For clients configured through JSON, the equivalent entry is:

{
  "mcpServers": {
    "fivem": {
      "command": "C:\\path\\to\\fivem-mcp\\bin\\Release\\net11.0-windows\\FiveMMcp.exe",
      "env": {
        "FIVEM_RCON_PASSWORD": "optional, only for rcon_command",
        "FIVEM_RCON_ADDRESS": "127.0.0.1:30120"
      }
    }
  }
}

Tools
Tool, What it does

launch, Starts FiveM, optionally straight into a server; see Launching the client
quit_game, Closes the client; force terminates every FiveM process when it is hung
get_window_status, Whether the game window exists, its size and position, and focus state
focus_window, Brings the game to the foreground
restore_focus, Hands focus back to your previous window, falling back to minimising
minimize_window, Sends the game to the background
screenshot, PNG of the game window, optional crop and downscale
record, A burst of frames back to back, optionally clicking after the f

…