# zuehlke/labview-mcp architecture

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

- Interactive diagram: https://gitdiagram.com/zuehlke/labview-mcp
- Repository: https://github.com/zuehlke/labview-mcp

## Overview

LabVIEW MCP exposes local LabVIEW read, create, edit, run, build, reuse, and documentation capabilities to an AI client through an MCP server. The principal workflow is client request → local server/tool dispatch → LabVIEW gRPC and/or the bundled pylabview file engine → a real VI or returned inspection/result. The README documents these subsystem boundaries; sampled implementation excerpts do not show individual tool dispatch paths, so capability edges cite the README rather than implying unobserved internal calls.

Main entry points: [`src/LabVIEWMCP/Tools`](https://github.com/zuehlke/labview-mcp/tree/main/src/LabVIEWMCP/Tools) (Tool handlers), [`scripts/aixml-pylabview`](https://github.com/zuehlke/labview-mcp/tree/main/scripts/aixml-pylabview) (VI file engine), [`src/LabVIEWMCP/Program.cs`](https://github.com/zuehlke/labview-mcp/blob/main/src/LabVIEWMCP/Program.cs) (MCP server), [`src/LabVIEWMCP/Grpc`](https://github.com/zuehlke/labview-mcp/tree/main/src/LabVIEWMCP/Grpc) (gRPC client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["MCP interface"]
  node_server["MCP server<br/>[Program.cs]"]
  node_tools["Tool handlers"]
end

subgraph group_engines["LabVIEW engines"]
  node_grpc["gRPC client"]
  node_pylabview["VI file engine"]
  node_aixml["AIXML conversion<br/>[aixml2vi.py]"]
  node_python_runtime["Bundled Python runtime"]
end

subgraph group_vi_workflows["VI workflows"]
  node_vi_files[("VI files")]
  node_read_inspect["Read and inspect<br/>[InspectTools.cs]"]
  node_create_edit["Create and edit<br/>[AixmlTools.cs]"]
  node_execute_build["Run and build<br/>[RunTools.cs]"]
  node_document["Documentation output<br/>[ExampleTools.cs]"]
end

subgraph group_knowledge["Reusable knowledge"]
  node_palette["Palette search<br/>[PaletteTools.cs]"]
  node_examples["Example search<br/>[ExampleTools.cs]"]
  node_indexes[("Knowledge indexes<br/>[PaletteIndex.cs]")]
end

node_client(("AI client"))
node_labview["LabVIEW IDE"]

node_client -->|"sends MCP requests"| node_server
node_server -->|"returns results"| node_client
node_server -.->|"dispatches tools"| node_tools
node_tools -.->|"uses gRPC"| node_grpc
node_grpc -->|"sends RPCs"| node_labview
node_tools -.->|"uses file engine"| node_pylabview
node_pylabview -->|"rewrites files"| node_vi_files
node_pylabview -.->|"converts AIXML"| node_aixml
node_python_runtime -.->|"supports runtime"| node_pylabview
node_tools -->|"reads diagrams"| node_read_inspect
node_tools -->|"creates or edits"| node_create_edit
node_tools -->|"runs or builds"| node_execute_build
node_tools -->|"generates documents"| node_document
node_tools -->|"searches palettes"| node_palette
node_tools -->|"searches examples"| node_examples
node_palette -.->|"queries index"| node_indexes
node_examples -.->|"queries index"| node_indexes

click node_server "https://github.com/zuehlke/labview-mcp/blob/main/src/LabVIEWMCP/Program.cs"
click node_tools "https://github.com/zuehlke/labview-mcp/tree/main/src/LabVIEWMCP/Tools"
click node_grpc "https://github.com/zuehlke/labview-mcp/tree/main/src/LabVIEWMCP/Grpc"
click node_pylabview "https://github.com/zuehlke/labview-mcp/tree/main/scripts/aixml-pylabview"
click node_aixml "https://github.com/zuehlke/labview-mcp/blob/main/scripts/aixml-pylabview/aixml2vi.py"
click node_python_runtime "https://github.com/zuehlke/labview-mcp/tree/main/tools/pylabview/runtime/Lib"
click node_read_inspect "https://github.com/zuehlke/labview-mcp/blob/main/src/LabVIEWMCP/Tools/InspectTools.cs"
click node_create_edit "https://github.com/zuehlke/labview-mcp/blob/main/src/LabVIEWMCP/Tools/AixmlTools.cs"
click node_execute_build "https://github.com/zuehlke/labview-mcp/blob/main/src/LabVIEWMCP/Tools/RunTools.cs"
click node_document "https://github.com/zuehlke/labview-mcp/blob/main/src/LabVIEWMCP/Tools/ExampleTools.cs"
click node_palette "https://github.com/zuehlke/labview-mcp/blob/main/src/LabVIEWMCP/Tools/PaletteTools.cs"
click node_examples "https://github.com/zuehlke/labview-mcp/blob/main/src/LabVIEWMCP/Tools/ExampleTools.cs"
click node_indexes "https://github.com/zuehlke/labview-mcp/blob/main/src/LabVIEWMCP/Infra/PaletteIndex.cs"

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_tools,node_client,node_labview toneBlue
class node_grpc,node_pylabview,node_aixml,node_python_runtime toneAmber
class node_vi_files,node_read_inspect,node_create_edit,node_execute_build,node_document toneMint
class node_palette,node_examples,node_indexes toneRose
```

## Components

### MCP interface

- [MCP server](https://github.com/zuehlke/labview-mcp/blob/main/src/LabVIEWMCP/Program.cs): `src/LabVIEWMCP/Program.cs`
- [Tool handlers](https://github.com/zuehlke/labview-mcp/tree/main/src/LabVIEWMCP/Tools): `src/LabVIEWMCP/Tools`

### LabVIEW engines

- [gRPC client](https://github.com/zuehlke/labview-mcp/tree/main/src/LabVIEWMCP/Grpc): `src/LabVIEWMCP/Grpc`
- [VI file engine](https://github.com/zuehlke/labview-mcp/tree/main/scripts/aixml-pylabview): `scripts/aixml-pylabview`
- [AIXML conversion](https://github.com/zuehlke/labview-mcp/blob/main/scripts/aixml-pylabview/aixml2vi.py): `scripts/aixml-pylabview/aixml2vi.py`
- [Bundled Python runtime](https://github.com/zuehlke/labview-mcp/tree/main/tools/pylabview/runtime/Lib): `tools/pylabview/runtime/Lib`

### VI workflows

- **VI files**
- [Read and inspect](https://github.com/zuehlke/labview-mcp/blob/main/src/LabVIEWMCP/Tools/InspectTools.cs): `src/LabVIEWMCP/Tools/InspectTools.cs`
- [Create and edit](https://github.com/zuehlke/labview-mcp/blob/main/src/LabVIEWMCP/Tools/AixmlTools.cs): `src/LabVIEWMCP/Tools/AixmlTools.cs`
- [Run and build](https://github.com/zuehlke/labview-mcp/blob/main/src/LabVIEWMCP/Tools/RunTools.cs): `src/LabVIEWMCP/Tools/RunTools.cs`
- [Documentation output](https://github.com/zuehlke/labview-mcp/blob/main/src/LabVIEWMCP/Tools/ExampleTools.cs): `src/LabVIEWMCP/Tools/ExampleTools.cs`

### Reusable knowledge

- [Palette search](https://github.com/zuehlke/labview-mcp/blob/main/src/LabVIEWMCP/Tools/PaletteTools.cs): `src/LabVIEWMCP/Tools/PaletteTools.cs`
- [Example search](https://github.com/zuehlke/labview-mcp/blob/main/src/LabVIEWMCP/Tools/ExampleTools.cs): `src/LabVIEWMCP/Tools/ExampleTools.cs`
- [Knowledge indexes](https://github.com/zuehlke/labview-mcp/blob/main/src/LabVIEWMCP/Infra/PaletteIndex.cs): `src/LabVIEWMCP/Infra/PaletteIndex.cs`

### Other components

- **AI client**
- **LabVIEW IDE**

## Connections

- AI client → MCP server: sends MCP requests
- MCP server → AI client: returns results
- MCP server → Tool handlers: dispatches tools (evidence: `src/LabVIEWMCP/Program.cs`)
- Tool handlers → gRPC client: uses gRPC
- gRPC client → LabVIEW IDE: sends RPCs
- Tool handlers → VI file engine: uses file engine
- VI file engine → VI files: rewrites files
- VI file engine → AIXML conversion: converts AIXML
- Bundled Python runtime → VI file engine: supports runtime (evidence: `scripts/aixml-pylabview/lvheap.py`)
- Tool handlers → Read and inspect: reads diagrams
- Tool handlers → Create and edit: creates or edits
- Tool handlers → Run and build: runs or builds
- Tool handlers → Documentation output: generates documents
- Tool handlers → Palette search: searches palettes
- Tool handlers → Example search: searches examples
- Palette search → Knowledge indexes: queries index
- Example search → Knowledge indexes: queries index
