Перейти к основному содержимому
S

dsh-labview-mcp-kit

sevenology7/dsh-labview-mcp-kit

LabVIEW MCP bundle for DeepSeek Harness that mounts the upstream Zuehlke labview-mcp server, provisions its pinned Windows runtime, keeps the 124 tool schemas hidden until labview_tools reveals them, and hands LabVIEW work to the eight upstream role agents as subagents.

Установка

dsh plugin --profile web add github:sevenology7/dsh-labview-mcp-kit

README

dsh-labview-mcp-kit

A DeepSeek Harness bundle that mounts the upstream Zuehlke/labview-mcp server — 130 tools for driving a running LabVIEW instance — through the in-box @deepseek-ai/dsh-mcp-client bridge.

Two things make it more than a JSON snippet:

  • It installs the server. The bridge needs an executable, and the release archive is 62 MB of Windows binaries that has no business living in a plugin package. The bundle downloads the pinned release into the DSH home, checks its SHA-256 before unpacking anything, and tells you which pin produced the tree.
  • It does not ship 130 schemas into every request. Upstream's tools/list is 295 kB, roughly 75k tokens. Every mcp__labview__* tool is hidden until a session reveals it; a core set (status, describe, inspect, open/close) stays visible, and labview_tools reveals the rest by name or keyword.

Requirements

HarnessDeepSeek Harness with @deepseek-ai/dsh-mcp-client (any current profile)
PlatformWindows x64 — the upstream server is a single Windows executable
LabVIEWA LabVIEW installation, with LabVIEW running for the lvai_* tools
NetworkOne download from github.com on first use; afterwards it runs offline

The bundle does not need Node or .NET on PATH: it writes a launcher under the DSH home and starts it with the harness' own executable.

Install

From npm, in DSH's Plugins → Add plugin:

dsh-labview-mcp-kit

Or from a checkout of this repository (E:\dsh-LabVIEW-mcp), through the plugin manager's local-directory install. The package is dsh-labview-mcp-kit and its cordis.patch.yml inserts two rows:

  1. labview-mcp-runtime — this package's host plugin. It writes <DSH home>/labview-mcp/launch.mjs and starts the runtime download when the runtime is missing.
  2. labview-mcp-bridge — @deepseek-ai/dsh-mcp-client, serverName: labview, transport: stdio, command process.execPath with ELECTRON_RUN_AS_NODE=1, argument <DSH home>/labview-mcp/launch.mjs.

The first start downloads and unpacks the release (about 20 s on a normal connection). The bridge retries while that happens and connects on its own; if it has already given up, restart DSH once.

Tools

ToolWhat it does
labview_mcp_statusTruthful report: pin, launcher, executable, installed VERSION.txt, download progress, how many bridged tools the session has, reveal policy, next step.
labview_mcp_installDownloads, verifies and unpacks the pinned release. Idempotent; waitMs bounds the wait (default 60 s) and the download continues in the background. force reinstalls.
labview_toolsReveals bridged capabilities for this session: names for exact tools, query for a keyword, all: true for the whole catalog, no arguments for the recommended set.
labview_agentHands one LabVIEW task to one of the eight upstream role agents (labview-vi-generator, labview-vi-editor, labview-class-generator, labview-caraya-unit-test, labview-lunit-unit-test, labview-vitester-unit-test, labview-doc-generator, labview-dqmh-module) as a real subagent.
labview_mcp_doctorTwelve checks in dependency order — state directory, launcher, runtime, pin, VERSION.txt, provisioning lock, leftovers, download cache, role documents, subagent provider, bridge, real handshake — and one next: action for the first failure. Read-only apart from creating the state directory; probe: false skips starting the server.

Everything else arrives as mcp__labview__<tool> — lvai_status, lvai_describe_vi, lvai_generate_vi, pylv_*, …. Call labview_tools with no arguments to see what is available.

Doctor

/labview-mcp-doctor (and the bundled labview-mcp-doctor skill, and the labview_mcp_doctor tool) run the same twelve checks in dependency order, so the first fail is the cause and the rest are symptoms:

ok    home       C:\\Users\\you\\.dsh\\labview-mcp
ok    launcher   present (4668 bytes)
ok    runtime    ...\runtime\bin\LabVIEWMCP.exe (86 MB)
ok    pin        v3.3.0 sha256 e816d1d2d921… matches runtime.json
warn  cache      interrupted download (2048 KB) — the next install resumes from the archive cache
...
verdict: USABLE with 1 warning — cache

A fail ends with the single action that fixes it, for example next: run labview_mcp_install (or restart DSH and let it provision in the background). The doctor never downloads or repairs anything itself: doctor → read the first failure → labview_mcp_install → doctor again.

Subagents

Upstream ships eight role agents under agents/ (and a client-ready copy under bin/claude/agents/). DSH has no per-file agent directory, so this bundle exposes them through labview_agent: each call starts a normal DSH subagent that composes from your preset and receives the upstream role document verbatim as its task text.

labview_agent(agent: "labview-vi-generator", prompt: "…paths, target folder, .lvproj, the user's words…")

What that means in practice:

  • Nothing appears in the preset picker. No preset-labview-* row is declared; the eight roles exist only as agent values of one tool. A child therefore inherits your session's preset, model route and tool surface — the eight core LabVIEW tools included, the rest one labview_tools call away.
  • The role document must be installed. It is read from <DSH home>/labview-mcp/runtime/bin/claude/agents/<id>.md; a missing document fails with a message naming labview_mcp_install, before any child starts. labview_mcp_status prints agents: N/8 documents present.
  • Pass what the role asks for. The upstream brief's rule still holds: paths, the target folder, the .lvproj, and the user's own words. labview_agent's description carries the per-role pass-what table, and the prompt it builds starts with the upstream tools: allowlist and three DSH rules (never open/close a project or swap subVIs while another agent may hold LabVIEW; end with a NEEDS CLARIFICATION block instead of messaging a sibling; reveal hidden LabVIEW tools first).
  • Continuation is send_message. Upstream says SendMessage(<child>, …); here the child's name comes back in the tool result, and send_message(agent: <name>, …) continues that same child.
  • Allowlists are guidance, not policy. The upstream tools: list is emitted as prose; what a child can actually call is still decided by the reveal gate and by its preset.

Settings page

Settings → LabVIEW MCP. It shows the same twelve checks the doctor prints — in dependency order, with a HEALTHY / USABLE / BROKEN verdict — and lets you pin a model per role.

PartWhat it does
Status cardThe doctor's checks, verbatim, plus a probe checkbox that really starts the server once and a re-check button.
Roles tableOne row per role: its purpose, the model it currently inherits, and two selects (provider, then that provider's models). Save writes the pin, Reset removes it so the role inherits again.
FooterWhere the pins live and how many roles are pinned.

labview_mcp_status reports whether the page's route actually registered (settings page : registered (POST /api/labview/settings), or the reason it did not), because a page that silently never appeared is otherwise impossible to diagnose from the outside.

Pins are stored in <DSH home>/labview-mcp/agents.json and read on every labview_agent call, so a change applies to the next delegation without a restart. A pin is {provider, model} and is rejected unless both are in the live catalog the page loaded; the error names the providers and models that do exist. Leaving a role on (inherit) sends no agentOptions at all, so the child keeps composing from the parent's model.

The page is a browser companion, not a new source of truth: the same state is reported by labview_mcp_status (agent models : N of 8 pinned) and can be inspected in agents.json. Its requests go to POST /api/labview/settings on DSH's authenticated channel; the page never builds a URL itself, which is why it also works when DSH is reached through a tunnel.

Reveal policy

reveal in the patch row's config:

  • core (default) — the eight tools that answer "what is LabVIEW doing" (lvai_status, lvai_labview_state, lvai_describe_vi, lvai_describe_project, lvai_error_list, lvai_vi_terminals, lvai_open_file, lvai_close_vi) are visible immediately.
  • none — every bridged tool is hidden until a labview_tools call.
  • all — no hiding; the full 70k-token catalog is in every request. Use it only if you know you want that.

Hidden tools are enforced twice: the schemas are removed from the model-facing tool list for that session, and a dispatch guard refuses a call that names a hidden tool anyway, pointing at labview_tools.

labview_tools with no arguments reveals a pinned starter set on top of the core eight (lvai_ensure_labview, lvai_palette_index, lvai_example_index, lvai_exec_state, lvai_convert_vi_to_aixml, lvai_convert_aixml_to_vi, lvai_validate_aixml, lvai_generate_vi) — pinned rather than derived so the same call reveals the same tools after an upstream release. Names the bridge does not have are ignored, and the answer says how many stayed hidden.

Configuration

KeyDefaultMeaning
revealcorecore, none, or all — see above.
autoProvisiontrueInstall the runtime at start when it is missing.
runtimeZip—Path to a local release archive instead of downloading one.
runtimeUrlthe pinned GitHub releaseDownload URL override.
runtimeSha256the pinned digestExpected digest for runtimeUrl/runtimeZip.

An overridden digest is verified exactly like the pinned one; nothing is unpacked on a mismatch.

Trust and failure behaviour

  • The archive is only unpacked after its sha256 matches the pin (or the digest you pass). A mismatch deletes a downloaded archive and leaves a runtimeZip you supplied untouched.
  • A tree counts as runnable only when bin/LabVIEWMCP.exe is at least 1 MiB, so a half-written or truncated install never reads as ready.
  • The swap is a rename: the old tree moves aside first and is restored if the new one cannot be moved in, so a running server fails the install instead of leaving an empty runtime behind. Leftover runtime.old-* directories are pruned by the next install.
  • One DSH window installs at a time (provision.lock, stale after 20 minutes); a second window reports that the other one is already installing.
  • tar.exe runs with a 10-minute cap, so a hung extraction releases labview_mcp_install instead of wedging it until restart.
  • The generated shim stops its server when its stdin closes: the bridge's teardown cannot deliver a signal on Windows, and an orphaned server would hold the runtime directory against the next install.

What lands in the DSH home

~/.dsh/labview-mcp/
├── launch.mjs        generated stdio shim (rewritten on every start)
├── runtime.json      { exe, args, cwd, pin, installedAt } read by the shim
├── provision.lock    held while one window installs the runtime
├── downloads/        the release archive, reused while its digest matches
├── staging/          extraction scratch space, removed afterwards
└── runtime/          the unpacked release: bin/, docs/, VERSION.txt

Nothing is written into the profile's node_modules, and two profiles share one runtime.

Verifying an install

  1. labview_mcp_status — runtime says installed, bridged tools is non-zero.
  2. labview_tools with no arguments — lists the core set.
  3. Ask for lvai_status — it reports the LabVIEW MCP version, the AI add-on fingerprint and labviewInUse.
  4. With LabVIEW closed, lvai_status still answers and reports the missing application; lvai_* authoring tools then explain what to open.

Troubleshooting

SymptomCause and fix
bridged tools: none registered yetThe bridge has not connected. labview_mcp_status shows whether the executable exists; if it does, restart DSH once.
Launcher exits with [...] the LabVIEW MCP runtime is not installedProvisioning has not finished. Call labview_mcp_install, or check that the download is not blocked by a proxy.
sha256 mismatch in labview_mcp_installThe downloaded bytes are not the pinned release (proxy, truncated file, changed pin). Delete the archive in downloads/ and retry, or pass a verified local runtimeZip.
lvai_status says the add-on is missingInstall the LabVIEW AI add-on that ships with the release (bin/scripts), then restart LabVIEW.
Tools disappear after a whileThe session's reveal state is per agent: a new session starts from the configured policy.

Layout of this package

package.json          dsh.bundle.patch, exports, files
cordis.patch.yml      the two rows the harness loads
lib/index.js          host plugin: tools, doctor surfaces, reveal gate, provisioning kick-off
lib/agents.js         the eight role agents, their documents and prompt envelope
lib/doctor.js         the twelve checks, the probe and the report
lib/settings.js       the settings route, the pin store and the model catalog
lib/home.js           DSH home resolution, shared with the patch expression
lib/runtime.js        pin, download, digest check, extraction
lib/launcher.js       launcher + runtime.json writer
lib/download.js       redirect-following download with a digest
lib/launch-template.mjs  the stdio shim that gets copied into the DSH home
ui/                   the browser half: client.js (settings page) + its own package.json
skills/labview-mcp-doctor/SKILL.md  the model-facing doctor skill
locale/{en,zh}.json   plugin-page title and description
LICENSE               MIT, plus the note that the runtime is upstream's
README.zh.md          Chinese README
CHANGELOG.md          release notes
docs/DETAIL.md        the one-image detail page (DETAIL.zh.md for Chinese)
docs/releasing.md     the release path: gates, tag, trusted publishing
scripts/verify-runtime.mjs  provision + handshake check for one DSH home
.github/workflows/publish.yml  CI: verify on Windows, publish on a v* tag
test/                 node --test suites for the patch, the runtime, the shim, the plugin, its lifecycle, the eight role agents, the doctor, the settings store and the page

Run npm test (or node --test "test/**/*.test.mjs") — no network, no DSH and no LabVIEW needed.

To check one install end to end (provision, start the launcher, speak MCP, call lvai_status):

node scripts/verify-runtime.mjs                                  # the real DSH home
node scripts/verify-runtime.mjs --home .tmp/home --zip release.zip
node scripts/verify-runtime.mjs --url https://…/labview-mcp.zip --sha256 <hex>

Releasing

1.0.0 was published by hand; every later version is published by .github/workflows/publish.yml when a v* tag is pushed:

npm version patch --no-git-tag-version   # and bump ui/package.json to match
$EDITOR CHANGELOG.md
npm test && npm pack --dry-run
git commit -am "release: 1.1.2" && git push origin main
git tag v1.1.2 && git push origin v1.1.2

The workflow verifies on Windows (where this bundle actually runs), refuses a tag that disagrees with package.json, publishes with --provenance through npm Trusted Publishing (no token in the repository), and opens a GitHub release. The one-time binding is npm trust github dsh-labview-mcp-kit --file publish.yml --repo SeveNOlogy7/dsh-labview-mcp-kit --allow-publish; a new binding must complete its first publish within two days. Full path, including the token alternative: docs/releasing.md.

Credits

Upstream server: Zuehlke/labview-mcp, MIT. The installer/bridge arrangement follows dsh-windows-mcp, the MCP bundle that ships with DeepSeek Harness.

Compared with the ZCode marketplace package

SeveNOlogy7/labview-mcp-zcode ships the same upstream release to ZCode: a .mcp.json that runs bin/launch.cmd (a copy /b reassembly of a binary split at ZCode's 50 MB archive limit), plus a PreToolUse hook that allows only read-only tools. This bundle keeps the parts that still apply and replaces the rest:

ZCode packageHere
.mcp.json with powershell -Command & cmd /c launch.cmdcordis.patch.yml row the DSH loader understands
50 MB split binary, reassembled on first runpinned release downloaded once into the DSH home, sha256 verified
PreToolUse allow-list of read-only toolsreveal gate in the host plugin (schemas hidden, dispatch vetoed)
no provisioning, no runtime statelabview_mcp_install + labview_mcp_status

Похожие плагины