Fix search_source: pass env vars via mcp.json interpolation, search Plugins/, cap at 40 total lines

- .mcp.json: pass UE_ENGINE_ROOT and UE_DOCS_PATH via ${VAR} interpolation so the
  MCP server subprocess inherits them without hardcoding paths
- search_source: search both Engine/Source/ and Engine/Plugins/ (path_hint applied
  under both); switch from -m 40 (per-file cap) to streaming Popen with a true
  40-line total cap; fix UE_ENGINE_ROOT to point at Engine/ not the repo root
- Update README and CLAUDE.md to reflect the above

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-01 18:11:46 -05:00
parent a51102c1eb
commit 77c972977a
4 changed files with 30 additions and 13 deletions

View File

@@ -38,9 +38,11 @@ The last argument is always the output directory. All preceding arguments are in
| `get_class_overview(class_name)` | Compact view: description + inherits + property/function name lists |
| `get_member(class_name, member_name)` | Full doc for one function or property (all overloads) |
| `get_file(relative_path)` | Full `.md` file — use when you need delegates, enums, or multiple classes |
| `search_source(pattern, path_hint)` | Grep UE source `.h` files via `$UE_ENGINE_ROOT` |
| `search_source(pattern, path_hint)` | Grep UE `.h` files in `Engine/Source/` and `Engine/Plugins/`; `path_hint` applied under both; returns up to 40 lines total |
Requires `pip install mcp`. Reads `$UE_DOCS_PATH`; `search_source` also requires `$UE_ENGINE_ROOT`.
Requires `pip install mcp`. Reads `$UE_DOCS_PATH`; `search_source` also requires `$UE_ENGINE_ROOT` (must point to the `Engine/` directory, e.g. `/path/to/UnrealEngine/Engine`).
`.mcp.json` passes both vars via `${VAR}` interpolation — no paths hardcoded.
Typical query flow: `search_types``get_class_overview``get_member` (~3 calls, ~15 lines vs ~100 lines for a full file read).