AI-powered development toolkit for FiveM and RedM resource development in Cursor IDE.
Getting Started • Documentation • Features • Quick Start • MCP Server • Skills • Rules • Roadmap
10 skills • 6 rules • 11 MCP tools • 11,500+ natives • 101 events • 25 snippets • 11 templates
Scaffold complete FiveM/RedM resources, look up native functions, generate manifests, detect frameworks, search documentation, and write optimized scripts in Lua, JavaScript, and C# -- all from within Cursor's AI chat. Covers the full CFX development lifecycle from project setup to database integration.
First time here? The Getting Started guide walks you through every step -- from installing Git, Python, and Cursor to building and deploying your first FiveM/RedM resource. No prior experience required.
flowchart LR
A["You ask Cursor\na CFX question"] --> B["Cursor loads\na Skill"]
B --> C{"MCP server\navailable?"}
C -- Yes --> D["CFX MCP Server\n(11 tools)"]
C -- No --> E["Skill guidance\nonly"]
D --> F["Scaffold, lookup,\ngenerate, search,\ndetect, docs"]
E --> G["AI-assisted answer\nin Cursor chat"]
F --> G
Skills teach Cursor how to handle CFX development prompts. Rules enforce FiveM/RedM best practices in your code. The MCP server provides programmatic tools so skills can scaffold resources, look up natives, and generate manifests directly.
Already have Git, Python 3.10+, and Cursor installed? Here's the short version:
git clone https://github.com/TMHSDigital/CFX-Developer-Tools.git
cd CFX-Developer-Tools
pip install -r mcp-server/requirements.txt
# Then open the CFX-Developer-Tools folder in Cursor (File > Open Folder)Then ask the AI agent to scaffold a resource, look up a native, or generate a manifest.
Need more detail? The Getting Started guide covers installing prerequisites, troubleshooting, and building your first resource step by step.
- Resource scaffolding -- Generate complete resources in Lua, JavaScript, or C# with proper
fxmanifest.lua - Framework detection -- Automatically detect and adapt to ESX, QBCore, Qbox, ox_core, VORP, RSG, or standalone
- Native function lookup -- Search GTA5/RDR3 native functions by name or description via MCP tools
- Performance-aware coding rules -- Catch common mistakes (
Wait(0)in loops, runtime hashing, etc.) - Snippet library -- 25 copy-paste-ready code patterns across all three runtimes
- NUI development support -- Skills and patterns for building in-game web UIs
- Database integration -- oxmysql query patterns, schema templates, and migration guidance
- Event reference -- Searchable database of 101 FiveM/RedM events across CFX, ESX, QBCore, Qbox, ox_core, VORP, and RSG
- Documentation search -- Query the FiveM/RedM docs index by keyword or section via MCP tools
- Framework auto-detection -- MCP tool that scans workspace files to detect ESX, QBCore, Qbox, ox_core, VORP, RSG, or standalone
Supported Frameworks
| Framework | Game | Status |
|---|---|---|
| ESX | FiveM | Supported |
| QBCore | FiveM | Supported |
| Qbox | FiveM | Supported |
| ox_core | FiveM | Supported |
| VORP | RedM | Supported |
| RSG | RedM | Supported |
| Standalone | Both | Supported |
Supported Languages
| Language | Client | Server |
|---|---|---|
| Lua | Yes | Yes |
| JavaScript | Yes | Yes |
| C# | Yes | Yes |
Supported Games
| Game | Platform |
|---|---|
| GTA5 | FiveM |
| RDR3 | RedM |
RDR3 is the Cfx.re game identifier for RedM, which targets Red Dead Redemption 2. It is the required value in fxmanifest.lua (game 'rdr3') and is used by the native databases and tooling, so it is kept verbatim.
| Skill | What it does |
|---|---|
| Resource Scaffolding | Generate complete resource boilerplate for any framework and language |
| Native Functions | Look up GTA5/RDR3 natives by name, hash, or description |
| fxmanifest | Author and validate fxmanifest.lua files with correct directives |
| Client-Server Patterns | Correct event communication, threading, and state sync patterns |
| Framework Detection | Auto-detect ESX, QBCore, Qbox, ox_core, VORP, RSG, or standalone and adapt code accordingly |
| Performance Optimization | Identify and fix CFX-specific performance pitfalls |
| NUI Development | Build in-game web UIs with proper message passing and devtools setup |
| Database Integration | oxmysql queries, schema design, migrations, and connection pooling |
| State Bags | Modern data sync with Entity/Player/Global state bags, change handlers, and security |
| txAdmin Integration | Control a running server, manage resources, search players, and kick players through the txAdmin API |
| Rule | What it does |
|---|---|
| Lua Conventions | Enforces CFX Lua idioms -- locals, proper event handlers, vector types, variable attributes |
| JavaScript Conventions | Enforces CFX JavaScript patterns -- async/await, proper exports, event typing |
| C# Conventions | Enforces CitizenFX C# patterns -- [FromSource], BaseScript, tick handlers |
| fxmanifest Standards | Validates manifest structure, version strings, dependency declarations |
| Security Best Practices | Flags server-side validation gaps, exposed endpoints, insecure patterns |
| Performance Rules | Catches Wait(0), runtime hashing, unnecessary tick handlers, memory leaks |
Lua (15)
| Snippet | Description |
|---|---|
client-event.lua |
Client-side event handler template |
server-event.lua |
Server-side event handler with source validation |
register-command.lua |
Command registration with permission checks |
thread-loop.lua |
Thread with proper Wait() usage |
nui-callback.lua |
NUI callback handler for client-side |
export-function.lua |
Exported function pattern |
config-template.lua |
Shared config file structure |
state-bag-entity.lua |
Entity state bag set/read pattern |
state-bag-player.lua |
Player state bag set/read pattern |
state-bag-handler.lua |
State bag change handler |
backtick-hash.lua |
Compile-time hashing with backticks |
routing-bucket.lua |
Routing bucket (instance) management |
variable-attributes.lua |
Lua 5.4 <const> and <close> attributes |
ace-permissions.lua |
ACE permission checks and config |
verified-payment-callback.lua |
HMAC-verified, idempotent payment callback that grants items safely |
JavaScript (7)
| Snippet | Description |
|---|---|
client-event.js |
Client-side event handler |
server-event.js |
Server-side event handler |
register-command.js |
Command registration |
thread-loop.js |
Tick-based loop pattern |
nui-callback.js |
NUI callback registration |
state-bag-entity.js |
Entity state bag set/read pattern |
state-bag-handler.js |
State bag change handler |
C# (3)
| Snippet | Description |
|---|---|
base-script.cs |
BaseScript class template |
tick-handler.cs |
Tick handler with async pattern |
register-command.cs |
Command registration with attributes |
| Template | Description |
|---|---|
| Standalone | Minimal Lua resource -- no framework dependency |
| ESX | ESX Legacy-ready resource with es_extended integration |
| QBCore | QBCore-ready resource with qb-core integration |
| Qbox | Qbox-ready resource with qbx_core integration |
| ox_core | ox_core-ready resource with ox_lib integration |
| VORP | VORP-ready RedM resource with vorp_core integration |
| RSG | RSG-ready RedM resource with rsg-core integration |
| JavaScript | Full JS resource with node_version '22', client/server structure |
| C# | .NET resource with .csproj, compiled DLL pattern |
| NUI Vite | Modern NUI with Vite + React, postMessage bridge, and HMR |
| NUI Svelte | Modern NUI with Vite + Svelte 5, Runes, postMessage bridge |
The companion MCP server provides programmatic tools that your AI agent can call directly. It finds its data files next to server.py, so it can be launched from any working directory (set CFX_DATA_PATH to use a different data folder; CFX_NATIVES_PATH is still accepted).
Prerequisites: Python 3.10+
cd mcp-server
pip install -r requirements.txtEnvironment variables:
| Variable | Required | Default | Description |
|---|---|---|---|
TXADMIN_URL |
No | http://127.0.0.1:40120 |
Base URL of the txAdmin panel |
TXADMIN_USERNAME |
For txAdmin tools | - | Admin username used to log into the panel |
TXADMIN_PASSWORD |
For txAdmin tools | - | Admin password |
CFX_DATA_PATH |
No | mcp-server/data |
Directory with the native, event and docs data (CFX_NATIVES_PATH is an accepted alias) |
CFX_SCAFFOLD_ROOT |
No | working directory | Where scaffold_resource_tool creates resources when no output_path/workspace_path is given |
Set the txAdmin credentials in your OS or shell environment, never in a committed config file. See the txadmin-integration skill for details.
Cursor (plugin install): the plugin manifest registers the server from mcp.json (${CURSOR_PLUGIN_ROOT}/mcp-server/server.py), so it starts automatically when Cursor invokes an MCP tool. When working inside this repository, .cursor/mcp.json is used instead.
Claude Code: inside this repository, the root .mcp.json registers the server. From any other project, register it once with an absolute path:
claude mcp add cfx-dev-tools -- python /absolute/path/to/CFX-Developer-Tools/mcp-server/server.pyOther MCP clients (stdio):
{
"mcpServers": {
"cfx-dev-tools": {
"command": "python",
"args": ["/absolute/path/to/CFX-Developer-Tools/mcp-server/server.py"]
}
}
}Available Tools (11)
| Tool | Description |
|---|---|
scaffold_resource_tool |
Create a new resource with boilerplate files for any framework/language combo. Inherits author from workspace. |
lookup_native_tool |
Search natives by name, hash, description, or category. Browse namespaces. |
generate_manifest_tool |
Generate a complete fxmanifest.lua with correct directives. Auto-detects scripts and NUI from workspace. |
validate_manifest_tool |
Validate an existing fxmanifest.lua: fx_version, games, lua54, unresolved script/files/ui_page entries, ui_page coverage, framework/game mismatch. Same checks as CI. |
search_events_tool |
Search 101 events by name, side, game, or framework (cfx, esx, qbcore, qbox, oxcore, vorp, rsg, baseevents, chat) |
detect_framework_tool |
Scan workspace files to detect ESX, QBCore, Qbox, ox_core, VORP, RSG, or standalone with confidence score |
search_docs_tool |
Search the FiveM/RedM documentation index by keyword or section |
txadmin_server_control_tool |
Start, stop, or restart the FXServer through txAdmin (requires txAdmin credentials) |
txadmin_resource_control_tool |
Start, stop, restart, or ensure a single resource through txAdmin |
txadmin_player_search_tool |
Search players by name, notes, or identifier through txAdmin |
txadmin_kick_player_tool |
Kick an online player by netid through txAdmin |
Usage Examples
Scaffold a resource:
Create a new QBCore resource called "qb-garage" with client and server scripts in Lua
Look up a native:
What native function gets a vehicle's current speed?
Generate a manifest:
Generate an fxmanifest.lua for an ESX resource with NUI, targeting both FiveM and RedM
Search events:
What events fire when a player connects to the server?
Search documentation:
How do I set up NUI callbacks?
Detect framework:
What framework does this resource use?
CFX-Developer-Tools/
.cursor-plugin/ Plugin manifest
.cursor/ MCP server configuration
skills/ AI skill files (10 skills)
rules/ Coding convention rules (6 rules)
snippets/ Code snippets -- Lua, JS, C# (25 files)
templates/ Resource starter templates (11 sets)
examples/ Complete, runnable reference resources (5)
mcp-server/ Python MCP server (11 tools), data files and tests
docs/ Architecture, roadmap, contributing guide, docs site landing page
assets/ Logo and images
.github/ CI/CD workflows (validate, release, drift-check, update-natives, update-docs-index, stale, deploy-docs)
mkdocs.yml Documentation site configuration
See docs/ROADMAP.md for the full project roadmap.
Release Plan
| Version | Milestone | Status |
|---|---|---|
| v0.1.x | Foundation -- skills, rules, snippets, templates, MCP server, CI/CD | Done |
| v0.2.0 | AGENTS.md and .cursorrules for AI agent guidance | Done |
| v0.3.0 | Native DB expansion -- 6300+ GTA5, 5800+ RDR3, category browsing, deprecation flags | Done |
| v0.4.x | Content expansion -- State Bags skill, NUI Vite template, vector docs, FiveM/RedM balance | Done |
| v0.5.0 | M3 Expansion -- docs search, 82 events, framework detection, smart code gen | Done |
| v0.6.0 | M3.5 Research Alignment -- Qbox/VORP/RSG, Svelte NUI, 101 events, 24 snippets, 11 templates | Done |
| v0.7.x - v0.13.x | Live docs index, txAdmin tools, runnable examples, verified payment callback snippet; see the CHANGELOG and releases | Done |
| v1.0.0 | Stable release -- marketplace listing, full documentation | Planned |
See CONTRIBUTING.md for guidelines on adding skills, rules, and improvements, including the required DCO sign-off.
If this plugin is useful to you, consider sponsoring the project.
CC BY-NC-ND 4.0 -- see LICENSE for details.
CFX Reference Links
Built by TMHSDigital
