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
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
This section is for people who just want to use fivem-mcp. If you want to
build it yourself, see Build from source.
Unzip it somewhere permanent, for example
dotnet.microsoft.com/download/dotnet/11.0.
Check what is installed with:
For other MCP clients, see the JSON snippet under
Register with an MCP client.
everything else works without it. Download
from the same release and unzip it into the server's resources folder,
for example
built resource: build the two projects inside it once with `dotnet
build
The mcp_bridge companion resource
for the build commands and what it registers.
When RCON is worth configuring.
If the launcher refuses to start FiveM, set
Launching the client.
it reconnects, so it needs to reconnect to pick up the new one (in
Claude Code:
How it works
Console commands (
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
the only way to actually play: to move, and to work NUI dialogs. Those tools
bring the game to the foreground;
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).
Debug build with
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
or run from source with
For clients configured through JSON, the equivalent entry is:
Tools
Tool, What it does
…
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
This section is for people who just want to use fivem-mcp. If you want to
build it yourself, see Build from source.
- Download the latest release zip,
fivem-mcp-v-win-x64.zip, from
Unzip it somewhere permanent, for example
%LOCALAPPDATA%\fivem-mcp.
- Install the .NET 11 runtime if you do not already have it: get the
dotnet.microsoft.com/download/dotnet/11.0.
Check what is installed with:
dotnet --list-runtimes
- Register the server with your MCP client. For Claude Code:
claude mcp add fivem -- %LOCALAPPDATA%\fivem-mcp\FiveMMcp.exeFor other MCP clients, see the JSON snippet under
Register with an MCP client.
- Optional: the companion resource. Two of the tools,
notifyand
get_position, need resources/mcp_bridge running on the FiveM server;everything else works without it. Download
mcp_bridge-v.zipfrom the same release and unzip it into the server's resources folder,
for example
resources/[dev]/mcp_bridge. The zip is source, not abuilt resource: build the two projects inside it once with `dotnet
build
, then ensure mcp_bridge`. SeeThe mcp_bridge companion resource
for the build commands and what it registers.
- Optional: RCON. Most tools do not need it; it only matters when no
When RCON is worth configuring.
- First run: launch FiveM, either through the
launchtool or by hand,
get_window_status
screenshot
read_logIf the launcher refuses to start FiveM, set
FIVEM_LAUNCH=explorer; seeLaunching the client.
- Updating: download the new release zip and replace the contents of your
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_bridgeConsole commands (
connect, quit, restart , admin commands) goover 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 isthe 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 backafterwards.
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, orFIVEM_EXECUTABLE
Debug build with
dotnet build, or dotnet publish -c Release for fasterstartup 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 clientquit_game, Closes the client; force terminates every FiveM process when it is hungget_window_status, Whether the game window exists, its size and position, and focus statefocus_window, Brings the game to the foregroundrestore_focus, Hands focus back to your previous window, falling back to minimisingminimize_window, Sends the game to the backgroundscreenshot, PNG of the game window, optional crop and downscalerecord, A burst of frames back to back, optionally clicking after the f…