CL

calmyjane/labview_assistant

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

24 stars 8 forks 质量 30 趋势 0

LabVIEW MCP 服务器

概览

该仓库包含一个LabVIEW助理MCP(模型上下文协议)服务器。 它使像ChatGPT或Claude Desktop这样的大型语言模型能够通过定义的命令控制你电脑上的软件。 要运行它,先安装 uv: https://docs.astral.sh/uv/ 然后安装 Claude Desktop: https://claude.ai/download,然后从这个文件夹打开命令提示符,运行: uv run mcp install main.py 应该需要几秒钟,然后显示已成功将mcp添加到Claude Desktop的提示。 然后重启 Claude(右滑任务图标并选择“退出”),助手应该会出现在你的 Claude 桌面应用中。 MCP服务器包含一套LLM可用不同参数执行的函数(工具)。在该服务器中,工具通过LabVIEW中的DQMH模块的请求与等待回复事件定义。 关于《勇者:怪物》的更多信息请见此处:https://labviewwiki.org/wiki/Delacor_Queued_Message_Handler 每个请求等待回复事件本质上是一个带有输入和输出的子虚拟智能。

概述(AI 翻译)

该仓库包含一个LabVIEW助理MCP(模型上下文协议)服务器。

它使像ChatGPT或Claude Desktop这样的大型语言模型能够通过定义的命令控制你电脑上的软件。

开始:

运行它时,先安装 UV: https://docs.astral.sh/uv/ 然后安装Claude桌面: https://claude.ai/download 然后从这个文件夹打开命令提示符并运行: UV 运行 MCP 安装 main.py

应该需要几秒钟,然后显示已成功将mcp添加到Claude Desktop的提示。

然后重启 Claude(右滑任务图标并选择“退出”),助手应该会出现在你的 Claude 桌面应用中。

工具

MCP服务器包含一套LLM可用不同参数执行的函数(工具)。在该服务器中,工具通过LabVIEW中的DQMH模块的请求与等待回复事件定义。

关于《勇者大冒险》的更多信息请见此处: https://labviewwiki.org/wiki/Delacor_Queued_Message_Handler

每个请求等待回复事件本质上是一个带有输入和输出的SubVI。但它会将请求转发给后台持续运行的VI(服务器模块),该VI执行所需任务,并回复一些值。

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

MCP Server for LabVIEW

This Repo contains a LabVIEW Assistant MCP (Model Context Protocol) Server.

It enables an Large Language Model like ChatGPT or Claude Desktop to control software on your computer through defined commands.

Getting Started:

To run it, fist install uv: https://docs.astral.sh/uv/ Then install claude desktop: https://claude.ai/download Then open command prompt from this folder and run: uv run mcp install main.py

It should take a few seconds and show a message that it successfully added mcp to Claude Desktop.

Then restart claude (rightlick task-icon and select “quit”), and the assistant should show up in your Claude Desktop app.

Tools

The MCP Server contains a set of functions (tools) that the LLM can execute with different parameters. In this Server, the tools are defined by Request-and-wait-for-reply-Events of a DQMH-Module in LabVIEW.

More about DQMH here: https://labviewwiki.org/wiki/Delacor_Queued_Message_Handler

Each Request-and-wait-for-reply-Event is essentially a SubVI with some in- and outputs. But it forwards the Request to a continuously running VI in the background (the server module), which then does the desired task, and replies with some values. When the values arrive back, the model reads them and continues. Each of these SubVIs has a description which will be included in the MCP server code, so the AI can read it. The description includes all information the AI receives about the funciton and should well explain what it does.

There is a VI in the LabVIEW Project called “Generate Python Code.vi”. It can be used to automatically generate the python code for the main.py file. So if anything on the Request VIs in-/outputs or description has changed, or one was created or removed, you can update the server that way. Make sure to run "uv run mcp isntall main.py"and restart Claude Desktop, after you made changes to the Server code.

Currently Available Tools:

start_module

  • Inputs:
  • Outputs: error out,Wait for Event Sync?,Scripting Server Broadcast Events,Module Was Already Running?,Module Name
  • Description: Call this function first if you want to interact with LabVIEW. It will start the labview server that you can use to do actions in LabVIEW. You can use “Stop Module” to stop the server again. Make sure to call thsi function before any other LabVIEW specific functions.

new_vi

  • Inputs:
  • Outputs: error out,result,vi_id
  • Description: Creates a new VI in the LabVIEW IDE. The VI Reference is stored and returned. This Reference can later be used to e.g. add modifications to the VI.

add_object

  • Inputs: object_name, vi_reference
  • Outputs: error out,result,object_id
  • Description: Adds an object to the block diagram or frontpanel of the referenced vi. Get a VI reference from “New VI”. Allowed object names are: .NET Container .NET Refnum 2D Picture 3D Picture Absolute Value Accept TLS Access Rights ActiveX Container Add Add (with error terminals) Add Array Elements Add Entropy
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →