# FiveM MCP

This MCP server lets an AI agent run and test FiveM through FXServer and a live client, with console access, logs, and game control.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 17
- Author: ziyacivan
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/ziyacivan/fivem-mcp
- Updated: 2026-10-02
- HTML: https://affpapa.org/en/nevibecode/mcp/fivem-mcp

## What it 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.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `FIVEM_HOST`, `FIVEM_CLIENT_DEVCON_PORT`, `FIVEM_RCON_ADDRESS`, `FIVEM_RCON_PASSWORD`, `FIVEM_SERVER_LOG`, `FIVEM_MCPB_TOKEN`, `FIVEM_EXECUTABLE`, `FIVEM_CONSOLE_CAPACITY`, `FIVEM_QUIET_MS`, `FIVEM_COMMAND_TIMEOUT_MS` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
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-server
```
Replace <…> with your own values. 6 more environment variables are in the server README

### Codex

**Platform CLI**
```bash
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-server
```
Replace <…> with your own values. 6 more environment variables are in the server README

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "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

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "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

### Gemini CLI

**Platform CLI**
```bash
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-server
```
Replace <…> with your own values. 6 more environment variables are in the server README

## When to use it
- 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
- 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 with `wait_for_console`.
- Send a server console command through `server_command` and return its output.

## Similar
- [Pascal 3D Editor](https://affpapa.org/en/nevibecode/mcp/pascal-3d-editor.md) — MCP server · ★ 25085
- [Unity-MCP](https://affpapa.org/en/nevibecode/mcp/unity-mcp.md) — MCP server · ★ 4523
- [mcp](https://affpapa.org/en/nevibecode/mcp/sceneview-mcp.md) — MCP server · ★ 1348
- [Gearboy MCP Server](https://affpapa.org/en/nevibecode/mcp/gearboy-mcp-server.md) — MCP server · ★ 1219
- [ChiR24-unreal_mcp_server](https://affpapa.org/en/nevibecode/mcp/chir24-unreal-mcp-server.md) — MCP server · ★ 975
- [Nova3D](https://affpapa.org/en/nevibecode/mcp/nova3d.md) — MCP server · ★ 733

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
