diff --git a/.mcp.json b/.mcp.json index 89193fc..5de5d84 100644 --- a/.mcp.json +++ b/.mcp.json @@ -2,7 +2,7 @@ "mcpServers": { "ue-docs": { "command": "python", - "args": ["ue_mcp_server.py"] + "args": ["docgen/ue_mcp_server.py"] } } } diff --git a/CLAUDE.md b/CLAUDE.md index a14c174..8531725 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -8,20 +8,20 @@ UnrealDocGenerator is a tool for generating documentation from Unreal Engine C++ ## Current State -Implementation complete. Four Python files + MCP registration: -- `ue_parser.py` — Parses UE headers into dataclasses -- `ue_markdown.py` — Renders parsed data as Markdown (ultra-compact format, documented items only) -- `generate.py` — CLI entry point; two-pass pipeline (parse-all → build type index → render-all) -- `ue_mcp_server.py` — MCP server exposing 5 tools for item-granularity doc lookups +Implementation complete. Scripts live in `docgen/`: +- `docgen/ue_parser.py` — Parses UE headers into dataclasses +- `docgen/ue_markdown.py` — Renders parsed data as Markdown (ultra-compact format, documented items only) +- `docgen/generate.py` — CLI entry point; two-pass pipeline (parse-all → build type index → render-all) +- `docgen/ue_mcp_server.py` — MCP server exposing 5 tools for item-granularity doc lookups - `.mcp.json` — Registers the MCP server with Claude Code (stdio transport) ## Usage ```bash -python generate.py [input2 ...] +python docgen/generate.py [input2 ...] -python generate.py Runtime/Engine/ Runtime/AIModule/ docs/ # multiple directories -python generate.py Runtime/Engine/Classes/GameFramework/Actor.h docs/ # single file +python docgen/generate.py Runtime/Engine/ Runtime/AIModule/ docs/ # multiple directories +python docgen/generate.py Runtime/Engine/Classes/GameFramework/Actor.h docs/ # single file ``` Output: one `.md` per `.h` + `docs/type-index.txt` (compact `TypeName: path/to/File.md` lookup). @@ -30,7 +30,7 @@ The last argument is always the output directory. All preceding arguments are in ## MCP Server -`ue_mcp_server.py` exposes 5 tools Claude can call directly: +`docgen/ue_mcp_server.py` exposes 5 tools Claude can call directly: | Tool | Purpose | |---|---| diff --git a/README.md b/README.md index 59fda39..c8e04f5 100644 --- a/README.md +++ b/README.md @@ -4,27 +4,27 @@ Generates compact, agent-readable Markdown documentation from Unreal Engine C++ ## How it works -1. **Parse** — `ue_parser.py` scans UE headers into dataclasses using a position-based scanner (handles nested braces, macros, delegates, namespaces). -2. **Render** — `ue_markdown.py` emits one `.md` per header: only items with C++ doc comments, no deprecated functions, compact enum format. -3. **Index** — `generate.py` produces `type-index.txt`: a flat `TypeName: path/to/File.md` lookup for instant type resolution. -4. **Serve** — `ue_mcp_server.py` exposes the docs to Claude as callable MCP tools. +1. **Parse** — `docgen/ue_parser.py` scans UE headers into dataclasses using a position-based scanner (handles nested braces, macros, delegates, namespaces). +2. **Render** — `docgen/ue_markdown.py` emits one `.md` per header: only items with C++ doc comments, no deprecated functions, compact enum format. +3. **Index** — `docgen/generate.py` produces `type-index.txt`: a flat `TypeName: path/to/File.md` lookup for instant type resolution. +4. **Serve** — `docgen/ue_mcp_server.py` exposes the docs to Claude as callable MCP tools. ## Usage ```bash -python generate.py [input2 ...] +python docgen/generate.py [input2 ...] # Examples -python generate.py /path/to/UnrealEngine/Engine/Source/ docs/ -python generate.py Runtime/Engine/ Runtime/AIModule/ Runtime/GameplayTags/ docs/ -python generate.py Runtime/Engine/Classes/GameFramework/Actor.h docs/ +python docgen/generate.py /path/to/UnrealEngine/Engine/Source/ docs/ +python docgen/generate.py Runtime/Engine/ Runtime/AIModule/ Runtime/GameplayTags/ docs/ +python docgen/generate.py Runtime/Engine/Classes/GameFramework/Actor.h docs/ ``` The last argument is always the output directory. All preceding arguments are inputs (files or directories, processed recursively). Output: one `.md` per `.h` + `docs/type-index.txt`. ## MCP Server -`ue_mcp_server.py` is a Claude Code MCP server that gives Claude item-granularity access to the generated docs — fetching one class overview or one function instead of an entire file. +`docgen/ue_mcp_server.py` is a Claude Code MCP server that gives Claude item-granularity access to the generated docs — fetching one class overview or one function instead of an entire file. ### Setup diff --git a/generate.py b/docgen/generate.py similarity index 100% rename from generate.py rename to docgen/generate.py diff --git a/ue_markdown.py b/docgen/ue_markdown.py similarity index 100% rename from ue_markdown.py rename to docgen/ue_markdown.py diff --git a/ue_mcp_server.py b/docgen/ue_mcp_server.py similarity index 100% rename from ue_mcp_server.py rename to docgen/ue_mcp_server.py diff --git a/ue_parser.py b/docgen/ue_parser.py similarity index 100% rename from ue_parser.py rename to docgen/ue_parser.py diff --git a/possess_flow.png b/possess_flow.png deleted file mode 100644 index 8af0f2e..0000000 Binary files a/possess_flow.png and /dev/null differ