# github-zero123/mcdevtool architecture

> Architecture diagram of the GitHub repository github-zero123/mcdevtool, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/github-zero123/mcdevtool
- Repository: https://github.com/github-zero123/mcdevtool

## Overview

MCDevTool is a Windows development toolkit for offline testing of 网易我的世界 Mods and maps. The main workflow is to run mcdk from a project, configure and prepare a test world with selected packs, launch the game, then refresh code or assets while developing. Separate capabilities provide MCP-based automation and runtime inspection, window controls, and profiling. The README documents the major product flows; sampled source is limited, so some links reflect documented behavior rather than inspected call sites.

Main entry points: [`tools/mcdk/src/mcp_tool_definitions.cpp`](https://github.com/github-zero123/mcdevtool/blob/main/tools/mcdk/src/mcp_tool_definitions.cpp) (MCP tool definitions), [`tools/mcdk/src/application.cpp`](https://github.com/github-zero123/mcdevtool/blob/main/tools/mcdk/src/application.cpp) (Application flow), [`tools/mcdk/src/game_environment.cpp`](https://github.com/github-zero123/mcdevtool/blob/main/tools/mcdk/src/game_environment.cpp) (Game environment), [`tools/mcdk/src/mcp_server.cpp`](https://github.com/github-zero123/mcdevtool/blob/main/tools/mcdk/src/mcp_server.cpp) (MCP client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI orchestration"]
  node_mcdk["mcdk command<br/>[main.cpp]"]
  node_application["Application flow<br/>[application.cpp]"]
  node_configuration["Configuration<br/>[config.cpp]"]
  node_game_environment["Game environment"]
end

subgraph group_world["World preparation"]
  node_world_project["World project<br/>[world_project.cpp]"]
  node_level["World setup<br/>[level.cpp]"]
  node_addon["Pack mounting<br/>[addon.cpp]"]
end

subgraph group_dev["Live development"]
  node_hotreload["Mod hot reload<br/>[hotreload.cpp]"]
  node_asset_reload["Asset reload"]
  node_debug_mod["Debug MOD<br/>[modMain.py]"]
  node_loader_client["Client loader<br/>[Client.py]"]
  node_loader_server["Server loader<br/>[Server.py]"]
  node_shared_resources["Shared loader support<br/>[SharedRes.py]"]
end

subgraph group_inspect["Automation and inspection"]
  node_mcp_client["MCP client<br/>[mcp_server.cpp]"]
  node_mcp_tooling["MCP tool definitions"]
  node_logs["Log access<br/>[log_buffer.cpp]"]
  node_code_execution["Code execution"]
  node_jsonui["JSON UI debugger"]
  node_window_capture["Window capture<br/>[window_capture.cpp]"]
  node_window_input["Window input<br/>[window_input.cpp]"]
  node_profiler["Profiler service"]
  node_profiler_types["Profiler types<br/>[profiler_types.hpp]"]
end

subgraph group_runtime["Runtime components"]
  node_mcp_protocol["MCP protocol<br/>[mcp_message.h]"]
  node_mcp_client_api["MCP client API<br/>[mcp_client.h]"]
  node_mcp_transports["MCP transports"]
  node_http_transport["HTTP transport<br/>[httplib.h]"]
  node_base64["Base64 support<br/>[base64.hpp]"]
  node_nbt["NBT data<br/>[NBT.h]"]
  node_window_input_api["Input API<br/>[window_input.h]"]
  node_loader_util["Loader utilities<br/>[IN.py]"]
end

node_developer(("Mod developer"))
node_game["Minecraft game"]

node_developer -->|"runs"| node_mcdk
node_mcdk -.->|"starts"| node_application
node_application -.->|"loads settings"| node_configuration
node_application -.->|"prepares runtime"| node_game_environment
node_game_environment -->|"detects project"| node_world_project
node_world_project -->|"deploys map"| node_level
node_world_project -->|"mounts packs"| node_addon
node_application -->|"launches"| node_game
node_addon -->|"loads packs"| node_game
node_game_environment -->|"enables refresh"| node_hotreload
node_hotreload -->|"refreshes mods"| node_game
node_asset_reload -->|"reloads assets"| node_game
node_debug_mod -->|"runs in"| node_game
node_loader_client -->|"uses"| node_shared_resources
node_loader_server -->|"uses"| node_shared_resources
node_game_environment -->|"starts optionally"| node_mcp_client
node_developer -->|"connects MCP client"| node_mcp_client
node_mcp_client -.->|"registers tools"| node_mcp_tooling
node_mcp_tooling -.->|"queries logs"| node_logs
node_mcp_tooling -.->|"executes code"| node_code_execution
node_mcp_tooling -.->|"analyzes UI"| node_jsonui
node_mcp_tooling -.->|"captures window"| node_window_capture
node_mcp_tooling -.->|"controls window"| node_window_input
node_mcp_tooling -.->|"profiles runtime"| node_profiler
node_profiler -->|"uses types"| node_profiler_types
node_mcp_client -.->|"uses protocol"| node_mcp_protocol
node_mcp_client_api -->|"uses messages"| node_mcp_protocol
node_mcp_transports -->|"uses HTTP"| node_http_transport
node_mcp_transports -->|"uses encoding"| node_base64
node_window_input -->|"implements API"| node_window_input_api
node_loader_client -->|"uses utilities"| node_loader_util
node_loader_server -->|"uses utilities"| node_loader_util

click node_mcdk "https://github.com/github-zero123/mcdevtool/blob/main/tools/mcdk/main.cpp"
click node_application "https://github.com/github-zero123/mcdevtool/blob/main/tools/mcdk/src/application.cpp"
click node_configuration "https://github.com/github-zero123/mcdevtool/blob/main/tools/mcdk/src/config.cpp"
click node_game_environment "https://github.com/github-zero123/mcdevtool/blob/main/tools/mcdk/src/game_environment.cpp"
click node_world_project "https://github.com/github-zero123/mcdevtool/blob/main/tools/mcdk/src/world_project.cpp"
click node_level "https://github.com/github-zero123/mcdevtool/blob/main/src/level.cpp"
click node_addon "https://github.com/github-zero123/mcdevtool/blob/main/src/addon.cpp"
click node_hotreload "https://github.com/github-zero123/mcdevtool/blob/main/tools/mcdk/src/hotreload.cpp"
click node_asset_reload "https://github.com/github-zero123/mcdevtool/blob/main/tools/mcdk/src/jsonui_reload_support.cpp"
click node_debug_mod "https://github.com/github-zero123/mcdevtool/blob/main/mods/INCLUDE_TEST_MOD/DEBUG_ENV_SCRIPT/modMain.py"
click node_loader_client "https://github.com/github-zero123/mcdevtool/blob/main/mods/INCLUDE_TEST_MOD/DEBUG_ENV_SCRIPT/QuModLibs/Systems/Loader/Client.py"
click node_loader_server "https://github.com/github-zero123/mcdevtool/blob/main/mods/INCLUDE_TEST_MOD/DEBUG_ENV_SCRIPT/QuModLibs/Systems/Loader/Server.py"
click node_shared_resources "https://github.com/github-zero123/mcdevtool/blob/main/mods/INCLUDE_TEST_MOD/DEBUG_ENV_SCRIPT/QuModLibs/Systems/Loader/SharedRes.py"
click node_mcp_client "https://github.com/github-zero123/mcdevtool/blob/main/tools/mcdk/src/mcp_server.cpp"
click node_mcp_tooling "https://github.com/github-zero123/mcdevtool/blob/main/tools/mcdk/src/mcp_tool_definitions.cpp"
click node_logs "https://github.com/github-zero123/mcdevtool/blob/main/tools/mcdk/src/log_buffer.cpp"
click node_code_execution "https://github.com/github-zero123/mcdevtool/blob/main/tools/mcdk/src/ipc_code_execution.cpp"
click node_jsonui "https://github.com/github-zero123/mcdevtool/blob/main/tools/mcdk/src/jsonui_debugger.cpp"
click node_window_capture "https://github.com/github-zero123/mcdevtool/blob/main/src/window_capture.cpp"
click node_window_input "https://github.com/github-zero123/mcdevtool/blob/main/src/window_input.cpp"
click node_profiler "https://github.com/github-zero123/mcdevtool/blob/main/tools/mcdk/src/performance/profiler_service.cpp"
click node_profiler_types "https://github.com/github-zero123/mcdevtool/blob/main/tools/mcdk/include/mcdk/performance/profiler_types.hpp"
click node_mcp_protocol "https://github.com/github-zero123/mcdevtool/blob/main/libs/cpp-mcp/include/mcp_message.h"
click node_mcp_client_api "https://github.com/github-zero123/mcdevtool/blob/main/libs/cpp-mcp/include/mcp_client.h"
click node_mcp_transports "https://github.com/github-zero123/mcdevtool/blob/main/libs/cpp-mcp/src/mcp_stdio_client.cpp"
click node_http_transport "https://github.com/github-zero123/mcdevtool/blob/main/libs/cpp-mcp/common/httplib.h"
click node_base64 "https://github.com/github-zero123/mcdevtool/blob/main/libs/cpp-mcp/common/base64.hpp"
click node_nbt "https://github.com/github-zero123/mcdevtool/blob/main/libs/nbt/include/nbt-c/NBT.h"
click node_window_input_api "https://github.com/github-zero123/mcdevtool/blob/main/include/mcdevtool/window_input.h"
click node_loader_util "https://github.com/github-zero123/mcdevtool/blob/main/mods/INCLUDE_TEST_MOD/DEBUG_ENV_SCRIPT/QuModLibs/IN.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_mcdk,node_application,node_configuration,node_game_environment toneBlue
class node_world_project,node_level,node_addon toneAmber
class node_hotreload,node_asset_reload,node_debug_mod,node_loader_client,node_loader_server,node_shared_resources toneMint
class node_mcp_client,node_mcp_tooling,node_logs,node_code_execution,node_jsonui,node_window_capture,node_window_input,node_profiler,node_profiler_types toneRose
class node_mcp_protocol,node_mcp_client_api,node_mcp_transports,node_http_transport,node_base64,node_nbt,node_window_input_api,node_loader_util,node_developer,node_game toneIndigo
```

## Components

### CLI orchestration

- [mcdk command](https://github.com/github-zero123/mcdevtool/blob/main/tools/mcdk/main.cpp): `tools/mcdk/main.cpp`
- [Application flow](https://github.com/github-zero123/mcdevtool/blob/main/tools/mcdk/src/application.cpp): `tools/mcdk/src/application.cpp`
- [Configuration](https://github.com/github-zero123/mcdevtool/blob/main/tools/mcdk/src/config.cpp): `tools/mcdk/src/config.cpp`
- [Game environment](https://github.com/github-zero123/mcdevtool/blob/main/tools/mcdk/src/game_environment.cpp): `tools/mcdk/src/game_environment.cpp`

### World preparation

- [World project](https://github.com/github-zero123/mcdevtool/blob/main/tools/mcdk/src/world_project.cpp): `tools/mcdk/src/world_project.cpp`
- [World setup](https://github.com/github-zero123/mcdevtool/blob/main/src/level.cpp): `src/level.cpp`
- [Pack mounting](https://github.com/github-zero123/mcdevtool/blob/main/src/addon.cpp): `src/addon.cpp`

### Live development

- [Mod hot reload](https://github.com/github-zero123/mcdevtool/blob/main/tools/mcdk/src/hotreload.cpp): `tools/mcdk/src/hotreload.cpp`
- [Asset reload](https://github.com/github-zero123/mcdevtool/blob/main/tools/mcdk/src/jsonui_reload_support.cpp): `tools/mcdk/src/jsonui_reload_support.cpp`
- [Debug MOD](https://github.com/github-zero123/mcdevtool/blob/main/mods/INCLUDE_TEST_MOD/DEBUG_ENV_SCRIPT/modMain.py): `mods/INCLUDE_TEST_MOD/DEBUG_ENV_SCRIPT/modMain.py`
- [Client loader](https://github.com/github-zero123/mcdevtool/blob/main/mods/INCLUDE_TEST_MOD/DEBUG_ENV_SCRIPT/QuModLibs/Systems/Loader/Client.py): `mods/INCLUDE_TEST_MOD/DEBUG_ENV_SCRIPT/QuModLibs/Systems/Loader/Client.py`
- [Server loader](https://github.com/github-zero123/mcdevtool/blob/main/mods/INCLUDE_TEST_MOD/DEBUG_ENV_SCRIPT/QuModLibs/Systems/Loader/Server.py): `mods/INCLUDE_TEST_MOD/DEBUG_ENV_SCRIPT/QuModLibs/Systems/Loader/Server.py`
- [Shared loader support](https://github.com/github-zero123/mcdevtool/blob/main/mods/INCLUDE_TEST_MOD/DEBUG_ENV_SCRIPT/QuModLibs/Systems/Loader/SharedRes.py): `mods/INCLUDE_TEST_MOD/DEBUG_ENV_SCRIPT/QuModLibs/Systems/Loader/SharedRes.py`

### Automation and inspection

- [MCP client](https://github.com/github-zero123/mcdevtool/blob/main/tools/mcdk/src/mcp_server.cpp): `tools/mcdk/src/mcp_server.cpp`
- [MCP tool definitions](https://github.com/github-zero123/mcdevtool/blob/main/tools/mcdk/src/mcp_tool_definitions.cpp): `tools/mcdk/src/mcp_tool_definitions.cpp`
- [Log access](https://github.com/github-zero123/mcdevtool/blob/main/tools/mcdk/src/log_buffer.cpp): `tools/mcdk/src/log_buffer.cpp`
- [Code execution](https://github.com/github-zero123/mcdevtool/blob/main/tools/mcdk/src/ipc_code_execution.cpp): `tools/mcdk/src/ipc_code_execution.cpp`
- [JSON UI debugger](https://github.com/github-zero123/mcdevtool/blob/main/tools/mcdk/src/jsonui_debugger.cpp): `tools/mcdk/src/jsonui_debugger.cpp`
- [Window capture](https://github.com/github-zero123/mcdevtool/blob/main/src/window_capture.cpp): `src/window_capture.cpp`
- [Window input](https://github.com/github-zero123/mcdevtool/blob/main/src/window_input.cpp): `src/window_input.cpp`
- [Profiler service](https://github.com/github-zero123/mcdevtool/blob/main/tools/mcdk/src/performance/profiler_service.cpp): `tools/mcdk/src/performance/profiler_service.cpp`
- [Profiler types](https://github.com/github-zero123/mcdevtool/blob/main/tools/mcdk/include/mcdk/performance/profiler_types.hpp): `tools/mcdk/include/mcdk/performance/profiler_types.hpp`

### Runtime components

- [MCP protocol](https://github.com/github-zero123/mcdevtool/blob/main/libs/cpp-mcp/include/mcp_message.h): `libs/cpp-mcp/include/mcp_message.h`
- [MCP client API](https://github.com/github-zero123/mcdevtool/blob/main/libs/cpp-mcp/include/mcp_client.h): `libs/cpp-mcp/include/mcp_client.h`
- [MCP transports](https://github.com/github-zero123/mcdevtool/blob/main/libs/cpp-mcp/src/mcp_stdio_client.cpp): `libs/cpp-mcp/src/mcp_stdio_client.cpp`
- [HTTP transport](https://github.com/github-zero123/mcdevtool/blob/main/libs/cpp-mcp/common/httplib.h): `libs/cpp-mcp/common/httplib.h`
- [Base64 support](https://github.com/github-zero123/mcdevtool/blob/main/libs/cpp-mcp/common/base64.hpp): `libs/cpp-mcp/common/base64.hpp`
- [NBT data](https://github.com/github-zero123/mcdevtool/blob/main/libs/nbt/include/nbt-c/NBT.h): `libs/nbt/include/nbt-c/NBT.h`
- [Input API](https://github.com/github-zero123/mcdevtool/blob/main/include/mcdevtool/window_input.h): `include/mcdevtool/window_input.h`
- [Loader utilities](https://github.com/github-zero123/mcdevtool/blob/main/mods/INCLUDE_TEST_MOD/DEBUG_ENV_SCRIPT/QuModLibs/IN.py): `mods/INCLUDE_TEST_MOD/DEBUG_ENV_SCRIPT/QuModLibs/IN.py`

### Other components

- **Mod developer**
- **Minecraft game**

## Connections

- Mod developer → mcdk command: runs (evidence: `README.md`)
- mcdk command → Application flow: starts
- Application flow → Configuration: loads settings
- Application flow → Game environment: prepares runtime
- Game environment → World project: detects project (evidence: `README.md`)
- World project → World setup: deploys map (evidence: `README.md`)
- World project → Pack mounting: mounts packs (evidence: `README.md`)
- Application flow → Minecraft game: launches (evidence: `README.md`)
- Pack mounting → Minecraft game: loads packs (evidence: `README.md`)
- Game environment → Mod hot reload: enables refresh (evidence: `README.md`)
- Mod hot reload → Minecraft game: refreshes mods (evidence: `README.md`)
- Asset reload → Minecraft game: reloads assets (evidence: `README.md`)
- Debug MOD → Minecraft game: runs in (evidence: `README.md`)
- Client loader → Shared loader support: uses (evidence: `mods/INCLUDE_TEST_MOD/DEBUG_ENV_SCRIPT/QuModLibs/Systems/Loader/Client.py`)
- Server loader → Shared loader support: uses (evidence: `mods/INCLUDE_TEST_MOD/DEBUG_ENV_SCRIPT/QuModLibs/Systems/Loader/Server.py`)
- Game environment → MCP client: starts optionally (evidence: `README.md`)
- Mod developer → MCP client: connects MCP client (evidence: `README.md`)
- MCP client → MCP tool definitions: registers tools
- MCP tool definitions → Log access: queries logs
- MCP tool definitions → Code execution: executes code
- MCP tool definitions → JSON UI debugger: analyzes UI
- MCP tool definitions → Window capture: captures window
- MCP tool definitions → Window input: controls window
- MCP tool definitions → Profiler service: profiles runtime
- Profiler service → Profiler types: uses types
- MCP client → MCP protocol: uses protocol
- MCP client API → MCP protocol: uses messages (evidence: `libs/cpp-mcp/include/mcp_client.h`)
- MCP transports → HTTP transport: uses HTTP
- MCP transports → Base64 support: uses encoding
- Window input → Input API: implements API (evidence: `src/window_input.cpp`)
- Client loader → Loader utilities: uses utilities (evidence: `mods/INCLUDE_TEST_MOD/DEBUG_ENV_SCRIPT/QuModLibs/Systems/Loader/Client.py`)
- Server loader → Loader utilities: uses utilities (evidence: `mods/INCLUDE_TEST_MOD/DEBUG_ENV_SCRIPT/QuModLibs/Systems/Loader/Server.py`)
