# illegal-instruction-co/processhacker-mcp architecture

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

- Interactive diagram: https://gitdiagram.com/illegal-instruction-co/processhacker-mcp
- Repository: https://github.com/illegal-instruction-co/processhacker-mcp

## Overview

ProcessHacker MCP is a stdio MCP server that exposes process-inspection and runtime-modification tools through dynamically loaded extensions. The principal workflow is an AI agent sending a tool request to the router, which dispatches it to a registered extension and returns the result. README documents read-only blocking, audit logging, rate limiting, and dynamic C extension compilation; sampled sources confirm representative built-in, scanning, patching, RTTI, and hook components. The server implementation was read but not excerpted, so detailed internal dispatch and guardrail links rely on its indexed presence and README documentation.

Main entry points: [`src/McpServer.cpp`](https://github.com/illegal-instruction-co/processhacker-mcp/blob/main/src/McpServer.cpp) (MCP Server), [`include/McpExtensionApi.h`](https://github.com/illegal-instruction-co/processhacker-mcp/blob/main/include/McpExtensionApi.h) (Extension API), [`extensions/auto_compiler_ext/AutoCompilerExt.cpp`](https://github.com/illegal-instruction-co/processhacker-mcp/blob/main/extensions/auto_compiler_ext/AutoCompilerExt.cpp) (Auto Compiler), [`src/Main.cpp`](https://github.com/illegal-instruction-co/processhacker-mcp/blob/main/src/Main.cpp) (Server Entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_router["MCP Router"]
  node_server["MCP Server<br/>[McpServer.cpp]"]
  node_entry["Server Entry<br/>[Main.cpp]"]
  node_api["Extension API<br/>[McpExtensionApi.h]"]
  node_policy["Safety &amp; Audit<br/>[McpServer.cpp]"]
end

subgraph group_process["Process Analysis"]
  node_builtin["Process Tools<br/>[BuiltinExt.cpp]"]
  node_scanner["Pattern Scanner"]
  node_rtti["RTTI Dumper<br/>[RttiDumperExt.cpp]"]
end

subgraph group_extensions["Extension Tools"]
  node_patcher["Memory Patcher"]
  node_freezer["Memory Freezer<br/>[FreezerExt.cpp]"]
  node_veh["VEH Hooking"]
  node_sample["Extension Example<br/>[SampleExt.cpp]"]
end

subgraph group_dynamic["Dynamic Extensions"]
  node_compiler["Auto Compiler"]
  node_tcc["Tiny C Compiler"]
  node_dynamicdll["Compiled Extension"]
end

node_agent(("AI Agent"))
node_response["Tool Result"]

node_agent -->|"sends requests"| node_server
node_entry -->|"starts"| node_server
node_entry -->|"loads extensions"| node_server
node_server -->|"enforces limits"| node_policy
node_server -.->|"dispatches tools"| node_builtin
node_server -.->|"dispatches tools"| node_scanner
node_server -.->|"dispatches tools"| node_rtti
node_server -.->|"dispatches tools"| node_patcher
node_server -.->|"dispatches tools"| node_freezer
node_server -.->|"dispatches tools"| node_veh
node_api -->|"registers tools"| node_server
node_builtin -->|"registers tools"| node_api
node_scanner -->|"registers tool"| node_api
node_rtti -->|"registers tool"| node_api
node_patcher -->|"registers tool"| node_api
node_compiler -->|"registers tool"| node_api
node_agent -->|"requests compilation"| node_compiler
node_compiler -->|"compiles C"| node_tcc
node_compiler -->|"hot-loads extension"| node_dynamicdll
node_dynamicdll -.->|"registers tools"| node_server
node_server -.->|"returns result"| node_response

click node_server "https://github.com/illegal-instruction-co/processhacker-mcp/blob/main/src/McpServer.cpp"
click node_entry "https://github.com/illegal-instruction-co/processhacker-mcp/blob/main/src/Main.cpp"
click node_api "https://github.com/illegal-instruction-co/processhacker-mcp/blob/main/include/McpExtensionApi.h"
click node_policy "https://github.com/illegal-instruction-co/processhacker-mcp/blob/main/src/McpServer.cpp"
click node_builtin "https://github.com/illegal-instruction-co/processhacker-mcp/blob/main/extensions/builtin_ext/BuiltinExt.cpp"
click node_scanner "https://github.com/illegal-instruction-co/processhacker-mcp/blob/main/extensions/pattern_scanner_ext/PatternScannerExt.cpp"
click node_rtti "https://github.com/illegal-instruction-co/processhacker-mcp/blob/main/extensions/rtti_dumper_ext/RttiDumperExt.cpp"
click node_patcher "https://github.com/illegal-instruction-co/processhacker-mcp/blob/main/extensions/memory_patcher_ext/MemoryPatcherExt.cpp"
click node_freezer "https://github.com/illegal-instruction-co/processhacker-mcp/blob/main/extensions/freezer_ext/FreezerExt.cpp"
click node_veh "https://github.com/illegal-instruction-co/processhacker-mcp/tree/main/extensions/vehbutnot_ext"
click node_sample "https://github.com/illegal-instruction-co/processhacker-mcp/blob/main/extensions/sample_ext/SampleExt.cpp"
click node_compiler "https://github.com/illegal-instruction-co/processhacker-mcp/blob/main/extensions/auto_compiler_ext/AutoCompilerExt.cpp"
click node_tcc "https://github.com/illegal-instruction-co/processhacker-mcp/tree/main/third_party/tinycc"
click node_dynamicdll "https://github.com/illegal-instruction-co/processhacker-mcp/tree/main/extensions"

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_server,node_entry,node_api,node_policy toneBlue
class node_builtin,node_scanner,node_rtti toneAmber
class node_patcher,node_freezer,node_veh,node_sample toneMint
class node_compiler,node_tcc,node_dynamicdll toneRose
class node_agent,node_response toneIndigo
```

## Components

### MCP Router

- [MCP Server](https://github.com/illegal-instruction-co/processhacker-mcp/blob/main/src/McpServer.cpp): `src/McpServer.cpp`
- [Server Entry](https://github.com/illegal-instruction-co/processhacker-mcp/blob/main/src/Main.cpp): `src/Main.cpp`
- [Extension API](https://github.com/illegal-instruction-co/processhacker-mcp/blob/main/include/McpExtensionApi.h): `include/McpExtensionApi.h`
- [Safety & Audit](https://github.com/illegal-instruction-co/processhacker-mcp/blob/main/src/McpServer.cpp): `src/McpServer.cpp`

### Process Analysis

- [Process Tools](https://github.com/illegal-instruction-co/processhacker-mcp/blob/main/extensions/builtin_ext/BuiltinExt.cpp): `extensions/builtin_ext/BuiltinExt.cpp`
- [Pattern Scanner](https://github.com/illegal-instruction-co/processhacker-mcp/blob/main/extensions/pattern_scanner_ext/PatternScannerExt.cpp): `extensions/pattern_scanner_ext/PatternScannerExt.cpp`
- [RTTI Dumper](https://github.com/illegal-instruction-co/processhacker-mcp/blob/main/extensions/rtti_dumper_ext/RttiDumperExt.cpp): `extensions/rtti_dumper_ext/RttiDumperExt.cpp`

### Extension Tools

- [Memory Patcher](https://github.com/illegal-instruction-co/processhacker-mcp/blob/main/extensions/memory_patcher_ext/MemoryPatcherExt.cpp): `extensions/memory_patcher_ext/MemoryPatcherExt.cpp`
- [Memory Freezer](https://github.com/illegal-instruction-co/processhacker-mcp/blob/main/extensions/freezer_ext/FreezerExt.cpp): `extensions/freezer_ext/FreezerExt.cpp`
- [VEH Hooking](https://github.com/illegal-instruction-co/processhacker-mcp/tree/main/extensions/vehbutnot_ext): `extensions/vehbutnot_ext`
- [Extension Example](https://github.com/illegal-instruction-co/processhacker-mcp/blob/main/extensions/sample_ext/SampleExt.cpp): `extensions/sample_ext/SampleExt.cpp`

### Dynamic Extensions

- [Auto Compiler](https://github.com/illegal-instruction-co/processhacker-mcp/blob/main/extensions/auto_compiler_ext/AutoCompilerExt.cpp): `extensions/auto_compiler_ext/AutoCompilerExt.cpp`
- [Tiny C Compiler](https://github.com/illegal-instruction-co/processhacker-mcp/tree/main/third_party/tinycc): `third_party/tinycc`
- [Compiled Extension](https://github.com/illegal-instruction-co/processhacker-mcp/tree/main/extensions): `extensions`

### Other components

- **AI Agent**
- **Tool Result**

## Connections

- AI Agent → MCP Server: sends requests (evidence: `README.md`)
- Server Entry → MCP Server: starts (evidence: `src/Main.cpp`)
- Server Entry → MCP Server: loads extensions (evidence: `src/Main.cpp`)
- MCP Server → Safety & Audit: enforces limits (evidence: `README.md`)
- MCP Server → Process Tools: dispatches tools
- MCP Server → Pattern Scanner: dispatches tools
- MCP Server → RTTI Dumper: dispatches tools
- MCP Server → Memory Patcher: dispatches tools
- MCP Server → Memory Freezer: dispatches tools
- MCP Server → VEH Hooking: dispatches tools
- Extension API → MCP Server: registers tools (evidence: `include/McpExtensionApi.h`)
- Process Tools → Extension API: registers tools (evidence: `extensions/builtin_ext/BuiltinExt.cpp`)
- Pattern Scanner → Extension API: registers tool (evidence: `extensions/pattern_scanner_ext/PatternScannerExt.cpp`)
- RTTI Dumper → Extension API: registers tool (evidence: `extensions/rtti_dumper_ext/RttiDumperExt.cpp`)
- Memory Patcher → Extension API: registers tool (evidence: `extensions/memory_patcher_ext/MemoryPatcherExt.cpp`)
- Auto Compiler → Extension API: registers tool (evidence: `extensions/auto_compiler_ext/AutoCompilerExt.cpp`)
- AI Agent → Auto Compiler: requests compilation (evidence: `README.md`)
- Auto Compiler → Tiny C Compiler: compiles C (evidence: `extensions/auto_compiler_ext/AutoCompilerExt.cpp`)
- Auto Compiler → Compiled Extension: hot-loads extension (evidence: `extensions/auto_compiler_ext/AutoCompilerExt.cpp`)
- Compiled Extension → MCP Server: registers tools
- MCP Server → Tool Result: returns result
