Skip to content
Mobile
Skill

/ue-mcp-native-cpp

Use when writing or modifying native C++ UCLASSes in an Unreal project via ue-mcp. Covers create_cpp_class → write_cpp_file → live_coding_compile loop, when to use build vs Live Coding, and the add_module_dependency workflow. Pulls in any time the user asks to write a new native

From plugin
ue-mcp
5146 skills

Claude Code

$ npx -y skills add db-lyon/ue-mcp --skill ue-mcp-native-cpp --agent claude-code

SKILL.md

ue-mcp-native-cpp.SKILL.md
name: ue-mcp-native-cpp
description: Use when writing or modifying native C++ UCLASSes in an Unreal project via ue-mcp. Covers create_cpp_class → write_cpp_file → live_coding_compile loop, when to use build vs Live Coding, and the add_module_dependency workflow. Pulls in any time the user asks to write a new native class, add a UPROPERTY, or implement a UFUNCTION.

ue-mcp native C++ authoring

The `project` tool wraps `GameProjectUtils::AddCodeToProject` and `ILiveCodingModule` so agents can author native C++ end-to-end without Python or the editor UI.

The authoring loop

1. **Pick a module.** `project(action="list_project_modules")` enumerates the project's native modules (name, host type, source path). Feed the module name into `create_cpp_class`. 2. **Create the class.** `project(action="create_cpp_class", className, parentClass?, moduleName?, classDomain?, subPath?)` writes `.h` and `.cpp` using the same engine template that `File → New C++ Class` uses. The class-name prefix (`A`, `U`, `F`) is derived from `parentClass` - pass the bare name (`"BotSpawner"`, not `"ABotSpawner"`). 3. **Inspect the generated files.** `project(action="read_cpp_header", headerPath=...)` and `project(action="read_cpp_source", sourcePath=...)`. Both paths are relative to `Source/` or absolute within it. 4. **Append declarations and bodies.** `project(action="write_cpp_file", path=..., content=...)` writes the full file contents (scoped to the `Source/` tree for safety). Read first, then write the amended content. 5. **Compile.**

  • **New UCLASS** → `project(action="build")`. Live Coding doesn't reliably register brand-new UCLASSes; you need a full build and an editor restart. `create_cpp_class` surfaces this via `needsEditorRestart` in its response.
  • **Existing UCLASS** (editing method bodies, adding UPROPERTYs, etc.) → `project(action="live_coding_compile", wait=true)`. Hot-patches method bodies without restart - the fast inner loop. Check `live_coding_status` first to confirm Live Coding is available and not already compiling.

Adding module dependencies

When you need a new module in a project's `Build.cs`:

  • `project(action="add_module_dependency", moduleName=<target Build.cs>, dependency=<module to add>, access="public"|"private")`
  • Deduplicates automatically. Creates the `AddRange` block if missing.
  • Rebuild afterwards (`project(action="build")`).

Reading the engine source

When you need to know *how* UE does something, reach for engine source lookup:

  • `project(action="read_engine_header", headerPath=...)` - parse a `.h` from `Engine/Source` (relative to `Engine/Source` or absolute).
  • `project(action="find_engine_symbol", symbol=..., maxResults?)` - grep engine runtime headers for a symbol.
  • `project(action="search_engine_cpp", query, tree?, subdirectory?, maxResults?)` - broader grep across `.h` / `.cpp` / `.inl` in `Runtime` / `Editor` / `Developer` / `Plugins` (or `all`).
  • `project(action="list_engine_modules")` - enumerate modules in `Engine/Source/Runtime`.

Pitfalls

  • **UCLASSes need UnrealBuildTool + MSVC/Clang** on the host. Same requirement as the editor's own Build menu.
  • **`write_cpp_file` refuses writes outside `Source/`** and rejects extensions other than `.h` / `.cpp` / `.inl` / `.cs`.
  • **Live Coding ≠ full build.** If behavior doesn't reflect your code changes, check whether you added a new UCLASS, UFUNCTION reflection macro, or UPROPERTY annotation - those usually need a full build.
  • **Don't edit Intermediate/ or Binaries/.** These are regenerated.

Testing the new class

Once a class is compiled and registered, you can typically:

  • `asset(action="read_properties", assetPath=...)` or `reflection(action="reflect_class", className=...)` to verify UE sees the UCLASS.
  • `blueprint(action="create", parentClass="/Script/<Module>.<Class>")` to subclass it from a Blueprint.
  • `level(action="place_actor", actorClass=...)` to drop an instance into the level.
Read more
@db-lyon
Ships withue-mcp

Let an AI agent work inside your Unreal Editor. Ask in plain English, and it builds levels, Blueprints, materials, VFX, landscapes and more in your open project. UE-MCP is a free, open-source Model Context Protocol server for Unreal Engine 5.

Stars on GitHub

Momentum

stars in total
514
Star history of db-lyon/ue-mcp on GitHub, a chart by star-history.com

Other skills on ue-mcp.

ue-mcp-animation

ue-mcp-animation

Use when creating, modifying, retargeting, rigging, constraining, or validating skeletal animation through UE-MCP. Covers native…

@db-lyon@db-lyonInstall Skill
ue-mcp-blueprint

ue-mcp-blueprint

Use when authoring or modifying Unreal Blueprint assets through ue-mcp. Covers the read-then-write discipline, node/pin wiring,…

@db-lyon@db-lyonInstall Skill
ue-mcp-epic-routing

ue-mcp-epic-routing

Use when deciding between ue-mcp's native category actions and Epic's wrapped ToolsetRegistry tools (the `epic_*` actions, incl.…

@db-lyon@db-lyonInstall Skill
ue-mcp-niagara

ue-mcp-niagara

Use when authoring Niagara VFX systems via ue-mcp - creating systems and emitters, adding renderers, setting module inputs and…

@db-lyon@db-lyonInstall Skill
ue-mcp-workflow

ue-mcp-workflow

Use when driving Unreal Engine editor via the ue-mcp MCP server. Covers the required order of operations (status check first),…

@db-lyon@db-lyonInstall Skill

More skills from other plugins.

deep-code-review

deep-code-review

In-depth design-focused code review - understands codebase context before evaluating PR changes, posts structured feedback to…

expo2w53k
@expo@expoInstall Skill
modlens

modlens

Plug-in vision for text-only models. Hard rule: when a file path or URL with an image extension (.png, .jpg, .jpeg, .webp, .gif,…

modlens4w4.6k
@liustack@liustackInstall Skill
appllama-app-design-skill

appllama-app-design-sk…

Build native-feeling, benchmark-quality mobile app screens (Expo / React Native). Use when designing or implementing any mobile…

appllama2mo3.9k
@appllama@appllamaInstall Skill

Questions about ue-mcp-native-cpp.

Which coding agents can use ue-mcp-native-cpp?
ue-mcp-native-cpp installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.