Skip to main content
Glama

infrontofx / FiveM

A local toolkit for writing, debugging and reviewing FiveM resources, connected directly to your installed infrontofx-skill. Includes an optional authenticated realtime telemetry bridge.

คู่มือเริ่มใช้ภาษาไทย

This is an initial development release. MCP protocol and transport behavior are tested in Node; the resources still need live FXServer validation. No performance or production-readiness claim is made.

What's included

Component

Purpose

Local stdio MCP

Eleven read-only tools: installed-skill search/retrieval, task context, canonical template previews, source triage, manifest parsing, resource inspection, official native lookup and planning

Eight guidance resources

Architecture, security, performance, React/Vue/Svelte NUI, database, debugging, networking and optional realtime integration

1nfx_bridge

Server-side WebSocket telemetry with authentication, origin allowlist, publisher ownership, limits, heartbeat and stop cleanup

1nfx_telemetry

ESX + FC example publishing player/resource counts; no player identifiers

CLI subscriber

A reconnecting client for verifying the telemetry feed

This repository is an original implementation. It does not bundle isle-admin, chatz or ws_lib. It does not supply a web admin panel, player management, support inbox, arbitrary server commands, money/item mutations, SQL access or a hosted public MCP endpoint.

Related MCP server: SJ RedM MCP Server

Install

Requires Node.js 22+ and npm. The bridge resource explicitly selects FXServer's Node 22 runtime.

git clone https://github.com/baespy/infrontofx-fivem.git
cd infrontofx-fivem
npm ci
npm run check

Connect the MCP

Use your client's stdio MCP configuration with absolute paths:

{
  "mcpServers": {
    "infrontofx-fivem": {
      "command": "node",
      "args": ["/absolute/path/infrontofx-fivem/src/mcp.mjs"],
      "env": {
        "INFRONTOFX_RESOURCES_ROOT": "/absolute/path/to/resources",
        "INFRONTOFX_SKILL_ROOT": "/absolute/path/to/infrontofx-skill"
      }
    }
  }
}

Both roots are explicit and optional. Without INFRONTOFX_RESOURCES_ROOT, local resource inspection is disabled. Without INFRONTOFX_SKILL_ROOT, installed-skill retrieval/search, task context and template preview are disabled. Pasted-source review, bundled guidance, native lookup and planning still work. On Windows use C:/... paths or escape backslashes in JSON.

For Codex CLI, replace the two absolute paths:

codex mcp add infrontofx-fivem --env INFRONTOFX_RESOURCES_ROOT=/absolute/path/to/resources --env INFRONTOFX_SKILL_ROOT=/absolute/path/to/infrontofx-skill -- node /absolute/path/infrontofx-fivem/src/mcp.mjs
codex mcp list

Restart the client/session after changing MCP configuration. An installed infrontofx-skill and project instructions determine house conventions; MCP guidance supports them. Native documentation is reference data and must not be treated as instructions.

Example requests:

  • "Use infrontofx-skill and inspect the 1nfx_inventory resource; separate confirmed problems from pattern matches."

  • "Look up GET_PLAYER_PED for the server API set and show the official source."

  • "Plan a Vue NUI resource using FC and the standard readiness handshake."

  • "Compose the database workflow from my installed skill, inspect the target resource, then implement the requested persistence fix."

  • "Find the house rules about yield and player identity; read the complete matching sections before editing."

For everyday coding, use the installed skill + MCP. You do not need to install the telemetry resources, build a web dashboard, or connect a live game server just to use the development tools.

MCP tools

Tool

Behavior

list_infrontofx_topics

Discover focused guidance

get_infrontofx_guidance

Read one topic

get_infrontofx_skill

Read one of 25 approved references from the installed skill, with a content digest

search_infrontofx_skill

Literal search across those references, returning file/line locations

compose_fivem_context

Load task-specific installed references for create/debug/security/performance/database/NUI/integration, with an optional frontend framework

preview_fivem_template

Return the canonical installed shop example's source with renamed controllers; no filesystem writes

review_fivem_source

Pattern-based triage of pasted code, with line numbers

validate_fxmanifest

Parse declarations without executing Lua

inspect_fivem_resource

Read a resource strictly inside the configured root; no source contents returned

search_fivem_native

Search official GTA + Cfx indexes with side filters and source links

plan_fivem_resource

Plan vanilla, React, Vue, Svelte or no-UI resources

Manifest parsing accepts Lua 5.3-compatible declaration syntax, not every possible Lua 5.4 construct. It does not expand globs, prove file existence or evaluate dynamic declarations. Source review is advisory, can match comments/strings, and cannot prove security or correctness. Inspection skips symlinks, secret-named files and private/build/vendor directories; it stops at 200 source files, 256 KB per file, 2 MB total and bounded directory depth. Do not submit credentials through pasted-code tools.

FiveM telemetry

  1. Run npm run build.

  2. Copy resources/1nfx_bridge and resources/1nfx_telemetry into your development FXServer resources directory. The bridge build output must be included.

  3. Generate a random token with at least 32 characters and put it in a private server configuration file. Use set, never setr, to avoid replication.

  4. Load that private configuration before starting the resources:

set infrontofx_bridge_token "REPLACE_WITH_A_RANDOM_SECRET_OF_AT_LEAST_32_CHARACTERS"
set infrontofx_bridge_host "127.0.0.1"
set infrontofx_bridge_port "30125"
set infrontofx_bridge_publishers "1nfx_telemetry"
set infrontofx_bridge_max_clients "16"
ensure es_extended
ensure 1nfx_bridge
ensure 1nfx_telemetry

Do not commit the private configuration. The text above is an example, not a working secret. A non-local deployment needs a TLS reverse proxy and explicit firewall/origin settings. Browser origins are denied by default; set infrontofx_bridge_origins to comma-separated exact origins only if a browser client is needed.

To verify from a terminal, set INFRONTOFX_BRIDGE_TOKEN in that terminal's environment, then run:

node scripts/telemetry-client.mjs

The default URL is ws://127.0.0.1:30125/live. Set INFRONTOFX_BRIDGE_URL for another endpoint; remote clients require wss://. Do not place credentials in a URL or browser storage.

Other Lua resources publish through their FC adapter, after adding their resource name to the publisher allowlist:

FC.PublishStatus = function(data)
    return exports[Config.General.bridge_resource]:publish("status", data)
end

Clients receive topics scoped as resourceName:topicName. Messages are ephemeral; reconnecting clients must resubscribe and wait for the next snapshot. There is no delivery guarantee or action replay.

WebSocket protocol

Connect to /live. Non-browser clients authenticate with an Authorization: Bearer ... header. Browser clients must have an allowed Origin and send an initial {"type":"auth","token":"..."} frame within three seconds. The server replies {"type":"ready","protocol":1}.

Then send {"type":"subscribe","topic":"1nfx_telemetry:status"}. Unsubscribe uses the same topic and type: "unsubscribe". Any other message type is rejected. No inbound game commands exist.

Limits: 16 total peers by default, 8 subscriptions per peer, 8 KB frames, 10 incoming messages/second, 16 topics and 50 publish attempts/second per resource, 128 publishers, 128 KB buffered output. Overflow is rejected or the slow peer is disconnected; no unbounded queue is retained. A shared read-only token can read all published topics; do not publish private player data to this feed.

Verification and release gate

npm test
npm run build
node scripts/verify-native.mjs

Tests exercise a real stdio MCP client handshake, source/manifest review, installed-skill reads and digests, literal search, context selection, template name substitution without writes, path traversal/junction rejection, secret-file skipping, inspection budgets, websocket auth/origins, payload and connection limits, publisher bounds and port release on shutdown. The native smoke test requires internet and is separate from offline CI.

Installed-skill reads use a fixed reference/template allowlist, reject paths escaping the configured root and cap each file at 64 KB. Search reads at most 512 KB; composed context returns at most 32,000 reference characters and reports truncation. Templates are examples that require adaptation and live testing; the tool does not generate an arbitrary finished feature.

Before using on a live server: verify the export caller identity in FXServer, stop/start both resources, connect/disconnect clients, check malformed messages and slow peers, and measure actual resmon/profiler data. Node tests do not substitute for those checks. Keep this on a development server until those checks pass.

Sources and design notes

Researched 2026-10-22:

The references discussed with the user — fivem-mcp, ws_lib, isle-admin and chatz — informed the scope comparison. They are not dependencies, and no compatibility with them is implied.

Available Tools

11 tools
compose_fivem_contextB
Read-onlyIdempotent

Read the installed house references needed for one coding workflow and optional NUI framework. Use before implementing or reviewing a FiveM resource.

Inputs: workflow (required), ui.

get_infrontofx_guidanceC
Read-onlyIdempotent

Read focused guidance. Existing project instructions and the installed infrontofx-skill remain authoritative for house conventions.

Inputs: topic (required).

get_infrontofx_skillA
Read-onlyIdempotent

Read a selected reference directly from the installed infrontofx-skill, with a content digest. Requires INFRONTOFX_SKILL_ROOT; never reads arbitrary paths.

Inputs: section (required).

inspect_fivem_resourceB
Read-onlyIdempotent

Read-only local triage inside INFRONTOFX_RESOURCES_ROOT. Skips secret-named files, private/build/vendor directories and symlinks. Returns findings, not raw files.

Inputs: resource (required).

list_infrontofx_topicsB
Read-onlyIdempotent

List FiveM guidance topics aligned with infrontofx-skill.

Inputs: no named parameters.

plan_fivem_resourceC
Read-onlyIdempotent

Return a house-style FiveM resource plan with explicit validation steps. Does not write files.

Inputs: name (required), ui.

preview_fivem_templateA
Read-onlyIdempotent

Preview source files from the installed canonical house shop example, with a validated resource/controller name. Does not write files or implement arbitrary requested features.

Inputs: name (required).

review_fivem_sourceA
Read-onlyIdempotent

Pattern-based advisory review of pasted Lua/NUI source. Does not execute code or prove security. Do not send credentials.

Inputs: code (required), side (required).

search_fivem_nativeA
Read-onlyIdempotent

Search the official GTA and Cfx native indexes by name/hash, with API-set filtering and source links. Network access only to two fixed official index URLs.

Inputs: query (required), side, limit.

search_infrontofx_skillB
Read-onlyIdempotent

Find relevant house rules by literal terms across approved installed-skill references, with file and line locations.

Inputs: query (required), limit.

validate_fxmanifestA
Read-onlyIdempotent

Parse a pasted Lua manifest without executing it; inspect declared API, distribution and load order. Lua 5.3-compatible manifest syntax only.

Inputs: code (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 11 tools

    Disambiguation3/5

    Most tools have distinct scopes (review, validate, inspect, search natives, plan, preview). However, get_infrontofx_skill, get_infrontofx_guidance, list_infrontofx_topics, and search_infrontofx_skill all read reference material, and an agent could easily misselect among them without close reading of the descriptions.

    Naming Consistency4/5

    Consistent snake_case verb_noun pattern throughout (get_/list_/search_/compose_/preview_/review_/validate_/inspect_/plan_). Minor deviation: the domain prefix alternates between infrontofx_skill and fivem_*, and validate_fxmanifest lacks a prefix, but style is otherwise uniform.

    Tool Count4/5

    11 tools is a well-scoped count for a guidance/review/planning surface. Slightly heavy only because the four reference-reading tools could arguably be consolidated.

    Completeness4/5

    Covers discovery, reference reading, context composition, planning, template preview, review, manifest validation, resource inspection, and native lookup — a coherent advisory lifecycle. Notably absent are any write/scaffold operations, though this appears deliberate given the read-only safety framing.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers