Unreal_mcp
Copilot instructions903 starsChanged 6 months agoMITView on GitHub
- Reads credentials
In this repository2 other files it gives its agents.
- AGENTS.mdAGENTS.md
- tests/AGENTS.mdAGENTS.md
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
- Very specific: line 6
Keep workspace-wide guidance here and rely on the closer AGENTS.md files for area-specific detail under src/tools/, src/server/gateway/, …
- Very specific: line 9
Keep stdout JSON-only. Runtime logs must go through the project logger.
- Very specific: line 15
Do not use UPackage::SavePackage() in plugin code.
- Very specific: line 17
Do not introduce new ANY_PACKAGE usage.
- Very specific: line 35
Every gateway response is validated against the unreal output schema, and each execute result against its record's declared output schema.
- Very specific: line 42
Add an integration case under tests/mcp-tools/ covering every optional param (npm run test:params is strict).
- Very specific: line 43
Keep TypeScript strict. Avoid as any in runtime code.
- Very specific: line 44
Do not hand-bump versions: the bump-version.yml workflow rewrites all four version files (package.json, package-lock.json, server.json, the …
- Very specific: line 47
Use src/tools/handlers/foundation/dispatch/automation-request-dispatch.ts for the one bridge send path (executeAutomationRequest()).
- Very specific: line 48
Use tests/AGENTS.md for integration test conventions, expected result strings, and timeout tiers.
- Very specific: line 49
Use plugins/McpAutomationBridge/AGENTS.md for plugin-side patterns and Unreal-specific caveats.
≈ “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.
Files
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 inplugins/McpAutomationBridge/. - Typical flow is the single
unrealgateway tool -> capability lookup + strict schema validation ->executeAutomationRequest()-> WebSocket bridge -> C++ subsystem queue -> game-thread handler. There is no TypeScript per-action layer; onlymanage_toolsruns in process. - Keep workspace-wide guidance here and rely on the closer
AGENTS.mdfiles for area-specific detail undersrc/tools/,src/server/gateway/,src/automation/,tests/, andplugins/McpAutomationBridge/.
Critical constraints
- Keep stdout JSON-only. Runtime logs must go through the project logger; do not use
console.login runtime code. SeerouteStdoutLogsToStderr()insrc/server/server-factory.ts. .envloading is intentionally quiet to avoid corrupting MCP I/O. Keep it that way insrc/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 underplugins/McpAutomationBridge/Source/McpAutomationBridge/Private/Safety/. - For Blueprint component templates, let SCS own nodes and templates through
CreateNode()andAddNode()patterns. - Do not introduce new
ANY_PACKAGEusage; use modern lookup patterns such asnullptrwhere 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
8090and8091. - The TypeScript bridge connects as a WebSocket client to one host and port (
MCP_AUTOMATION_HOST,MCP_AUTOMATION_PORT, or the project config found throughUE_PROJECT_PATH). - Mock mode is an explicit development path: set
MOCK_UNREAL_CONNECTION=truewhen 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
unrealoutput 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:
- Author a capability record under
src/tools/catalog/capabilities/records/<parent>/declaring exactly the params the handler reads, then runnpm run registry:generate. - Implement the Unreal side under
plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/Domains/<Domain>/and make sure its parent tool reaches it inCore/Subsystem/...HandlerRegistration.cpp. - Add an integration case under
tests/mcp-tools/covering every optional param (npm run test:paramsis strict).
- Author a capability record under
- Keep TypeScript strict. Avoid
as anyin runtime code. - Do not hand-bump versions: the
bump-version.ymlworkflow 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.tsfor the one bridge send path (executeAutomationRequest()). - Use
tests/AGENTS.mdfor integration test conventions, expected result strings, and timeout tiers. - Use
plugins/McpAutomationBridge/AGENTS.mdfor plugin-side patterns and Unreal-specific caveats.
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
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.

