Skip to content
Skills Library
Programming · Building & coding

ue-mcp-native-cpp

/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 class, add a UPROPERTY, or implement a UFUNCTION.

Repository
ue-mcp ↗
Licence
MIT
Last repository change
26.10.2026

Assessment and security

90/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content25 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 26.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

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.

Original author 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.

How it works

  1. The authoring loop
  2. Adding module dependencies
  3. Reading the engine source
  4. Pitfalls
  5. Testing the new class
Original SKILL.md headings · 47 lines, 444 words
SKILL.md preview
---
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.

Versions

The database has no other skills named ue-mcp-native-cpp.

Database snapshot: 13.11.2026 · package version 8a00762903b6 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100unreal-cpp-gameplay
    Write Unreal Engine 5 C++ gameplay code: the UCLASS/UPROPERTY/UFUNCTION reflection macros, the Gameplay Framework (GameMode, Pawn, Character, PlayerController, Actor components), and the module Build.cs. Use when writing or debugging UE C++, deriving from AActor/ACharacter/…
  • 100unreal-cpp-gameplay
    Writes correct Unreal Engine 5 gameplay C++ that compiles the first time and doesn't crash - naming prefixes, UCLASS/UPROPERTY/UFUNCTION specifiers, TObjectPtr and garbage collection, CreateDefaultSubobject vs NewObject vs SpawnActor, Enhanced Input setup, Build.cs dependencies,…
  • 100ue5-cpp-gameplay
    UE5.6-UE5.8 gameplay C++ implementation for Actors, Components, DataAssets, and gameplay logic. Use when requests ask to write .h/.cpp pairs, expose UPROPERTY/UFUNCTION to Blueprint, use GameplayTags, or build reusable component-based systems.
  • 100ue-cpp-foundations
    Use when writing Unreal Engine C++ that touches the reflection system or core types: UCLASS, UPROPERTY, UFUNCTION, USTRUCT, UENUM, GENERATED_BODY, TObjectPtr, TWeakObjectPtr, TSharedPtr, FGCObject, TArray, TMap, TSet, TOptional, TVariant, DECLARE_DYNAMIC_MULTICAST_DELEGATE,…
  • 98ue5-gamedev
    Unreal Engine 5 game development: C++ coding, Blueprint creation, editor automation, and build management. Use when tasks involve writing UE5 C++ gameplay code, creating or modifying Blueprints, executing editor commands, triggering builds, or working with the UE5 project via…
  • 100ue-code-authoring
    Use when writing or modifying Unreal Engine C++ — classes, actors, components, subsystems, interfaces, ability-system (GAS) code, module dependencies, reflected UPROPERTY/UFUNCTION API, native gameplay tags, and testable gameplay behavior — in a project open in JetBrains Rider.…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.