# yangpan2020/debugforge architecture

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

- Interactive diagram: https://gitdiagram.com/yangpan2020/debugforge
- Repository: https://github.com/yangpan2020/debugforge

## Overview

DebugForge is an MCP server that lets AI agents operate local or remote Lauterbach TRACE32 sessions. The principal workflow is agent tool calls → connection and target inspection/control → debugging evidence returned to the agent; build and ELF analysis, reusable debugging skills, multicore controls, trace, and hardware triggers are additional capabilities. Groups reflect the MCP interface, session/configuration layer, debugging tools, and project/hardware integrations. Tool registration and core runtime calls are shown in excerpts; broader capability links rely on README documentation where noted.

Main entry points: [`src/debugforge/server.py`](https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/server.py) (MCP Server), [`src/debugforge/state.py`](https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/state.py) (Connection State), [`src/debugforge/tools/views.py`](https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/tools/views.py) (Debug Views), [`src/debugforge/tools/execution.py`](https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/tools/execution.py) (Execution Control)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["MCP Interface"]
  node_mcp["MCP Server<br/>[server.py]"]
end

subgraph group_runtime["Session Runtime"]
  node_config["Project Config<br/>[config.py]"]
  node_state["Connection State<br/>[state.py]"]
  node_connection["Connection Tools<br/>[connection.py]"]
end

subgraph group_debug["Debug Operations"]
  node_execution["Execution Control<br/>[execution.py]"]
  node_breakpoints["Breakpoints<br/>[breakpoints.py]"]
  node_advanced_breakpoints["Advanced Breakpoints"]
  node_advanced_debug["Advanced Inspection<br/>[debug_advanced.py]"]
  node_memory["Memory Inspection<br/>[memory.py]"]
  node_registers["Register Inspection<br/>[registers.py]"]
  node_variables["Variable Inspection<br/>[variables.py]"]
  node_symbols["Symbols<br/>[symbols.py]"]
  node_views["Debug Views<br/>[views.py]"]
  node_commands["TRACE32 Commands<br/>[commands.py]"]
  node_notifications["Notifications<br/>[notifications.py]"]
  node_benchmark["Benchmark Tools<br/>[benchmark.py]"]
end

subgraph group_project["Project Analysis"]
  node_build["Build and ELF<br/>[build.py]"]
  node_workflow["Debug Workflow<br/>[workflow.py]"]
  node_skills["Debug Skills<br/>[skills.py]"]
end

subgraph group_hardware["Hardware Features"]
  node_trace32["TRACE32"]
  node_target["Target MCU"]
  node_trace["On-chip Trace<br/>[trace.py]"]
  node_multicore["Multicore Debug<br/>[multicore.py]"]
  node_watchpin["WatchPin Triggers<br/>[watchpin.py]"]
  node_system_config["System Configuration<br/>[system_config.py]"]
end

node_agent(("AI Agent"))
node_remote["Remote Windows"]

node_agent -->|"sends tool calls"| node_mcp
node_mcp -->|"registers tools"| node_execution
node_mcp -->|"registers tools"| node_connection
node_mcp -->|"registers tools"| node_memory
node_mcp -->|"registers tools"| node_registers
node_mcp -->|"registers tools"| node_breakpoints
node_mcp -->|"registers tools"| node_variables
node_mcp -->|"registers tools"| node_symbols
node_mcp -->|"registers tools"| node_commands
node_mcp -->|"registers tools"| node_views
node_mcp -->|"registers tools"| node_advanced_breakpoints
node_mcp -->|"registers tools"| node_advanced_debug
node_mcp -->|"registers tools"| node_build
node_mcp -->|"registers tools"| node_workflow
node_mcp -->|"registers tools"| node_skills
node_mcp -->|"registers tools"| node_trace
node_mcp -->|"registers tools"| node_multicore
node_mcp -->|"registers tools"| node_system_config
node_mcp -->|"registers tools"| node_watchpin
node_mcp -->|"registers tools"| node_notifications
node_mcp -->|"registers tools"| node_benchmark
node_state -->|"loads settings"| node_config
node_mcp -->|"manages lifecycle"| node_state
node_connection -->|"connects session"| node_state
node_execution -->|"requires session"| node_state
node_advanced_debug -->|"requires session"| node_state
node_trace -->|"requires session"| node_state
node_multicore -->|"requires session"| node_state
node_watchpin -->|"requires session"| node_state
node_advanced_debug -->|"reads windows"| node_views
node_execution -->|"reads windows"| node_views
node_multicore -->|"reads windows"| node_views
node_watchpin -->|"reads windows"| node_views
node_system_config -->|"reads windows"| node_views
node_trace32 -->|"controls hardware"| node_target
node_mcp -->|"bridges via PYRCL"| node_trace32
node_mcp -.->|"supports remote mode"| node_remote
node_remote -->|"runs debugger"| node_trace32
node_remote -->|"transfers files"| node_mcp

click node_mcp "https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/server.py"
click node_config "https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/config.py"
click node_state "https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/state.py"
click node_connection "https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/tools/connection.py"
click node_execution "https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/tools/execution.py"
click node_breakpoints "https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/tools/breakpoints.py"
click node_advanced_breakpoints "https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/tools/breakpoints_advanced.py"
click node_advanced_debug "https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/tools/debug_advanced.py"
click node_memory "https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/tools/memory.py"
click node_registers "https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/tools/registers.py"
click node_variables "https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/tools/variables.py"
click node_symbols "https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/tools/symbols.py"
click node_views "https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/tools/views.py"
click node_commands "https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/tools/commands.py"
click node_build "https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/tools/build.py"
click node_workflow "https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/tools/workflow.py"
click node_skills "https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/tools/skills.py"
click node_trace "https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/tools/trace.py"
click node_multicore "https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/tools/multicore.py"
click node_watchpin "https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/tools/watchpin.py"
click node_system_config "https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/tools/system_config.py"
click node_notifications "https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/tools/notifications.py"
click node_benchmark "https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/tools/benchmark.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_mcp toneBlue
class node_config,node_state,node_connection toneAmber
class node_execution,node_breakpoints,node_advanced_breakpoints,node_advanced_debug,node_memory,node_registers,node_variables,node_symbols,node_views,node_commands,node_notifications,node_benchmark toneMint
class node_build,node_workflow,node_skills toneRose
class node_trace32,node_target,node_trace,node_multicore,node_watchpin,node_system_config,node_agent,node_remote toneIndigo
```

## Components

### MCP Interface

- [MCP Server](https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/server.py): `src/debugforge/server.py`

### Session Runtime

- [Project Config](https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/config.py): `src/debugforge/config.py`
- [Connection State](https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/state.py): `src/debugforge/state.py`
- [Connection Tools](https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/tools/connection.py): `src/debugforge/tools/connection.py`

### Debug Operations

- [Execution Control](https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/tools/execution.py): `src/debugforge/tools/execution.py`
- [Breakpoints](https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/tools/breakpoints.py): `src/debugforge/tools/breakpoints.py`
- [Advanced Breakpoints](https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/tools/breakpoints_advanced.py): `src/debugforge/tools/breakpoints_advanced.py`
- [Advanced Inspection](https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/tools/debug_advanced.py): `src/debugforge/tools/debug_advanced.py`
- [Memory Inspection](https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/tools/memory.py): `src/debugforge/tools/memory.py`
- [Register Inspection](https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/tools/registers.py): `src/debugforge/tools/registers.py`
- [Variable Inspection](https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/tools/variables.py): `src/debugforge/tools/variables.py`
- [Symbols](https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/tools/symbols.py): `src/debugforge/tools/symbols.py`
- [Debug Views](https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/tools/views.py): `src/debugforge/tools/views.py`
- [TRACE32 Commands](https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/tools/commands.py): `src/debugforge/tools/commands.py`
- [Notifications](https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/tools/notifications.py): `src/debugforge/tools/notifications.py`
- [Benchmark Tools](https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/tools/benchmark.py): `src/debugforge/tools/benchmark.py`

### Project Analysis

- [Build and ELF](https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/tools/build.py): `src/debugforge/tools/build.py`
- [Debug Workflow](https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/tools/workflow.py): `src/debugforge/tools/workflow.py`
- [Debug Skills](https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/tools/skills.py): `src/debugforge/tools/skills.py`

### Hardware Features

- **TRACE32**
- **Target MCU**
- [On-chip Trace](https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/tools/trace.py): `src/debugforge/tools/trace.py`
- [Multicore Debug](https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/tools/multicore.py): `src/debugforge/tools/multicore.py`
- [WatchPin Triggers](https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/tools/watchpin.py): `src/debugforge/tools/watchpin.py`
- [System Configuration](https://github.com/yangpan2020/debugforge/blob/main/src/debugforge/tools/system_config.py): `src/debugforge/tools/system_config.py`

### Other components

- **AI Agent**
- **Remote Windows**

## Connections

- AI Agent → MCP Server: sends tool calls (evidence: `README.md`)
- MCP Server → Execution Control: registers tools (evidence: `src/debugforge/server.py`)
- MCP Server → Connection Tools: registers tools (evidence: `src/debugforge/server.py`)
- MCP Server → Memory Inspection: registers tools (evidence: `src/debugforge/server.py`)
- MCP Server → Register Inspection: registers tools (evidence: `src/debugforge/server.py`)
- MCP Server → Breakpoints: registers tools (evidence: `src/debugforge/server.py`)
- MCP Server → Variable Inspection: registers tools (evidence: `src/debugforge/server.py`)
- MCP Server → Symbols: registers tools (evidence: `src/debugforge/server.py`)
- MCP Server → TRACE32 Commands: registers tools (evidence: `src/debugforge/server.py`)
- MCP Server → Debug Views: registers tools (evidence: `src/debugforge/server.py`)
- MCP Server → Advanced Breakpoints: registers tools (evidence: `src/debugforge/server.py`)
- MCP Server → Advanced Inspection: registers tools (evidence: `src/debugforge/server.py`)
- MCP Server → Build and ELF: registers tools (evidence: `src/debugforge/server.py`)
- MCP Server → Debug Workflow: registers tools (evidence: `src/debugforge/server.py`)
- MCP Server → Debug Skills: registers tools (evidence: `src/debugforge/server.py`)
- MCP Server → On-chip Trace: registers tools (evidence: `src/debugforge/server.py`)
- MCP Server → Multicore Debug: registers tools (evidence: `src/debugforge/server.py`)
- MCP Server → System Configuration: registers tools (evidence: `src/debugforge/server.py`)
- MCP Server → WatchPin Triggers: registers tools (evidence: `src/debugforge/server.py`)
- MCP Server → Notifications: registers tools (evidence: `src/debugforge/server.py`)
- MCP Server → Benchmark Tools: registers tools (evidence: `src/debugforge/server.py`)
- Connection State → Project Config: loads settings (evidence: `src/debugforge/state.py`)
- MCP Server → Connection State: manages lifecycle (evidence: `src/debugforge/server.py`)
- Connection Tools → Connection State: connects session (evidence: `src/debugforge/tools/connection.py`)
- Execution Control → Connection State: requires session (evidence: `src/debugforge/tools/execution.py`)
- Advanced Inspection → Connection State: requires session (evidence: `src/debugforge/tools/debug_advanced.py`)
- On-chip Trace → Connection State: requires session (evidence: `src/debugforge/tools/trace.py`)
- Multicore Debug → Connection State: requires session (evidence: `src/debugforge/tools/multicore.py`)
- WatchPin Triggers → Connection State: requires session (evidence: `src/debugforge/tools/watchpin.py`)
- Advanced Inspection → Debug Views: reads windows (evidence: `src/debugforge/tools/debug_advanced.py`)
- Execution Control → Debug Views: reads windows (evidence: `src/debugforge/tools/execution.py`)
- Multicore Debug → Debug Views: reads windows (evidence: `src/debugforge/tools/multicore.py`)
- WatchPin Triggers → Debug Views: reads windows (evidence: `src/debugforge/tools/watchpin.py`)
- System Configuration → Debug Views: reads windows (evidence: `src/debugforge/tools/system_config.py`)
- TRACE32 → Target MCU: controls hardware (evidence: `README.md`)
- MCP Server → TRACE32: bridges via PYRCL (evidence: `README.md`)
- MCP Server → Remote Windows: supports remote mode (evidence: `README.md`)
- Remote Windows → TRACE32: runs debugger (evidence: `README.md`)
- Remote Windows → MCP Server: transfers files (evidence: `README.md`)
