- lv-bots-mcp-server -
Enabling AI Agents to utilize LabVIEW Tools - 1. Purpose and Long Term Vision
- 2. lv-bots in Action - Quick Setup and Run
- 3. Current Features and Limitations
- 4. User Guide (Additional Details)
lv-bots-mcp-server is a Python-based Model Context Protocol (MCP) server that dynamically registers LabVIEW VIs as tools for AI agents / applications.
- The purpose of this project is to make LabVIEW VIs / Code modules seamlessly usable by AI agents.
- Bridge the gap between modern AI-driven multi-agent ecosystem and existing or new LabVIEW resources available like automation tools, labview scripting tools, algorithms, testing frameworks, calculation VIs, etc.,
- Enables AI agents to reuse existing code - Developers should not spend efforts to rewrite or migrate the LabVIEW resources in order to integrate with AI agents
- β AI-driven LabVIEW integration β Any existing LabVIEW VI should be callable by AI agents through MCP (Model Context Protocol) open standard.
- β Metadata-driven understanding β AI agents leverage JSON metadata files to understand a VIβs purpose, inputs, and outputs.
- β MCP-first approach β Since most platforms (like n8n, AutoGen, etc.) already support MCP integration, this project follows the MCP standard for maximum interoperability.
- β Auto Generate the metadata JSON that describes the Tool VIs avaialble β Today, metadata JSONs are created manually. In the future, metadata will be auto-generated from VI descriptions, connector pane details, and control/indicator properties.
- β Tool chaining β In Future Enable advanced workflows where outputs from one VI can serve as inputs for another, allowing AI agents to intelligently chain LabVIEW tools to perform complex tasks.
- Download the Setup Zip file from the Releases. Unzip and Run the Installer.
- lv-bots will be installed at
C:\lv-bots - Add your
OPENAI_API_KEYin theC:\lv-bots\.env - Open and run the
C:\lv-bots\lv_bots_launcher.viin LabVIEW (32-bit) to launch the MCP Server. - Two terminals will be opened
- One for lv-bots MCP Server, and
- Another for the Example AI Agent.
- Interact with the agent in the terminal which can run the tools based on the prompts.
- Example Tools are available at
C:\lv-bots\mcp_tool_visadd.vi- Adds two numbers given as input.calculate_bmi.vi- Calculates BMI for given weight in kg and height in cm.scripting_create_vi.vi- Creates a New VI at the specified file path using the Template VI path given.
- Metadata JSON Files that describes the tools are at
C:\lv-bots\mcp_tools_metadata. - Below is the Example Chat session where AI agent lists the tools and uses right tool based on prompt with right inputs.
- To include more tool VIs - Add the VIs and respective Metadata files in the folders
mcp_tool_visandmcp_tools_metadata.- The folder locations can be changed by modifying few keys in
.envandlv_bots_executor_config.ini. Refer theUser GuideSection. - Refer 4.6.1. Metadata JSON to create metadata files for new tool VIs.
- The folder locations can be changed by modifying few keys in
- Closing lv-bots - To exit lv-bots, close all the open terminals and the lv_bots_executor_service VI front panel.
- Refer User Guide for more details
- MCP Tool Registration β MCP Tools registerd for each
.jsonfile in the metadata folder. - MCP Server β The tools registered in lv-bots MCP Server can be used by any AI Agent / Platform that supports the Model Context Protocol.
- LabVIEW VI Execution β MCP Server executes LabVIEW VIs using a separate lv-bots Executor service.
- Example AI Agent - An Example AI Agent is available to interact over a terminal window. This requires OpenAI API Key in
.env.
-
Supported LabVIEW Version - Supports only 32-bit LabVIEW Versions (>=2023 Q3)
-
Supported Data Types
- Currently, only VIs with the following Input Data Types are supported String, Numeric, Boolean, 1D Arrays, and Simple Clusters (not nested)
- Complex data types such as enums, multi dimensional arrays, arrays of clusters are not yet handled.
-
Manual Metadata Creation
- Metadata
.jsonfiles must be created manually for each VI. - There is no automation yet to generate metadata directly from LabVIEW VIs.
- The JSON must follow the defined schema for the tool generator to work.
- Metadata
-
Chaining of Tools is currently not supported directly, But with prompt engineering limited chaining is possible. For Tool VIs with simple datatypes AI agents are able to understand the output data and construct the inputs to make subsequent tool calls.
Note:
If you just want to try the examples, only the OPENAI_API_KEY is required, No other configuration changes needed in any of the below prerequisite files
-
.envFile- To run example tools, only the
OPENAI_API_KEYconfig is required. - Update the file with the following details.
OPENAI_API_KEYβ Your OpenAI API key. This will be used by the autogen example to create a AI Agent.metadata_dirβ Directory containing JSON metadata files that describes the Tool VIs.lv_executor_server_addressβ Server address for the LabVIEW lv_bots_executor grpc service.lv_version- Specify the LabVIEW version to use for the executor service.
intermediate_tools_dir-optional configβ Output Directory to store generated MCP tool.pyfiles. These intermediate files will be generated only for debugging purposes when using the following scriptg_mcp_server_with_tool_py_generation.py
- To run example tools, only the
-
lv-bots Executor configuration INI
No changes needed if you are just trying examples in this repo- Open the following configuration file
lv_bots_executor_config.ini - Configure
tools_directoryas the Absolute path of the Folder which contains the tool VIs to be used by AI agents. - Configure the server address as well, this should match with the
lv_executor_server_addressin.envfile. 
-
JSON Metadata Files
No changes needed if you are just trying examples in this repo- These are files that explain the available LabVIEW tools in
tool_visfolder. - The example JSON files are stored in the
mcp_tools_metadata/folder. - One JSON file per MCP tool.
- Format of these metadata files are explained in the JSON Metadata Format section.
-
LabVIEW VIs
No changes needed if you are just trying examples in this repo- These are the LabVIEW VIs that AI agents will use as tools.
- Examples are stored in the
mcp_tool_vis/folder. - The VI file name should match the JSON file name.
- To launch the lv-bots, Open and run the
lv_bots_launcher.viwhich will open terminal windows explained in the sectionlv-bots Terminal Windows
- After the VI
lv_bots_launcher.viis run, the Example AI Agent terminal window will allow user to interact with AI agent that can list the tools and run them based on prompts. - In this example: User queries the list of tools available and uses the
add.vitool to perform addition. - Example Tools are at
lv-bots\mcp_tool_visadd.vi- Adds two numbers given as input.calculate_bmi.vi- Calculates BMI for given weight in kg and height in cm.scripting_create_vi.vi- Creates a New VI at the specified file path using the Template VI path given.- The tools folder can be changed to different location by updating the key
tools_directoryin the configuration filelv_bots_executor_config.ini
- Metadata JSON Files that describes the tools are at
C:\lv-bots\mcp_tools_metadata.- The metadata folder can be changed to different location by updating the
metadata_dirkey in.env
- The metadata folder can be changed to different location by updating the
Following are the different terminal windows that will be launched by the VI lv_bots_launcher.vi.
lv-bots MCP Server- This is the MCP server with which AI agents will communicate. This will: - Read all JSON metadata files. - Create MCP tools for each LabVIEW VI and register all tools with the MCP server. - Start the MCP HTTP server. -
lv-bots Example AI Agent- This window will allow you to interact with AI agent that can make use of the Tool VIs. - Query what tools are available. - Ask AI agent to use the tools to perform actions. -
- In case of any error during lv-bots Launch using the
lv_bots_launcher.vi, retry the launcher after closing all files in LabVIEW usingFile --> Close AllorFile --> Quit.
Each LabVIEW VI tool is described by a metadata JSON file.
This metadata enables AI agents (via MCP) to understand the purpose, inputs, and outputs of the VI.
Following are the keys expected in Metadata JSON
- name β The tool/VI name (without extension).
- description β A human-readable explanation of what the VI does.
- inputs_meta β A dictionary where each key is an input parameter name and the value describes:
type: The datatype (e.g.,int,float,string,json,array).description: What the parameter represents.
- outputs_meta β A dictionary describing each output parameter, with the same structure as
inputs_meta.
{
"name": "add",
"description": "Add two integers using LabVIEW VI",
"inputs_meta": {
"a": {
"type": "int",
"description": "First number"
},
"b": {
"type": "int",
"description": "Second number"
}
},
"outputs_meta": {
"sum": {
"type": "int",
"description": "Result of the add"
}
}
}