Skip to content

CI never imports the MCP server or syntax-checks snippets and examples #39

Closed

Description

@TMHSDigital

Summary

CI checks the MCP server only with py_compile on a hand-maintained file list. Nothing imports server.py, calls a tool, or syntax-checks the Lua, JS and C# snippets, templates and examples, so broken imports, runtime errors, and unparseable snippets all pass.

Where

  • .github/workflows/validate.yml:234-260 (validate-python)
  • .github/workflows/validate.yml:201-232 (validate-templates, walks only templates/)
  • .github/workflows/validate.yml:219-224 (substring checks for fx_version, games, 'cerulean')
  • mcp-server/requirements.txt:1

Details

  • py_compile catches syntax errors only. A wrong import (for example from tools.nope import x in server.py), a renamed function, or a runtime error in any tool body passes. A new tool module is unchecked until someone adds it to the list.
  • Importing server and calling asyncio.run(server.mcp.list_tools()) returns all 10 tools locally; this cheap smoke test is not in CI.
  • Only Python 3.12 on ubuntu is exercised, while the plugin targets Windows users too.
  • node --check snippets/javascript/state-bag-entity.js fails (Identifier 'vehicle' has already been declared); CI has no JS, Lua or C# syntax step. The 67 tracked Lua files have no parse check.
  • validate-templates never looks at examples/*/fxmanifest.lua, and its checks are substring tests that a comment would satisfy.
  • CI always installs the newest mcp, so the declared lower bound is never exercised (see "Raise the mcp version floor and drop unused fastapi/uvicorn").

Impact

Regressions in the 10 MCP tools and in shipped snippets and templates reach tagged releases with green CI. The project convention "Snippets: must compile or load cleanly inside a CFX resource" is not enforced.

Steps to reproduce

  1. Add return undefined_name to any tool function body, or an import of a nonexistent module in server.py.
  2. Run the validate-python steps: they pass.
  3. Run node --check snippets/javascript/state-bag-entity.js: it fails, but no CI job runs it.

Suggested fix

  • Replace the per-file list with python -m compileall -q mcp-server, and add a smoke step: cd mcp-server && python -c "import asyncio, server; tools = asyncio.run(server.mcp.list_tools()); assert len(tools) == 10".
  • Smoke-call the data tools: search_events("") starts with Event reference database, search_docs("") with Documentation index, search_docs("x", section="bogus") returns the invalid-section error.
  • Run the pytest suite (see "Add a pytest suite for the MCP server tools") in this job, and add a windows-latest leg.
  • Add node --check for every *.js under snippets/, templates/ and examples/ (excluding bundler-only web/ sources).
  • Install lua5.4 and run luac -p on every tracked *.lua (optionally luacheck with a CFX globals file).
  • Extend the manifest check to examples/ and use line-anchored regexes (^fx_version 'cerulean', ^games \{).
  • Validate templates/*/package.json with json.load. Optionally dotnet build templates/csharp on a schedule.

Acceptance criteria

  • A broken import or a missing tool registration fails CI.
  • A JS or Lua syntax error in any snippet, template or example fails CI.
  • examples/*/fxmanifest.lua are checked by the manifest step.
  • New tool modules are covered without editing a file list.

Getting started

  • Relevant files: .github/workflows/validate.yml, mcp-server/server.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: CLAUDE.md (Running validation, Key Conventions)

Filed by repo-audit/full-audit at 701824d. Severity: medium. Effort: M. audit-key: ci|.github/workflows/validate.yml|validate-python

Activity

  1. added
    help wanted
    ci
    on Nov 21, 2026
  2. TMHSDigital commented on Nov 21, 2026

    @TMHSDigital
    OwnerAuthor

    Fixed in 4c615a6.

    CI now compiles every module with compileall, imports the server and asserts the 10 tools register, smoke-calls the data tools, runs on ubuntu and windows, runs node --check on all JS in snippets/templates/examples, runs luac -p on every .lua file (backtick hashes replaced first), checks examples/ manifests with line-anchored regexes, and json-loads template package.json files.

    Verified: Validate run 44862913275 on main passed with all of these steps. On its first run the new luac step found that every example manifest used lua54 true, which is invalid Lua (fixed under #44).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    cihelp wantedseverity: medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions