协作头脑风暴
brainstorming
在实现前澄清需求、探索设计选择,并形成清晰的开发方向。
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.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
The project tool wraps GameProjectUtils::AddCodeToProject and ILiveCodingModule so agents can author native C++ end-to-end without Python or the editor UI.
project(action="list_project_modules") enumerates the project's native modules (name, host type, source path). Feed the module name into create_cpp_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").project(action="read_cpp_header", headerPath=...) and project(action="read_cpp_source", sourcePath=...). Both paths are relative to Source/ or absolute within it.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.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.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.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")AddRange block if missing.project(action="build")).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.write_cpp_file refuses writes outside Source/ and rejects extensions other than .h / .cpp / .inl / .cs.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", className=...) to drop an instance into the level.