agentleFS
ChiR24ChiR24/Unreal_mcp/.github/copilot-instructions.md

Unreal_mcp

Copilot instructions903 starsChanged 6 months agoMITView on GitHub

  • Reads credentials

The file

We split this copilot-instructions.md into the rules it gives an agent

11 rules. About 0 are common, 0 are distinctive, and 11 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 11

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Keep workspace-wide guidance here and rely on the closer AGENTS.md files for area-specific detail under src/tools/, src/server/gateway/, …

    line 6
  2. Very specific:

    Keep stdout JSON-only. Runtime logs must go through the project logger.

    line 9
  3. Very specific:

    Do not use UPackage::SavePackage() in plugin code.

    line 15
  4. Very specific:

    Do not introduce new ANY_PACKAGE usage.

    line 17
  5. Very specific:

    Every gateway response is validated against the unreal output schema, and each execute result against its record's declared output schema.

    line 35
  6. Very specific:

    Add an integration case under tests/mcp-tools/ covering every optional param (npm run test:params is strict).

    line 42
  7. Very specific:

    Keep TypeScript strict. Avoid as any in runtime code.

    line 43
  8. Very specific:

    Do not hand-bump versions: the bump-version.yml workflow rewrites all four version files (package.json, package-lock.json, server.json, the …

    line 44
  9. Very specific:

    Use src/tools/handlers/foundation/dispatch/automation-request-dispatch.ts for the one bridge send path (executeAutomationRequest()).

    line 47
  10. Very specific:

    Use tests/AGENTS.md for integration test conventions, expected result strings, and timeout tiers.

    line 48
  11. Very specific:

    Use plugins/McpAutomationBridge/AGENTS.md for plugin-side patterns and Unreal-specific caveats.

    line 49

≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
copilot-instructions.md

Copilot instructions for Unreal MCP

Architecture

  • This is a dual-process system: the TypeScript MCP server lives in src/, and the Unreal Editor bridge plugin lives in plugins/McpAutomationBridge/.
  • Typical flow is the single unreal gateway tool -> capability lookup + strict schema validation -> executeAutomationRequest() -> WebSocket bridge -> C++ subsystem queue -> game-thread handler. There is no TypeScript per-action layer; only manage_tools runs in process.
  • Keep workspace-wide guidance here and rely on the closer AGENTS.md files for area-specific detail under src/tools/, src/server/gateway/, src/automation/, tests/, and plugins/McpAutomationBridge/.

Critical constraints

  • Keep stdout JSON-only. Runtime logs must go through the project logger; do not use console.log in runtime code. See routeStdoutLogsToStderr() in src/server/server-factory.ts.
  • .env loading is intentionally quiet to avoid corrupting MCP I/O. Keep it that way in src/config.ts.
  • Send Unreal work through executeAutomationRequest(), not raw WebSocket calls.
  • Preserve path normalization. Prefer /Game/... asset paths and do not add new code that depends on /Content/... input staying unnormalized.

UE 5.7 safety

  • Do not use UPackage::SavePackage() in plugin code. Use the safe wrappers under plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/Safety/.
  • For Blueprint component templates, let SCS own nodes and templates through CreateNode() and AddNode() patterns.
  • Do not introduce new ANY_PACKAGE usage; use modern lookup patterns such as nullptr where required by newer UE versions.

Build and test

  • npm run dev: run the server from TypeScript.
  • npm run build:core: compile the TypeScript server.
  • npm run automation:sync: sync the Unreal plugin into a target project.
  • npm run test:unit: run Vitest unit tests without Unreal.
  • npm run test:smoke: run the offline smoke path using mock connection mode.
  • npm test: run the MCP integration suite. This requires Unreal Editor with the bridge plugin available.

Connection and runtime behavior

  • The Unreal plugin listens on loopback by default and commonly uses ports 8090 and 8091.
  • The TypeScript bridge connects as a WebSocket client to one host and port (MCP_AUTOMATION_HOST, MCP_AUTOMATION_PORT, or the project config found through UE_PROJECT_PATH).
  • Mock mode is an explicit development path: set MOCK_UNREAL_CONNECTION=true when you need the bridge layer to succeed without a live editor.
  • Connection setup includes handshake and capability negotiation in src/automation/; keep protocol changes aligned across TypeScript and plugin code.

Tooling conventions

  • Tool contracts are the capability records under src/tools/catalog/capabilities/records/; every *.generated.* file derives from them. Never hand-edit generated files.
  • Every gateway response is validated against the unreal output schema, and each execute result against its record's declared output schema.
  • Console commands are safety-filtered in src/utils/commands/command-validator.ts; do not add bypasses.

Making changes

  • New MCP action flow:
    1. Author a capability record under src/tools/catalog/capabilities/records/<parent>/ declaring exactly the params the handler reads, then run npm run registry:generate.
    2. Implement the Unreal side under plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/Domains/<Domain>/ and make sure its parent tool reaches it in Core/Subsystem/...HandlerRegistration.cpp.
    3. Add an integration case under tests/mcp-tools/ covering every optional param (npm run test:params is strict).
  • Keep TypeScript strict. Avoid as any in runtime code.
  • Do not hand-bump versions: the bump-version.yml workflow rewrites all four version files (package.json, package-lock.json, server.json, the .uplugin).

Reference points

  • Use src/tools/handlers/foundation/dispatch/automation-request-dispatch.ts for the one bridge send path (executeAutomationRequest()).
  • Use tests/AGENTS.md for integration test conventions, expected result strings, and timeout tiers.
  • Use plugins/McpAutomationBridge/AGENTS.md for plugin-side patterns and Unreal-specific caveats.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.