FiveM MCP — Claude Code MCP server: setup
This MCP server lets an AI agent run and test FiveM through FXServer and a live client, with console access, logs, and game control.
claude mcp add --env FIVEM_HOST=<FIVEM_HOST> --env FIVEM_CLIENT_DEVCON_PORT=<FIVEM_CLIENT_DEVCON_PORT> --env FIVEM_RCON_ADDRESS=<FIVEM_RCON_ADDRESS> --env FIVEM_RCON_PASSWORD=<FIVEM_RCON_PASSWORD> --env FIVEM_SERVER_LOG=<FIVEM_SERVER_LOG> --transport stdio fivem-mcp -- npx -y fivem-mcp-serverWhat FiveM MCP does
FiveM MCP connects an AI agent to FXServer over UDP RCON and to a Legacy FiveM client through devcon. The agent can inspect server details, send console commands, read client or server output, wait for a regex match, and launch the client at a chosen address.
The server requires Node 22+, an FXServer you administer, and FIVEM_RCON_PASSWORD matching rcon_password. Set FIVEM_SERVER_LOG to enable server-log reading; the mcpb bridge uses FIVEM_MCPB_TOKEN. Keyboard, mouse, and screenshot tools run on Windows only. Client-console tools depend on the Legacy client because Enhanced removed the client devcon ports.
What it helps with
- test a resource in a live FiveM client
- send FXServer commands over RCON
- inspect the FiveM client console
- wait for a matching log line
- launch and quit FiveM from an agent
Example prompts for the agent
- Check the server and client connections with
status, then report which paths are ready. - Launch FiveM at
host:port, run a client check, and wait for a matching line withwait_for_console. - Send a server console command through
server_commandand return its output.
How to install FiveM MCP
Platform CLI
claude mcp add --env FIVEM_HOST=<FIVEM_HOST> --env FIVEM_CLIENT_DEVCON_PORT=<FIVEM_CLIENT_DEVCON_PORT> --env FIVEM_RCON_ADDRESS=<FIVEM_RCON_ADDRESS> --env FIVEM_RCON_PASSWORD=<FIVEM_RCON_PASSWORD> --env FIVEM_SERVER_LOG=<FIVEM_SERVER_LOG> --transport stdio fivem-mcp -- npx -y fivem-mcp-serverReplace <…> with your own values. 6 more environment variables are in the server README
Platform CLI
codex mcp add fivem-mcp --env FIVEM_HOST=<FIVEM_HOST> --env FIVEM_CLIENT_DEVCON_PORT=<FIVEM_CLIENT_DEVCON_PORT> --env FIVEM_RCON_ADDRESS=<FIVEM_RCON_ADDRESS> --env FIVEM_RCON_PASSWORD=<FIVEM_RCON_PASSWORD> --env FIVEM_SERVER_LOG=<FIVEM_SERVER_LOG> -- npx -y fivem-mcp-serverReplace <…> with your own values. 6 more environment variables are in the server README
Config file
{
"mcpServers": {
"fivem-mcp": {
"command": "npx",
"args": [
"-y",
"fivem-mcp-server"
],
"env": {
"FIVEM_HOST": "<FIVEM_HOST>",
"FIVEM_CLIENT_DEVCON_PORT": "<FIVEM_CLIENT_DEVCON_PORT>",
"FIVEM_RCON_ADDRESS": "<FIVEM_RCON_ADDRESS>",
"FIVEM_RCON_PASSWORD": "<FIVEM_RCON_PASSWORD>",
"FIVEM_SERVER_LOG": "<FIVEM_SERVER_LOG>"
}
}
}
}Replace <…> with your own values. 6 more environment variables are in the server README
Config file
{
"servers": {
"fivem-mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"fivem-mcp-server"
],
"env": {
"FIVEM_HOST": "<FIVEM_HOST>",
"FIVEM_CLIENT_DEVCON_PORT": "<FIVEM_CLIENT_DEVCON_PORT>",
"FIVEM_RCON_ADDRESS": "<FIVEM_RCON_ADDRESS>",
"FIVEM_RCON_PASSWORD": "<FIVEM_RCON_PASSWORD>",
"FIVEM_SERVER_LOG": "<FIVEM_SERVER_LOG>"
}
}
}
}Replace <…> with your own values. 6 more environment variables are in the server README
Platform CLI
gemini mcp add -e FIVEM_HOST=<FIVEM_HOST> -e FIVEM_CLIENT_DEVCON_PORT=<FIVEM_CLIENT_DEVCON_PORT> -e FIVEM_RCON_ADDRESS=<FIVEM_RCON_ADDRESS> -e FIVEM_RCON_PASSWORD=<FIVEM_RCON_PASSWORD> -e FIVEM_SERVER_LOG=<FIVEM_SERVER_LOG> fivem-mcp npx -y fivem-mcp-serverReplace <…> with your own values. 6 more environment variables are in the server README
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about FiveM MCP
How do I install FiveM MCP in Claude Code?
Run claude mcp add fivem-mcp -e FIVEM_RCON_PASSWORD=<FIVEM_RCON_PASSWORD> -e FIVEM_MCPB_TOKEN=<FIVEM_MCPB_TOKEN> -- npx -y fivem-mcp-server.
What does FiveM MCP do?
It gives an agent access to FXServer and a Legacy FiveM client. The available workflow covers RCON and devcon commands, console output, game launch, and output-based waits.
What does FiveM MCP require for client tools?
A running Legacy FiveM client is required on the machine hosting the MCP server. server_command also needs a password that matches rcon_password.