A Model Context Protocol (MCP) server that enables Large Language Models (LLMs) like Claude to interact with LabVIEW through programmatic scripting.
This Go-based MCP server provides a clean, high-performance interface for LLMs to create, modify, and debug LabVIEW VIs. On Windows, it directly executes Python wrapper scripts that integrate with LabVIEW's DQMH scripting modules via COM.
Status: ✅ Implementation complete, ready for Windows + LabVIEW validation
Claude Desktop (MCP Client)
↓ stdio (JSON-RPC)
Go MCP Server (bin/mcp-server)
↓ On Windows: exec.Command("python", "wrapper/<tool>.py")
Python Wrapper Scripts (wrapper/*.py)
↓ WIN32COM (pywin32)
LabVIEW Application
↓ COM Call2 API
LabVIEW DQMH Module (LabVIEW_Server/Scripting Server/*.vi)
- Linux/macOS: Returns canned stub responses (for development/testing)
- Windows: Executes Python wrappers that communicate with LabVIEW via COM
- Go 1.21+ - For building the MCP server
- LabVIEW 2020+ - With DQMH scripting modules (Windows only)
- Python 3.8+ - For Windows COM integration (wrapper scripts)
- uv - Fast Python package manager (recommended) or pip
- pywin32 - Python Windows COM library (auto-installed via uv/pip)
- Claude Desktop - Or any MCP-compatible client
git clone https://github.com/MeKo-Christian/labview_mcp.git
cd labview_mcp
# Download dependencies
go mod download
# Build the MCP server
go build -o bin/mcp-server ./cmd/mcp-server
# For Windows (cross-compile)
GOOS=windows GOARCH=amd64 go build -o bin/mcp-server.exe ./cmd/mcp-server# Install Python dependencies using uv (recommended)
uv sync
# Or use pip
pip install pywin32
# Deploy to Windows
# Copy these files to your Windows machine:
# - bin/mcp-server.exe
# - wrapper/*.py
# - LabVIEW_Server/
# - pyproject.toml (for uv sync on Windows)
# - uv.lock (for reproducible builds)Add to your Claude Desktop configuration:
Windows: %APPDATA%\Claude\claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"labview": {
"command": "C:\\path\\to\\labview_mcp\\bin\\mcp-server.exe",
"args": []
}
}
}The LabVIEW tools will appear in Claude's available tools list.
Start the LabVIEW DQMH scripting server. Must be called first before using other tools.
No parameters requiredReturns: Module status and configuration
Stop the LabVIEW scripting server and clean up resources.
No parameters requiredReturns: Shutdown confirmation
Create a new VI in LabVIEW IDE.
No parameters requiredReturns: vi_id (integer reference to the created VI)
Save a VI to disk.
{
"vi_id": 123,
"path": "C:\\path\\to\\MyVI.vi" // Empty string saves to previous location
}Returns: Saved file path
Add an object (control, function, structure) to a VI's block diagram or front panel.
{
"diagram_id": 123,
"object_name": "While Loop",
"position_x": 100,
"position_y": 50
}Supports 500+ object types - see docs/tools.md for complete list.
Returns: object_id (integer reference)
Connect two terminals with a wire on the block diagram.
{
"vi_reference": 123,
"from_object_reference": 456,
"from_object_terminal_index": 0,
"to_object_reference": 789,
"to_object_terminal_index": 1
}Returns: Connection confirmation
Get terminal names, descriptions, and indices for wiring.
{
"object_id": 456
}Returns: List of terminals with indices and descriptions
Get compile errors (equivalent to clicking the broken run arrow).
{
"vi_reference": 123
}Returns: Text list of errors and their locations
labview_mcp/
├── cmd/
│ └── mcp-server/ # MCP server entrypoint
├── internal/
│ ├── mcpserver/ # MCP server implementation
│ │ ├── server.go
│ │ └── tools.go # 8 tool definitions
│ └── python/ # Python script execution
│ └── executor.go
├── wrapper/ # Python COM wrapper scripts (8 tools)
│ ├── start_module.py
│ ├── stop_module.py
│ ├── new_vi.py
│ ├── add_object.py
│ ├── connect_objects.py
│ ├── get_object_terminals.py
│ ├── save_vi.py
│ └── get_vi_error_list.py
├── LabVIEW_Server/ # LabVIEW DQMH modules (29 Request VIs)
│ └── Scripting Server/
├── docs/
│ ├── tools.md # Complete tool schema reference (29 tools)
│ ├── vi-mapping.md # LabVIEW VI → Python tool mapping
│ └── plans/ # Design documents
├── bin/ # Build artifacts
├── go.mod
├── go.sum
└── README.md
# Run MCP server (standalone mode with stubs on Linux/macOS)
go run ./cmd/mcp-server# Run all tests
go test ./...
# Run with coverage
go test -cover ./...- Add tool schema to docs/tools.md
- Add handler in
internal/mcpserver/tools.go - Create Python wrapper in
wrapper/<tool>.py - Add canned response in
internal/python/executor.go - Rebuild binary
Each wrapper script (wrapper/):
- Reads JSON from stdin
- Connects to LabVIEW:
win32com.client.Dispatch("LabVIEW.Application") - Gets VI reference:
GetVIReference("LabVIEW_Server/Scripting Server/<tool>.vi") - Calls VI via COM:
vi.Call2(param_names, param_values, ...) - Extracts results from
param_valuesarray - Returns JSON to stdout
The LabVIEW server uses the Delacor Queued Message Handler (DQMH) pattern:
- Request VIs: Public API (e.g.,
new_vi.vi,add_object.vi) - Do VIs: Internal implementation (e.g.,
Do Create Control.vi) - Module VIs: Lifecycle management (
Start Module.vi,Stop Module.vi)
All calls use the Request-and-Wait-for-Reply pattern with the Call2 API.
See docs/vi-mapping.md for complete VI documentation.
✅ Completed:
- Go MCP server with 8 core tools
- Direct Python execution with platform detection
- Python wrapper integration for Windows
- Canned stub responses for Linux/macOS
⏳ Pending:
- Windows + LabVIEW validation testing
- Remaining 21 tools (optional)
- Performance optimization
See PLAN.md for detailed progress tracking.
- Check Claude Desktop logs:
~/.config/Claude/logs/ - Verify MCP server path in
claude_desktop_config.json - Ensure binary has execute permissions
- Restart Claude Desktop
- Verify Python is in PATH:
python --version - Check pywin32 is installed:
pip show pywin32 - Ensure LabVIEW is running
- Check stderr output for Python errors
- Ensure LabVIEW 2020+ is installed
- Enable scripting: Tools → Options → VI Server → Enable VI Scripting
- Check DQMH module is loaded:
LabVIEW_Server/Scripting Server/ - Verify VI paths in wrapper scripts
- docs/tools.md - Complete tool schema reference (all 29 tools)
- docs/vi-mapping.md - LabVIEW VI architecture and mapping
- PLAN.md - Implementation roadmap and progress
Contributions are welcome! This project is actively maintained.
- Check PLAN.md for current status
- Pick a task or feature
- Follow standard Go conventions (
gofmt,golint) - Write tests for new functionality
- Submit a PR
[To be specified]
- Built on Model Context Protocol
- Uses Go MCP SDK
- LabVIEW integration based on DQMH framework
- Original Python implementation by CalmyJane
- Issues: GitHub Issues
- Organization: MeKo-Tech
- Author: @MeKo-Christian