Repository navigation
Description
Summary
generate_manifest_tool writes each table entry on its own line with no separator, so any manifest with more than one entry in a block is invalid Lua. The workspace scan also drops shared scripts, hardcodes ui_page 'html/index.html', and duplicates globbed files.
Where
mcp-server/tools/manifest_gen.py:110-118(generate_manifest, client/server table rendering)mcp-server/tools/manifest_gen.py:47-53(scannedsharedbucket ignored)mcp-server/tools/manifest_gen.py:85-91(config.luaalways emitted, globs plus scanned files)mcp-server/tools/manifest_gen.py:101-108(unclassified scripts routed toclient_scripts)mcp-server/tools/manifest_gen.py:120-126(hardcodedui_page/files)mcp-server/tools/manifest_gen.py:67-68, 81, 104-106(values interpolated into Lua strings unescaped)mcp-server/tools/manifest_common.py:25-26(AUTHOR_RE/DESC_RE)mcp-server/tools/manifest_common.py:131-143(detect_nui_presencereturns only a bool)
Details
lines.append("client_scripts {")
for entry in client_entries:
lines.append(f" {entry}")
lines.append("}")With scripts=['client/a.lua'], or a workspace_path containing script files, the output is:
client_scripts {
'client/*.lua'
'client/a.lua'
}{ 'a' 'b' } is a Lua syntax error. Other problems in the same function:
scan_script_filesreturns asharedlist, but onlyclientandserverare copied intoscripts, soshared/*.lua,sh_*.luaand a scannedconfig.luaare discarded.shared_scripts { 'config.lua' }is emitted for Lua even when noconfig.luaexists.- Caller-supplied scripts whose path contains neither "client" nor "server" go to
client_scripts, so shared code never runs on the server. detect_nui_presencereturns True forweb/dist,ui/ornui/, but the output always saysui_page 'html/index.html'andfiles { 'html/**' }.- Scanned
client/main.luais listed next to the'client/*.lua'glob that already covers it. - Quotes are not escaped:
name="o'brien"yieldsdescription 'o'brien'.AUTHOR_RE([^'"]+) readsauthor "O'Brien"asO.
Impact
The documented auto-detect mode (workspace_path) and the scripts parameter both return an fxmanifest.lua that FXServer cannot parse, so the resource fails to start. Even after fixing commas, typical layouts (a shared/ folder, a Vite NUI in web/dist) get manifests with missing shared code, a missing config.lua, and a blank NUI. The single-entry default output happens to be valid, which hides the bug.
Steps to reproduce
cd mcp-serverpython -c "from tools.manifest_gen import generate_manifest as g; print(g('r','gta5','lua','standalone',scripts=['client/a.lua']))"- Observe two entries on consecutive lines with no comma.
- Create a workspace with
shared/utils.lua,client/main.luaandweb/dist/index.html, then callg('x','gta5','lua','standalone', workspace_path=<dir>): noshared/utils.lua, an unconditionalconfig.lua, andui_page 'html/index.html'.
Suggested fix
- Join entries with
",\n"(or put a trailing comma on every entry, which Lua allows). - Emit
shared_scriptsfrom the scannedsharedlist; includeconfig.luaonly if it exists; route unclassified files to shared, not client. - When scanning, use either the scanned list or the globs, not both.
- Return the detected NUI root from
detect_nui_presence(for exampleweb/dist/index.html) and deriveui_pageandfilesfrom it. - Escape
\and'in all interpolated values (shared helper with the scaffolder), and makeAUTHOR_RE/DESC_REmatch the opening quote.
Acceptance criteria
- Every generated list block separates entries with commas; output with multiple scripts parses with
luac -p(or a Lua parser). - Default lua/gta5/standalone output matches a pinned golden string.
-
scripts=["shared/config.lua"]and scanned shared files land inshared_scripts. - A workspace with only
web/dist/index.htmlproducesui_page 'web/dist/index.html'; withhtml/index.htmlit produceshtml/index.html. - Name, author, description and dependency strings containing
'or\are escaped or rejected. -
dependencies=["ox_lib"]with frameworkesxgiveses_extendedthenox_lib, with no duplicate whenes_extendedis also passed. - Tests for
scan_script_files:cl_x.luato client,sv_x.luato server,sh_x.luato shared,README.mdignored, nonexistent dir returns empty lists.
Getting started
- Relevant files:
mcp-server/tools/manifest_gen.py,mcp-server/tools/manifest_common.py - How to run checks: there is no test suite yet; run the MCP server with
cd mcp-server && pip install -r requirements.txt && python server.py, and CI checks live in.github/workflows/validate.yml - Related docs:
skills/fxmanifest/SKILL.md,rules/fxmanifest-standards.mdc
Filed by repo-audit/full-audit at 701824d. Severity: high. Effort: S. audit-key: bug|mcp-server/tools/manifest_gen.py|generate_manifest
Activity
TMHSDigital commentedon Nov 21, 2026
Fixed in 8e550e1.
Rendered all list blocks with comma-separated, escaped entries; routed scanned and unclassified scripts to shared_scripts; used either the scanned list or default globs; derived ui_page/files from the detected NUI page; deduped dependencies; read quoted author/description values whole.
Verified: Exercised default output (unchanged golden), multi-script caller input, a workspace with shared/, sh_x.lua, README.md and web/dist (ui_page 'web/dist/index.html'), an html/ workspace, an
O'Brienauthor andox_lib+es_extendeddependencies. No Lua parser is available locally, so comma placement was verified by inspection of the output.