Skip to content

Keep the server answering when a streamed call or a tool VI raises an error - #53

Open
JanGoebelsBot wants to merge 6 commits into
mainfrom
fix-streamed-call-error-dialog
Open

JanGoebelsBot wants to merge 6 commits into
mainfrom
fix-streamed-call-error-dialog

Conversation

@JanGoebelsBot

@JanGoebelsBot JanGoebelsBot commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

A failing streamed tools/call (with _meta.progressToken and Accept: text/event-stream) froze the whole server: LabVIEW's modal automatic error handling dialog opened in the background clone that answers the stream, the call never returned, and because requests are handled one at a time every later request — even GET — timed out until someone pressed Continue in the IDE. The same happens to a user's tool or prompt VI that leaves an error output unwired with automatic error handling on (LabVIEW's default for new VIs). This turns automatic error handling off in the toolkit's VIs and, in memory, for every tool and prompt VI and its subVIs before it runs.

Before After
streamed tools/call of an unknown tool empty SSE stream, server stops answering data: event with error -32602 and the request id
streamed tools/call with an argument of the wrong type empty SSE stream, server stops answering data: event with the result, isError: true
tool VI with automatic error handling on and an unwired error modal dialog, server stops answering (plain and streamed) call answered, server keeps answering
the same in a subVI of the tool VI modal dialog, server stops answering call answered, server keeps answering

Found while checking the toolkit against MCP 2026-07-28 with the official suite @modelcontextprotocol/conformance (0.2.0-alpha.12): from its tools-call-with-progress scenario on, every scenario timed out. This is the first of a series of pull requests for 2026-07-28; the next ones build on this branch.

Changes

  • 98 toolkit VIs in src/MCP Server/ — VI setting Automatic Error Handling switched off. No diagram changed. Saved from inside LabVIEW MCP Server SDK.lvproj, still LabVIEW 20.0, source only. LabVIEW also refreshed the stored copies of linked typedefs and subVI link records in many of them (the file sizes grow; checked: no compiled code, 20.0).
  • Disable Automatic Error Handling.vi — new, private (Private/SubVIs). Reads the setting of the VI it is given and writes FALSE when it is TRUE, in memory only; never saves. It does the same for the VI's callees, level by level and each VI once (Callees' Names); VIs under vi.lib, locked or password-protected VIs and VIs that cannot be read are left alone and not walked into. Errors of the read and write are discarded (in a built application the write is refused with 1073). Measured in LabVIEW 2026: about 0.3 ms per call for one subVI, 3 ms for a hierarchy of 220 VIs; the first call after loading takes longer.
  • Reinitialize VI Inputs.vi — modified. Runs Disable Automatic Error Handling.vi before resetting the inputs. tool call.vi and prompts get.vi call it right before every tool and prompt VI runs, so both are covered.
  • MCP Server.lvlib — the new VI added to Private/SubVIs.
  • tools/test/Test-McpServer.ps1 — two new required checks: an unknown tool called with a progressToken is answered with an error carrying the request id (on the stream or as JSON), and the server still answers tools/list afterwards.
  • Tests — test streamed tool error.vi (Test 64), test tool automatic error handling.vi (Test 65), fixture fake tool unwired error.vi and its subVI fake unwired error subvi.vi (both saved with automatic error handling on, on purpose) and Add Fixture Unwired Error Tool.vi; both tests wired into Test_MCP_Server.vi.
  • docs/technical-details.md — says that the server switches the setting off before a tool or prompt VI runs, that the VI may then show as modified in the IDE, and to wire error outputs in tool VIs anyway (built applications cannot change the setting at run time).

Code summary

Orange numbered boxes match the numbered points. Click a picture for full size. Every changed spot and every case frame is in the detailed VI diff report.

VI Status Change in one line
Reinitialize VI Inputs.vi modified switches off the tool or prompt VI's automatic error handling before resetting its inputs
Disable Automatic Error Handling.vi added reads the setting and writes FALSE only when it is TRUE, in memory
98 toolkit VIs (Add Tool.vi, tool call.vi, Mark Tool Error Result.vi, …) modified VI setting Automatic Error Handling off; no diagram change
Tests 64, 65, fake tool unwired error.vi, Add Fixture Unwired Error Tool.vi, Test_MCP_Server.vi added / modified regression tests and their fixture

Reinitialize VI Inputs.vi — modified

Runs right before every tool and prompt VI is called (tool call.vi, prompts get.vi); it now first makes sure that VI cannot open LabVIEW's error dialog.

  1. New: Disable Automatic Error Handling.vi gets the tool or prompt VI first. error in runs through it, so with an incoming error nothing is changed.
  2. The reset of all inputs to their defaults, unchanged, now on the refnum the new subVI passes through.

Disable Automatic Error Handling.vi — added

Switches LabVIEW's automatic error handling off in memory, for the given VI and for every VI below it; never saves. The "Error" frame of the outer case, the "Already off" frame and the frame that skips a VI do nothing (all in the detailed report).

  1. The tool or prompt VI itself: reads Automatic Error Handling and writes FALSE only when it was TRUE, so a VI that already has it off is not marked as modified in the IDE. Errors of the read and the write are discarded (a built application refuses the write with 1073), and that must not stop the tool call.
  2. New: its callees (Callees' Names) are the start of a walk through everything below it; with no subVIs the walk is skipped.

The walk (inner case, "False" frame: there are subVIs):

  1. New: one VI per iteration from a queue of VIs still to visit: its path, its setting and its lock state.
  2. New: only a VI outside �i.lib that is not locked or password-protected (and could be read) is handled; any other VI is skipped together with everything below it.
  3. New: the setting is switched off the same way as for the tool VI (only when on), and the VI's own callees are read.
  4. New: only callees not seen yet go into the queue, so each VI is visited once, even in a large hierarchy (3 ms for 220 VIs in LabVIEW 2026).

Test VIs

  • test streamed tool error.vi (Test 64): unknown tool and wrong argument type, streamed, legacy and modern era; the last event carries the answer with the request id; tools/list answers afterwards.
  • test tool automatic error handling.vi (Test 65): fake_tool_unwired_error called plainly and streamed. Before each half it switches automatic error handling on in memory for the fixture tool and its subVI; after each call it asserts that both are off again, that the call was answered and that the server keeps answering.
  • fake tool unwired error.vi, fake unwired error subvi.vi (unwired JSON parse error), Add Fixture Unwired Error Tool.vi: the fixture tool, its subVI and its registration; Test_MCP_Server.vi registers it and calls the two tests after Test 63.

Verified

  • Caraya suite on 5f3b2e4, LabVIEW 2026 64-bit (LabVIEW CLI): 66 of 66 tests, 243 assertions, 0 failures.
  • Test 65 fails without the subVI fix: with the Disable Automatic Error Handling.vi before c7f2efc its subVI assertions fail; with no switching at all its four new assertions fail.
  • Caraya suite on the earlier tip b46baf2, LabVIEW 2020 64-bit (LabVIEW CLI): 66 of 66 tests passed.
  • Protocol tests (Run_Protocol_Tests_CLI.vi), LabVIEW 2020: 26 of 26 required checks passed.
  • Caraya suite, interactive LabVIEW 2026 64-bit (warm run): 66 of 66 passed.
  • The new tester checks fail without the fix: Datalogger example of main started with tools/ci/Start VI.vi in LabVIEW 2026 → Test-McpServer.ps1: both new checks FAIL, the server stops answering, 18 of 24 required checks. Same example on this branch: 26 of 26, twice.
  • By hand, LabVIEW 2026, Datalogger example: streamed unknown tool, streamed wrong argument type, legacy streamed unknown tool — all answered on the stream, server answering afterwards. Before the fix each of them hung the server; the blocking dialog was "Error 402841 occurred at JSONtext.lvlib:Get all Object Items.vi" (automatic error handling of Mark Tool Error Result.vi).
  • By hand, a scratch tool VI with automatic error handling on and an unwired JSON parse error, run with the Run VI method as Call VI.vi does: modal dialog, LabVIEW blocked. Same VI after writing the setting FALSE in memory first: runs and returns, no dialog.
  • Official conformance suite (npx @modelcontextprotocol/conformance@0.2.0-alpha.12 server --requirements 2026-07-28) against the Datalogger example: before, every scenario from tools-call-with-progress on timed out; after, the server answers all of them (91 checks pass; the remaining failures are 2026-07-28 gaps and fixture tools the follow-up pull requests address).

Not verified

  • The dialog itself is not reproduced inside the Caraya suite. Run through LabVIEW CLI (as CI does), LabVIEW does not open the automatic error handling dialog inside that call hierarchy, so Test 64 also passes against main. Test 65 therefore checks the setting itself (above). The check that shows the freeze is the protocol tester against a server started on its own (above) — which is how Test-InstalledPackage.ps1 tests the installed examples.
  • The protocol tests and the by-hand checks above were run on the earlier tip b46baf2, not again on 5f3b2e4.
  • Not run in a built application (exe); there the in-memory switch is refused with error 1073 and discarded, so tool VIs in an exe still need their error outputs wired (documented).
  • Not run in LabVIEW 2021–2025.
  • The first Caraya run right after a LabVIEW 2026 start can time out from about Test 45 on while LabVIEW compiles the 20.0 source; the second run passes. Seen on main too, not caused by this change.

Known rough edges

  • Reinitialize VI Inputs.vi was regenerated (three nodes, generated diagram); its layout is LabVIEW's.
  • Tests 64 and 65 have wide diagrams (long JSON request constants), auto-arranged.
  • In the IDE a user's tool VI whose automatic error handling was on shows as modified after its first call (LabVIEW asks to save it on close).

Maintainer steps

  • The self-hosted runner for this repository (C:\actions-runner) is configured but not running, so the pull request workflow has not run; the review report comment was produced locally.

🤖 Generated with Claude Code

JanGoebelsBot and others added 4 commits November 25, 2026 05:49
98 of the toolkit's VIs had LabVIEW's automatic error handling enabled.
Many of them leave error outputs unwired on purpose and clear errors
later. Where such a VI ran in the background clone that answers a
streamed tools/call (Run Streamed Request.vi, started with the Run VI
method), an error on an unwired output opened LabVIEW's modal "Error
occurred" dialog. The call then never returned and kept the request
context, which serialises all requests, so the whole server stopped
answering until someone pressed Continue in the LabVIEW IDE.

Any streamed tools/call that failed triggered it: an unknown tool, an
argument of the wrong type, in both protocol eras. The client saw an
empty event stream, and every later request, including GET, timed out.

Only the VI setting changes; no diagram is touched. The VIs were saved
from inside LabVIEW MCP Server SDK.lvproj and are still LabVIEW 20.0,
source only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tool and prompt VIs are run with the Run VI method. A VI that has
LabVIEW's automatic error handling enabled, which is LabVIEW's default
for new VIs, opened the modal "Error occurred" dialog when an error
appeared on an output it left unwired. The call never returned and the
server stopped answering every request until someone pressed Continue in
the IDE. This happened for plain and streamed calls alike.

New private VI Disable Automatic Error Handling.vi reads the setting of
the VI it is given and writes FALSE when it is TRUE, in memory only; the
VI is not saved. Reinitialize VI Inputs.vi, which tool call.vi and
prompts get.vi run right before every call, now calls it first.

In the IDE a tool VI whose setting was on shows as modified afterwards.
In a built application the setting cannot be changed at run time
(error 1073); that error is discarded, and technical-details.md now asks
to wire the error outputs of tool VIs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Test 64 sends tools/call requests that fail while they are streamed (an
unknown tool, and fake_tool_add with an argument of the wrong type, in
both eras) and checks that the last event on the stream is the JSON-RPC
answer with the request id, and that the server answers the next
request.

Test 65 calls the new fixture tool fake_tool_unwired_error, which has
automatic error handling enabled and leaves the error of a JSON parse
unwired, plainly and streamed, and checks that both calls are answered
and the server keeps answering. Add Fixture Unwired Error Tool.vi
registers it in Test_MCP_Server.vi.

Inside the suite, which LabVIEW CLI runs, LabVIEW does not open the
automatic error handling dialog, so both tests also pass against the
old toolkit; they guard the answers on the stream. The check that fails
without the fix is in the protocol tester (next commit), run against a
server started on its own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Test-McpServer.ps1 now also calls an unknown tool with a progressToken,
which a server may answer as an SSE stream, and checks that the answer
is an error with the request id and that the server answers tools/list
afterwards.

Against the Datalogger example started with Start VI.vi, the old
toolkit fails both checks: the stream stays empty and the server stops
answering, because LabVIEW's automatic error handling dialog blocks the
streamed call. This is the same way Test-InstalledPackage.ps1 runs the
installed examples, so the package test now catches this.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JanGoebelsBot

JanGoebelsBot commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator Author

Tests

✅ All 66 tests passed (243 assertions, 0 failures; LabVIEW CLI, LabVIEW 2026 64-bit).

Per-test results
Test VI Result Checks
Test 1: Initialize Test Initialize.vi ✅ pass Assert True: pass
Test 2: Initialized Test Initialized.vi ✅ pass Assert True: pass
Test 3: tools/list Test tools list.vi ✅ pass Assert True: pass
Test 4: prompts/list test prompts list.vi ✅ pass Assert True: pass
Test 5: resources/list test resources list.vi ✅ pass Assert True: pass
Test 6: tools call test tools call.vi ✅ pass Assert True: pass
Test 7: empty JSON object is an invalid request test empty msg.vi ✅ pass Assert True: pass
Test 8: call broken tool test broken tool.vi ✅ pass Assert True: pass
Test 6: tools call test tools call array.vi ✅ pass Assert True: pass
Test 9: GET is rejected with 405 test http get rejected.vi ✅ pass GET -> 405 with Allow: POST and error -32600: pass
Test 10: Origin validation test http origin.vi ✅ pass Origin http://evil.example -> 403 with error -32600: pass
Origin http://localhost:6274 -> 200 with result: pass
Test 11: MCP-Protocol-Version validation test http protocol version.vi ✅ pass MCP-Protocol-Version 1999-01-01 -> 400 with error -32022 (Unsupported protocol version, the MCP 2026-07-28 code in both eras): pass
MCP-Protocol-Version 2025-06-18 -> 200 with result: pass
Test 12: notification answered with 202 test notification accepted.vi ✅ pass notifications/initialized -> 202 with empty body: pass
Test 13: request with id answered with 200 test request status.vi ✅ pass tools/list with id 1 -> 200 with result and id 1: pass
Test 14: unknown method test unknown method.vi ✅ pass does/not/exist with id 5 -> 200 with error -32601 and id 5: pass
Test 15: unknown notification test unknown notification.vi ✅ pass notifications/cancelled -> 202 with empty body: pass
Test 16: ping test ping.vi ✅ pass ping with id 3 -> 200 with result {} and id 3: pass
Test 17: string request id test string id.vi ✅ pass tools/list with id "abc-1" -> 200 with result and id "abc-1": pass
Test 18: unknown prompt test unknown prompt.vi ✅ pass prompts/get no-such-prompt with id 7 -> JSON-RPC error -32602 with id 7, no status/source: pass
Test 19: unknown resource test unknown resource.vi ✅ pass resources/read of an unknown uri with id 8 -> JSON-RPC error -32002 with id 8, no status/source: pass
Test 20: resources/read returns UTF-8 text unchanged test resource text utf8.vi ✅ pass text of labview://fixture_utf8 decodes to the bytes of fixture_utf8.txt: pass
Test 21: resources/read returns a binary file as Base64 test resource blob.vi ✅ pass blob of labview://fixture_binary is the Base64 of the bytes of fixture_binary.png: pass
Test 22: unknown tool test unknown tool.vi ✅ pass tools/call no_such_tool -> error -32602 with message Unknown tool: no_such_tool and id 22: pass
Test 23: tools/call with arguments that are not an object test tool call without arguments.vi ✅ pass tools/call fake_tool_add with arguments 5 -> error -32602 with message Invalid arguments... and id 23: pass
Test 24: broken tool is a tool execution error test broken tool message.vi ✅ pass tools/call fake_tool_broken_vi -> result with isError true and a text that says not executable: pass
Test 25: prompts/get without arguments test prompt without arguments.vi ✅ pass prompts/get fake_prompt_concatanate_strings without arguments -> result with messages: pass
Test 26: request without method test request without method.vi ✅ pass a message with id 26 and no method -> error -32600 with id 26: pass
Test 27: malformed JSON test malformed json.vi ✅ pass truncated JSON -> error -32700 with id null: pass
Test 28: array inputs say what their items are test tools list array items.vi ✅ pass fake_tool_arrays - intarray has items of type integer and stringarray of type string: pass
Test 29: protocol version negotiation test protocol version negotiation.vi ✅ pass initialize asking for 2024-11-05 -> protocolVersion 2024-11-05: pass
initialize asking for 1999-01-01 -> protocolVersion 2025-11-25 (the newest legacy version): pass
Test 30: resources/templates/list test resource templates list.vi ✅ pass resources/templates/list -> result with resourceTemplates []: pass
Test 31: tools/call without arguments test tool call default arguments.vi ✅ pass tools/call fake_tool_add without arguments -> result with the sum 0, no error, id 31: pass
Test 32: a tool that returns an error sets isError test tool error result.vi ✅ pass fake_tool_return_error with status true -> result with isError true, code and source still in the content: pass
fake_tool_return_error with status false -> result without isError: pass
Test 33: internal errors show no LabVIEW internals test internal error message.vi ✅ pass prompts/get fake_prompt_broken_vi -> error -32603 with a message without call chain, markup, tags or path: pass
Test 34: prompts/list says which arguments are required test prompts list required.vi ✅ pass fake_prompt_required_argument - topic has required true and style has required false: pass
Test 35: prompts/get checks required arguments test prompt required argument.vi ✅ pass prompts/get fake_prompt_required_argument without topic -> error -32602 that names topic, id 36: pass
prompts/get fake_prompt_required_argument with topic -> result whose text contains both argument values: pass
Test 36: JSON-RPC batch test batch.vi ✅ pass batch of ping (id 38), a notification and tools/list (id b) -> 200 with an array of two answers in that order: pass
batch of two notifications -> 202 with empty body: pass
empty batch -> error -32600 with id null: pass
Test 37: a JSON value that is not an object test non object message.vi ✅ pass body 5 -> error -32600 with id null: pass
body "text" -> error -32600 with id null: pass
body null -> error -32600 with id null: pass
Test 38: tools/call checks required arguments test tool required arguments.vi ✅ pass tools/call fake_tool_required_input without arguments -> result with isError true and the text Missing required argument(s): b, a (the order of inputSchema.required), no JSON-RPC error, id 40: pass
tools/call fake_tool_required_input with arguments {} -> result with isError true naming b and a, no JSON-RPC error, id 41: pass
tools/call fake_tool_required_input with only a -> result with isError true naming only b, no JSON-RPC error, id 42: pass
tools/call fake_tool_required_input with a 2 and b 3 -> result 6, no error, id 43: pass
Test 39: initialize with an unknown protocol version test protocol version fallback.vi ✅ pass initialize asking for 1999-01-01 -> protocolVersion is the first entry of Supported Protocol Versions.vi: pass
Test 40: initialize reports the LabVIEW version test labview version.vi ✅ pass initialize -> serverInfo.additionalDetails.labviewVersion equals the Version Number of this LabVIEW: pass
Test 41: tools/list shows the MCP names of special labels test tools list mcp names.vi ✅ pass tools/list fake_tool_special_labels -> Length (mm) and Factor #1 & 50% are listed as length__mm_ and factor__1___50_ in properties and in required, id 44: pass
tools/list fake_tool_special_labels -> every name in properties and required matches ^[a-zA-Z0-9_-]{1,64}$: pass
Test 42: tools/call reaches special labels by their MCP names test tools call mcp names.vi ✅ pass tools/call fake_tool_special_labels with length__mm_ 2.5 and factor__1___50_ 4 -> result {"result__mm_":10}, no error, id 45: pass
Test 43: Add Tool refuses inputs whose MCP names clash test add tool name clash.vi ✅ pass Add Tool fake tool name clash.vi with the inputs a b and a_b -> error 5010 naming both controls and the MCP name a_b: pass
tools/list after the refused Add Tool -> fake_tool_name_clash is not listed, id 46: pass
Test 44: Add Prompt refuses arguments whose MCP names clash test add prompt name clash.vi ✅ pass Add Prompt fake prompt name clash.vi with the arguments a b and a_b -> error 5010 naming both controls and the MCP name a_b: pass
prompts/list after the refused Add Prompt -> fake_prompt_name_clash is not listed, id 47: pass
Test 45: 3D arrays and arrays of paths, enums and clusters say what their items are test tools list array shapes.vi ✅ pass fake_tool_array_shapes - patharray (1D array of paths) has items with a non-empty type: pass
fake_tool_array_shapes - clusterarray (1D array of clusters) has items with a non-empty type: pass
fake_tool_array_shapes - array3d (3D array of DBL) has items.type array, items.items.type array and items.items.items.type number: pass
fake_tool_array_shapes - enumarray (1D array of a U16 enum) has items with a non-empty type: pass
Test 46: timestamps, clusters and types without a JSON type are described in tools/list test tools list schema details.vi ✅ pass fake_tool_schema_shapes - timestamp is a string with format date-time: pass
fake_tool_schema_shapes - variants (array of a type without JSON type) has items {}: pass
fake_tool_schema_shapes - mode (U16 enum) is a string with enum [slow, fast]: pass
fake_tool_schema_shapes - matrix (2D array of I32) has items of type array with items of type integer: pass
fake_tool_schema_shapes - settings (cluster) has properties, also of its inner cluster and of its array of clusters: pass
fake_tool_array_shapes - clusterarray items and cluster with array have properties with types: pass
fake_tool_array_shapes - timestamparray has items of type string with format date-time: pass
Test 47: tools/call converts timestamps, clusters, enums and 2D and 3D arrays test tools call schema shapes.vi ✅ pass fake_tool_schema_shapes - matrix [[1,2],[3,4]] (2D array) arrives unchanged: pass
fake_tool_schema_shapes - settings (cluster with cluster, timestamp and array of clusters) arrives unchanged: pass
fake_tool_schema_shapes - mode fast (enum by item name) and variants [1,"x"] (2 elements) arrive: pass
fake_tool_schema_shapes with timestamp 2026-10-17T12:34:56Z -> no isError, time out 2026-10-17T12:34:56.000Z: pass
fake_tool_array_shapes with a 3D array [[[1,2],[3,4]],[[5,6],[7,8]]] -> no isError, the tool gets all 8 elements: pass
Test 48: every array schema in tools/list says what its items are test tools list every array has items.vi ✅ pass tools/list of the test server - 21 array schemas found, 0 of them without items (expected: at least one, none without): pass
Test 49: tools/list gives element descriptions, integer ranges, data entry limits, units and defaults test tools list descriptions defaults ranges.vi ✅ pass fake_tool_schema_shapes - the integer items of matrix (2D array of I32) have minimum -2147483648: pass
fake_tool_schema_details - mode (enum, default fast) has the default "fast": pass
fake_tool_schema_details - level (U8, default 7) has minimum 0, maximum 255 and default 7: pass
fake_tool_schema_details - setpoint (DBL, data entry limits 0 to 100 coerced, default 25) has minimum 0, maximum 100 and default 25: pass
fake_tool_schema_details - voltage (unit V) has the description "Supply voltage. Unit: V.": pass
fake_tool_schema_details - gain (no element description) has a type but no description: pass
fake_tool_schema_details - count (required) has no default and has minimum -2147483648: pass
fake_tool_schema_details - config elements have their descriptions (offset, name, and enabled inside the array of clusters) and offset (I16) has minimum -32768: pass
Test 50: tools/call returns structuredContent without picture outputs, and none on isError results test tools call structured content.vi ✅ pass tools/call fake_tool_return_error with status false (id 502) -> structuredContent carries the error cluster output as an ordinary object: pass
fake_tool_picture_outputs - structuredContent holds exactly the non-picture outputs count, label, mode and time, while the text still has the picture placeholder: pass
tools/call fake_tool_return_error with status true (id 501) -> isError true and no structuredContent: pass
tools/call fake_tool_picture_outputs (id 50) -> structuredContent is present and equals the text JSON without its picture placeholder: pass
tools/call fake_tool_required_input without arguments (id 503) -> isError true and no structuredContent: pass
fake_tool_picture_outputs - the picture is still returned as an image item of content, and the result is not an error: pass
Test 51: tools/list gives an outputSchema that matches structuredContent test tools list output schema.vi ✅ pass tools/list fake_tool_no_inputs_outputs (no outputs) -> no outputSchema: pass
fake_tool_picture_outputs - time (timestamp) is a string with format date-time and mode (enum) has enum ["slow","fast"]: pass
tools/list fake_tool_picture_outputs -> outputSchema is an object schema whose properties and required are count, label, mode and time: pass
fake_tool_picture_outputs - the outputSchema property names are the names in structuredContent of tools/call (id 511), and the picture output is left out: pass
fake_tool_picture_outputs - count is an integer with the description of its indicator, label is a string, and no output property has a default: pass
Test 52: tools/list sends title and annotations only when they are set test tools list title annotations.vi ✅ pass tools/list fake_tool_add (registered without title and annotations) -> neither title nor annotations: pass
tools/list fake_tool_annotated (registered with a title) -> title "Annotated Fixture Tool": pass
fake_tool_annotated (readOnlyHint true, destructiveHint false, the others not set) -> annotations with exactly readOnlyHint true and destructiveHint false: pass
Test 53: modern results carry resultType, cache hints and serverInfo; legacy results do not test modern tools list.vi ✅ pass modern tools/list -> _meta io.modelcontextprotocol/serverInfo with name and version: pass
modern tools/list (id 53, MCP 2026-07-28 headers and _meta) -> 200 with tools, resultType complete, ttlMs 60000 and cacheScope public: pass
legacy tools/list (id 531, no _meta) -> tools without resultType, ttlMs, cacheScope or _meta: pass
Test 54: server/discover, and initialize never negotiates 2026-07-28 test server discover.vi ✅ pass initialize asking for 2026-07-28 (id 541) -> the newest legacy version 2025-11-25, never 2026-07-28: pass
server/discover (id 54) -> 200, resultType complete, supportedVersions with 2026-07-28 and 2025-11-25: pass
server/discover -> capabilities tools, prompts and resources (as initialize), _meta serverInfo, ttlMs 60000, cacheScope public: pass
initialize asking for 2025-11-25 (id 542) -> 2025-11-25: pass
Test 55: modern requests are refused when their headers do not match the body test modern headers.vi ✅ pass tools/call without an Mcp-Name header (id 551) -> 400 with error -32020: pass
Mcp-Method prompts/list on a tools/list request (id 55) -> 400 with error -32020: pass
tools/call with Mcp-Name =?base64?...?= of fake_tool_add, lower-case header names (id 552) -> 200 with the tool result: pass
tools/call with an Mcp-Name that is not params.name (id 554) -> 400 with error -32020: pass
MCP-Protocol-Version 2025-11-25 while _meta says 2026-07-28 (id 553) -> 400 with error -32020: pass
Test 56: unsupported versions, missing capabilities and unknown methods in the modern era test modern errors.vi ✅ pass modern request with the unknown method foo/bar (id 563) -> 404 with error -32601: pass
modern ping (id 564), which MCP 2026-07-28 removed -> 404 with error -32601: pass
unknown version 2027-01-01 in header and _meta (id 56) -> 400, error -32022, data.supported with 2026-07-28, data.requested 2027-01-01: pass
modern resources/read of an unknown uri (id 565) -> error -32602 (legacy keeps -32002): pass
modern request with the legacy version 2025-11-25 in _meta (id 561) -> 400, error -32022, data.supported with 2025-11-25: pass
modern request without io.modelcontextprotocol/clientCapabilities (id 562) -> 400 with error -32602: pass
Test 57: elicitation by input_required and retry with inputResponses test elicitation.vi ✅ pass retry with inputResponses confirm_action decline (id 572) -> outcome declined: pass
retry with inputResponses confirm_action accept (id 571) -> complete result with outcome confirmed: pass
modern tools/call of fake_tool_confirm with the elicitation capability (id 57) -> resultType input_required with inputRequests.confirm_action: pass
legacy tools/call (id 574) -> outcome not supported: pass
modern tools/call without the elicitation capability (id 573) -> outcome not supported, no input_required: pass
Test 58: progress notifications as Server-Sent Events for tools/call test progress notifications.vi ✅ pass legacy tools/call with progressToken "t58" and Accept text/event-stream (id 581) -> HTTP 200, text/event-stream: pass
id 581: the JSON-RPC result is the last data event, after progress 10: pass
the tool finished all 10 steps (fixture record): pass
modern tools/call with the numeric progressToken 583 (id 583) -> text/event-stream, 10 events with "progressToken":583 in order, then the complete result: pass
the same call without progressToken (id 582) -> plain application/json, no progress events: pass
id 581: exactly 10 notifications/progress events, each with progressToken "t58" and total 10, progress 1..10 in increasing order: pass
Test 59: closing the stream cancels a streamed tools/call test progress cancel by close.vi ✅ pass modern streamed tools/call over raw TCP (id 591) -> text/event-stream, the first progress event arrives: pass
after the client closed the connection the tool stopped early (fewer than 10 steps) and saw cancelled? TRUE: pass
Test 60: legacy notifications/cancelled stops a streamed tools/call test progress legacy cancel.vi ✅ pass legacy streamed tools/call over raw TCP (id 601) -> text/event-stream, the first progress event arrives: pass
the stream ended without a result for id 601: pass
the tool stopped early (fewer than 10 steps) and saw cancelled? TRUE: pass
notifications/cancelled for id 601 on a second connection -> HTTP 202 within 1 s, while the call runs: pass
Test 61: a client that is not in Allowed clients gets 403 test access allowed clients.vi ✅ pass tools/list from this computer to a server that allows only 192.0.2.1 -> HTTP 403, application/json: pass
the 403 body is the JSON-RPC error -32600 "Forbidden: client not allowed." with id null: pass
the second server (port 37061, Allowed clients = [192.0.2.1]) started: pass
Test 62: Access token requires Authorization: Bearer test access bearer token.vi ✅ pass the token never appears in a response: pass
the second server (port 37062, Access token set) started: pass
no Authorization header -> HTTP 401 with WWW-Authenticate: Bearer (header names compared case-insensitively): pass
Authorization: Bearer wrong-token -> HTTP 401 with WWW-Authenticate: Bearer: pass
Authorization: bearer test-token-62 (lower-case scheme) -> HTTP 200 with the tools/list result, no WWW-Authenticate: pass
authorization: Bearer test-token-62 (lower-case header name) -> HTTP 200 with the tools/list result: pass
the 401 body is the JSON-RPC error -32600 "Unauthorized: missing or invalid bearer token." with id null: pass
Test 63: tools/list leaves out LabVIEW's default error cluster descriptions test tools list error descriptions.vi ✅ pass fake_tool_error_descriptions - the descriptions the author wrote on previous error, last error and their elements are kept unchanged, and NI's status text with a sentence added counts as the author's: pass
tools/list fake_tool_error_descriptions -> error in (no error) and error out are in inputSchema and outputSchema without a description key, and so are their status, code and source; their type is still there: pass
Test 64: a streamed tools/call that fails is answered on the stream and the server keeps answering test streamed tool error.vi ✅ pass legacy streamed tools/call of the unknown tool no_such_tool (id 641): HTTP 200 with Content-Type text/event-stream: pass
legacy streamed tools/call of the unknown tool no_such_tool (id 641): the last data event is the JSON-RPC answer with id 641: pass
legacy streamed tools/call of the unknown tool no_such_tool (id 641): the answer is error -32602: pass
after the legacy streamed tools/call of the unknown tool no_such_tool (id 641): a plain tools/list answers HTTP 200 within 5 s: pass
legacy streamed tools/call of fake_tool_add with x a string (id 642): HTTP 200 with Content-Type text/event-stream: pass
legacy streamed tools/call of fake_tool_add with x a string (id 642): the answer is a result with isError true: pass
legacy streamed tools/call of fake_tool_add with x a string (id 642): the last data event is the JSON-RPC answer with id 642: pass
after the legacy streamed tools/call of fake_tool_add with x a string (id 642): a plain tools/list answers HTTP 200 within 5 s: pass
modern streamed tools/call of the unknown tool no_such_tool (id 643): HTTP 200 with Content-Type text/event-stream: pass
modern streamed tools/call of the unknown tool no_such_tool (id 643): the last data event is the JSON-RPC answer with id 643: pass
modern streamed tools/call of the unknown tool no_such_tool (id 643): the answer is error -32602: pass
after the modern streamed tools/call of the unknown tool no_such_tool (id 643): a plain tools/list answers HTTP 200 within 5 s: pass
modern streamed tools/call of fake_tool_add with x a string (id 644): HTTP 200 with Content-Type text/event-stream: pass
modern streamed tools/call of fake_tool_add with x a string (id 644): the last data event is the JSON-RPC answer with id 644: pass
modern streamed tools/call of fake_tool_add with x a string (id 644): the answer is a result with isError true: pass
after the modern streamed tools/call of fake_tool_add with x a string (id 644): a plain tools/list answers HTTP 200 within 5 s: pass
Test 65: a tool VI with automatic error handling and an unwired error does not stop the server test tool automatic error handling.vi ✅ pass plain tools/call of fake_tool_unwired_error with json "not json" (id 651) -> HTTP 200 with a result and no JSON-RPC error within 10 s: pass
plain tools/call of fake_tool_unwired_error with json "not json" (id 651) -> automatic error handling of fake tool unwired error.vi is off afterwards: pass
plain tools/call of fake_tool_unwired_error with json "not json" (id 651) -> automatic error handling of its subVI fake unwired error subvi.vi is off afterwards: pass
after the plain tools/call of fake_tool_unwired_error with json "not json" (id 651): a plain tools/list answers HTTP 200 within 5 s: pass
streamed tools/call of fake_tool_unwired_error with json "not json" (id 652) -> HTTP 200 with a result and no JSON-RPC error within 10 s: pass
streamed tools/call of fake_tool_unwired_error with json "not json" (id 652) -> automatic error handling of fake tool unwired error.vi is off afterwards: pass
streamed tools/call of fake_tool_unwired_error with json "not json" (id 652) -> automatic error handling of its subVI fake unwired error subvi.vi is off afterwards: pass
after the streamed tools/call of fake_tool_unwired_error with json "not json" (id 652): a plain tools/list answers HTTP 200 within 5 s: pass

VI changes

Open the full VI diff

VIs: 99 modified, 6 added, 0 deleted

VI Changes Changed spot, now
Add Array Items To Schema.vi
src/MCP Server
1
Add Control Details To Schema.vi
src/MCP Server
1
Add Prompt.vi
src/MCP Server
1
Add Resource (File).vi
src/MCP Server
1
Add Structured Content.vi
src/MCP Server
2
Add Tool.vi
src/MCP Server
1
93 more modified VIs
VI Changes Changed spot, now
Build Content.vi
src/MCP Server
2
Build Error Response.vi
src/MCP Server
2
Build Method Not Found Response.vi
src/MCP Server
2
Build Picture JSON.vi
src/MCP Server
1
Build Prompt List JSON.vi
src/MCP Server
1
Build Response Error.vi
src/MCP Server
1
Build Response Message.vi
src/MCP Server
1
Build Text JSON for MCP.vi
src/MCP Server
1
Build Tool.vi
src/MCP Server
1
Cache Hints.vi
src/MCP Server
1
Call VI.vi
src/MCP Server
1
Check Client Access.vi
src/MCP Server
1
Check MCP Names.vi
src/MCP Server
1
Check Modern MCP Request.vi
src/MCP Server
1
Check Prompt Arguments.vi
src/MCP Server
1
Check Tool Arguments.vi
src/MCP Server
1
Choose Protocol Version.vi
src/MCP Server
1
Clean Error Message.vi
src/MCP Server
1
Clear Tools.vi
src/MCP Server
1
Complete Tool Entry.vi
src/MCP Server
1
Convert Image To Base64.vi
src/MCP Server
1
Create Events.vi
src/MCP Server
1
Create Server.vi
src/MCP Server
1
Decode Header Value.vi
src/MCP Server
1
Default Tool Arguments.vi
src/MCP Server
1
Finish Tool Call Response.vi
src/MCP Server
1
Generate Unique Server ID.vi
src/MCP Server
1
Get Connector Pane Info.vi
src/MCP Server
1
Get ID from JSON.vi
src/MCP Server
1
Get ID from name.vi
src/MCP Server
1
Get Parameter.vi
src/MCP Server
1
Get Prompts.vi
src/MCP Server
1
Get Resources.vi
src/MCP Server
1
Get Server Name from ID.vi
src/MCP Server
1
Get Server.vi
src/MCP Server
1
Get Tool.vi
src/MCP Server
1
Get Tools.vi
src/MCP Server
1
Handle Server Request Batch.vi
src/MCP Server
1
Handle Server Request.vi
src/MCP Server
1
Is Supported Protocol Version.vi
src/MCP Server
1
JSON To Control Value.vi
src/MCP Server
1
LV Type To JSON Schema.vi
src/MCP Server
1
LV type to MCP type.vi
src/MCP Server
1
Legacy Cancellations.vi
src/MCP Server
1
List Control Elements.vi
src/MCP Server
1
Log.vi
src/MCP Server
1
Connection Local IP.vi
src/MCP Server/MCP Connection Probe
1
Abort Stream.vi
src/MCP Server/MCP SSE Response
1
Create MCP SSE Response.vi
src/MCP Server/MCP SSE Response
2
Get Queues.vi
src/MCP Server/MCP SSE Response
1
Next Segment.vi
src/MCP Server/MCP SSE Response
1
Stream Length.vi
src/MCP Server/MCP SSE Response
1
Make Output Property Schema.vi
src/MCP Server
1
Make Output Schema.vi
src/MCP Server
1
Make Schema Details.vi
src/MCP Server
1
Mark Tool Error Result.vi
src/MCP Server
1
Negotiate Protocol Version.vi
src/MCP Server
1
Null Id For Parse Error.vi
src/MCP Server
1
Read Numeric Limits.vi
src/MCP Server
1
Read Resource Contents.vi
src/MCP Server
1
Reinitialize VI Inputs.vi
src/MCP Server
6
Reject Invalid Request.vi
src/MCP Server
1
Reject Non Object Message.vi
src/MCP Server
1
Remove Default Error Description.vi
src/MCP Server
1
Remove Empty Description.vi
src/MCP Server
1
Remove Server.vi
src/MCP Server
1
Restore Request ID.vi
src/MCP Server
1
Send onError.vi
src/MCP Server
1
Send onRpc.vi
src/MCP Server
1
Server Access Settings.vi
src/MCP Server
1
Server FGV.vi
src/MCP Server
1
Set LabVIEW Version.vi
src/MCP Server
1
Set Parameters.vi
src/MCP Server
1
Set Tool Annotations.vi
src/MCP Server
1
Set Tool Title.vi
src/MCP Server
1
Start.vi
src/MCP Server
1
Stop.vi
src/MCP Server
1
Strip Error Details.vi
src/MCP Server
1
Supported Protocol Versions.vi
src/MCP Server
1
To MCP Name.vi
src/MCP Server
1
Validate HTTP Request.vi
src/MCP Server
1
exit.vi
src/MCP Server
1
initialize.vi
src/MCP Server
1
ping.vi
src/MCP Server
1
prompts get.vi
src/MCP Server
1
prompts list.vi
src/MCP Server
1
resources list.vi
src/MCP Server
1
resources read.vi
src/MCP Server
1
resources templates list.vi
src/MCP Server
1
shutdown.vi
src/MCP Server
1
tool call.vi
src/MCP Server
1
tool list.vi
src/MCP Server
1
Test_MCP_Server.vi
tests
2
Added VIs (6)
VI Block diagram
Disable Automatic Error Handling.vi
src/MCP Server
Add Fixture Unwired Error Tool.vi
tests
fake tool unwired error.vi
tests
fake unwired error subvi.vi
tests
test streamed tool error.vi
tests
test tool automatic error handling.vi
tests

Produced locally (the pull request workflow has not run: the self-hosted runner is offline). Tests: LabVIEW 2026 64-bit; VI comparison: LabVIEW 2026 32-bit. Report for commit 5f3b2e4.

@JanGoebelsBot
JanGoebelsBot marked this pull request as ready for review November 26, 2026 11:19
@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Tests

✅ All 66 tests passed.

Per-test results
Test VI Result Checks
Test 1: Initialize Test Initialize.vi ✅ pass Assert True: pass
Test 2: Initialized Test Initialized.vi ✅ pass Assert True: pass
Test 3: tools/list Test tools list.vi ✅ pass Assert True: pass
Test 4: prompts/list test prompts list.vi ✅ pass Assert True: pass
Test 5: resources/list test resources list.vi ✅ pass Assert True: pass
Test 6: tools call test tools call.vi ✅ pass Assert True: pass
Test 7: empty JSON object is an invalid request test empty msg.vi ✅ pass Assert True: pass
Test 8: call broken tool test broken tool.vi ✅ pass Assert True: pass
Test 6: tools call test tools call array.vi ✅ pass Assert True: pass
Test 9: GET is rejected with 405 test http get rejected.vi ✅ pass GET -> 405 with Allow: POST and error -32600: pass
Test 10: Origin validation test http origin.vi ✅ pass Origin http://evil.example -> 403 with error -32600: pass
Origin http://localhost:6274 -> 200 with result: pass
Test 11: MCP-Protocol-Version validation test http protocol version.vi ✅ pass MCP-Protocol-Version 1999-01-01 -> 400 with error -32022 (Unsupported protocol version, the MCP 2026-07-28 code in both eras): pass
MCP-Protocol-Version 2025-06-18 -> 200 with result: pass
Test 12: notification answered with 202 test notification accepted.vi ✅ pass notifications/initialized -> 202 with empty body: pass
Test 13: request with id answered with 200 test request status.vi ✅ pass tools/list with id 1 -> 200 with result and id 1: pass
Test 14: unknown method test unknown method.vi ✅ pass does/not/exist with id 5 -> 200 with error -32601 and id 5: pass
Test 15: unknown notification test unknown notification.vi ✅ pass notifications/cancelled -> 202 with empty body: pass
Test 16: ping test ping.vi ✅ pass ping with id 3 -> 200 with result {} and id 3: pass
Test 17: string request id test string id.vi ✅ pass tools/list with id "abc-1" -> 200 with result and id "abc-1": pass
Test 18: unknown prompt test unknown prompt.vi ✅ pass prompts/get no-such-prompt with id 7 -> JSON-RPC error -32602 with id 7, no status/source: pass
Test 19: unknown resource test unknown resource.vi ✅ pass resources/read of an unknown uri with id 8 -> JSON-RPC error -32002 with id 8, no status/source: pass
Test 20: resources/read returns UTF-8 text unchanged test resource text utf8.vi ✅ pass text of labview://fixture_utf8 decodes to the bytes of fixture_utf8.txt: pass
Test 21: resources/read returns a binary file as Base64 test resource blob.vi ✅ pass blob of labview://fixture_binary is the Base64 of the bytes of fixture_binary.png: pass
Test 22: unknown tool test unknown tool.vi ✅ pass tools/call no_such_tool -> error -32602 with message Unknown tool: no_such_tool and id 22: pass
Test 23: tools/call with arguments that are not an object test tool call without arguments.vi ✅ pass tools/call fake_tool_add with arguments 5 -> error -32602 with message Invalid arguments... and id 23: pass
Test 24: broken tool is a tool execution error test broken tool message.vi ✅ pass tools/call fake_tool_broken_vi -> result with isError true and a text that says not executable: pass
Test 25: prompts/get without arguments test prompt without arguments.vi ✅ pass prompts/get fake_prompt_concatanate_strings without arguments -> result with messages: pass
Test 26: request without method test request without method.vi ✅ pass a message with id 26 and no method -> error -32600 with id 26: pass
Test 27: malformed JSON test malformed json.vi ✅ pass truncated JSON -> error -32700 with id null: pass
Test 28: array inputs say what their items are test tools list array items.vi ✅ pass fake_tool_arrays - intarray has items of type integer and stringarray of type string: pass
Test 29: protocol version negotiation test protocol version negotiation.vi ✅ pass initialize asking for 2024-11-05 -> protocolVersion 2024-11-05: pass
initialize asking for 1999-01-01 -> protocolVersion 2025-11-25 (the newest legacy version): pass
Test 30: resources/templates/list test resource templates list.vi ✅ pass resources/templates/list -> result with resourceTemplates []: pass
Test 31: tools/call without arguments test tool call default arguments.vi ✅ pass tools/call fake_tool_add without arguments -> result with the sum 0, no error, id 31: pass
Test 32: a tool that returns an error sets isError test tool error result.vi ✅ pass fake_tool_return_error with status true -> result with isError true, code and source still in the content: pass
fake_tool_return_error with status false -> result without isError: pass
Test 33: internal errors show no LabVIEW internals test internal error message.vi ✅ pass prompts/get fake_prompt_broken_vi -> error -32603 with a message without call chain, markup, tags or path: pass
Test 34: prompts/list says which arguments are required test prompts list required.vi ✅ pass fake_prompt_required_argument - topic has required true and style has required false: pass
Test 35: prompts/get checks required arguments test prompt required argument.vi ✅ pass prompts/get fake_prompt_required_argument without topic -> error -32602 that names topic, id 36: pass
prompts/get fake_prompt_required_argument with topic -> result whose text contains both argument values: pass
Test 36: JSON-RPC batch test batch.vi ✅ pass batch of ping (id 38), a notification and tools/list (id b) -> 200 with an array of two answers in that order: pass
batch of two notifications -> 202 with empty body: pass
empty batch -> error -32600 with id null: pass
Test 37: a JSON value that is not an object test non object message.vi ✅ pass body 5 -> error -32600 with id null: pass
body "text" -> error -32600 with id null: pass
body null -> error -32600 with id null: pass
Test 38: tools/call checks required arguments test tool required arguments.vi ✅ pass tools/call fake_tool_required_input without arguments -> result with isError true and the text Missing required argument(s): b, a (the order of inputSchema.required), no JSON-RPC error, id 40: pass
tools/call fake_tool_required_input with arguments {} -> result with isError true naming b and a, no JSON-RPC error, id 41: pass
tools/call fake_tool_required_input with only a -> result with isError true naming only b, no JSON-RPC error, id 42: pass
tools/call fake_tool_required_input with a 2 and b 3 -> result 6, no error, id 43: pass
Test 39: initialize with an unknown protocol version test protocol version fallback.vi ✅ pass initialize asking for 1999-01-01 -> protocolVersion is the first entry of Supported Protocol Versions.vi: pass
Test 40: initialize reports the LabVIEW version test labview version.vi ✅ pass initialize -> serverInfo.additionalDetails.labviewVersion equals the Version Number of this LabVIEW: pass
Test 41: tools/list shows the MCP names of special labels test tools list mcp names.vi ✅ pass tools/list fake_tool_special_labels -> Length (mm) and Factor #1 & 50% are listed as length__mm_ and factor__1___50_ in properties and in required, id 44: pass
tools/list fake_tool_special_labels -> every name in properties and required matches ^[a-zA-Z0-9_-]{1,64}$: pass
Test 42: tools/call reaches special labels by their MCP names test tools call mcp names.vi ✅ pass tools/call fake_tool_special_labels with length__mm_ 2.5 and factor__1___50_ 4 -> result {"result__mm_":10}, no error, id 45: pass
Test 43: Add Tool refuses inputs whose MCP names clash test add tool name clash.vi ✅ pass Add Tool fake tool name clash.vi with the inputs a b and a_b -> error 5010 naming both controls and the MCP name a_b: pass
tools/list after the refused Add Tool -> fake_tool_name_clash is not listed, id 46: pass
Test 44: Add Prompt refuses arguments whose MCP names clash test add prompt name clash.vi ✅ pass Add Prompt fake prompt name clash.vi with the arguments a b and a_b -> error 5010 naming both controls and the MCP name a_b: pass
prompts/list after the refused Add Prompt -> fake_prompt_name_clash is not listed, id 47: pass
Test 45: 3D arrays and arrays of paths, enums and clusters say what their items are test tools list array shapes.vi ✅ pass fake_tool_array_shapes - patharray (1D array of paths) has items with a non-empty type: pass
fake_tool_array_shapes - enumarray (1D array of a U16 enum) has items with a non-empty type: pass
fake_tool_array_shapes - clusterarray (1D array of clusters) has items with a non-empty type: pass
fake_tool_array_shapes - array3d (3D array of DBL) has items.type array, items.items.type array and items.items.items.type number: pass
Test 46: timestamps, clusters and types without a JSON type are described in tools/list test tools list schema details.vi ✅ pass fake_tool_schema_shapes - timestamp is a string with format date-time: pass
fake_tool_schema_shapes - variants (array of a type without JSON type) has items {}: pass
fake_tool_schema_shapes - settings (cluster) has properties, also of its inner cluster and of its array of clusters: pass
fake_tool_schema_shapes - matrix (2D array of I32) has items of type array with items of type integer: pass
fake_tool_schema_shapes - mode (U16 enum) is a string with enum [slow, fast]: pass
fake_tool_array_shapes - clusterarray items and cluster with array have properties with types: pass
fake_tool_array_shapes - timestamparray has items of type string with format date-time: pass
Test 47: tools/call converts timestamps, clusters, enums and 2D and 3D arrays test tools call schema shapes.vi ✅ pass fake_tool_schema_shapes with timestamp 2026-10-17T12:34:56Z -> no isError, time out 2026-10-17T12:34:56.000Z: pass
fake_tool_schema_shapes - settings (cluster with cluster, timestamp and array of clusters) arrives unchanged: pass
fake_tool_schema_shapes - matrix [[1,2],[3,4]] (2D array) arrives unchanged: pass
fake_tool_schema_shapes - mode fast (enum by item name) and variants [1,"x"] (2 elements) arrive: pass
fake_tool_array_shapes with a 3D array [[[1,2],[3,4]],[[5,6],[7,8]]] -> no isError, the tool gets all 8 elements: pass
Test 48: every array schema in tools/list says what its items are test tools list every array has items.vi ✅ pass tools/list of the test server - 21 array schemas found, 0 of them without items (expected: at least one, none without): pass
Test 49: tools/list gives element descriptions, integer ranges, data entry limits, units and defaults test tools list descriptions defaults ranges.vi ✅ pass fake_tool_schema_details - mode (enum, default fast) has the default "fast": pass
fake_tool_schema_details - level (U8, default 7) has minimum 0, maximum 255 and default 7: pass
fake_tool_schema_details - setpoint (DBL, data entry limits 0 to 100 coerced, default 25) has minimum 0, maximum 100 and default 25: pass
fake_tool_schema_details - voltage (unit V) has the description "Supply voltage. Unit: V.": pass
fake_tool_schema_details - count (required) has no default and has minimum -2147483648: pass
fake_tool_schema_details - config elements have their descriptions (offset, name, and enabled inside the array of clusters) and offset (I16) has minimum -32768: pass
fake_tool_schema_shapes - the integer items of matrix (2D array of I32) have minimum -2147483648: pass
fake_tool_schema_details - gain (no element description) has a type but no description: pass
Test 50: tools/call returns structuredContent without picture outputs, and none on isError results test tools call structured content.vi ✅ pass tools/call fake_tool_return_error with status false (id 502) -> structuredContent carries the error cluster output as an ordinary object: pass
fake_tool_picture_outputs - the picture is still returned as an image item of content, and the result is not an error: pass
tools/call fake_tool_return_error with status true (id 501) -> isError true and no structuredContent: pass
tools/call fake_tool_picture_outputs (id 50) -> structuredContent is present and equals the text JSON without its picture placeholder: pass
tools/call fake_tool_required_input without arguments (id 503) -> isError true and no structuredContent: pass
fake_tool_picture_outputs - structuredContent holds exactly the non-picture outputs count, label, mode and time, while the text still has the picture placeholder: pass
Test 51: tools/list gives an outputSchema that matches structuredContent test tools list output schema.vi ✅ pass fake_tool_picture_outputs - count is an integer with the description of its indicator, label is a string, and no output property has a default: pass
fake_tool_picture_outputs - time (timestamp) is a string with format date-time and mode (enum) has enum ["slow","fast"]: pass
tools/list fake_tool_no_inputs_outputs (no outputs) -> no outputSchema: pass
fake_tool_picture_outputs - the outputSchema property names are the names in structuredContent of tools/call (id 511), and the picture output is left out: pass
tools/list fake_tool_picture_outputs -> outputSchema is an object schema whose properties and required are count, label, mode and time: pass
Test 52: tools/list sends title and annotations only when they are set test tools list title annotations.vi ✅ pass tools/list fake_tool_annotated (registered with a title) -> title "Annotated Fixture Tool": pass
fake_tool_annotated (readOnlyHint true, destructiveHint false, the others not set) -> annotations with exactly readOnlyHint true and destructiveHint false: pass
tools/list fake_tool_add (registered without title and annotations) -> neither title nor annotations: pass
Test 53: modern results carry resultType, cache hints and serverInfo; legacy results do not test modern tools list.vi ✅ pass modern tools/list -> _meta io.modelcontextprotocol/serverInfo with name and version: pass
modern tools/list (id 53, MCP 2026-07-28 headers and _meta) -> 200 with tools, resultType complete, ttlMs 60000 and cacheScope public: pass
legacy tools/list (id 531, no _meta) -> tools without resultType, ttlMs, cacheScope or _meta: pass
Test 54: server/discover, and initialize never negotiates 2026-07-28 test server discover.vi ✅ pass server/discover (id 54) -> 200, resultType complete, supportedVersions with 2026-07-28 and 2025-11-25: pass
server/discover -> capabilities tools, prompts and resources (as initialize), _meta serverInfo, ttlMs 60000, cacheScope public: pass
initialize asking for 2025-11-25 (id 542) -> 2025-11-25: pass
initialize asking for 2026-07-28 (id 541) -> the newest legacy version 2025-11-25, never 2026-07-28: pass
Test 55: modern requests are refused when their headers do not match the body test modern headers.vi ✅ pass Mcp-Method prompts/list on a tools/list request (id 55) -> 400 with error -32020: pass
MCP-Protocol-Version 2025-11-25 while _meta says 2026-07-28 (id 553) -> 400 with error -32020: pass
tools/call with an Mcp-Name that is not params.name (id 554) -> 400 with error -32020: pass
tools/call without an Mcp-Name header (id 551) -> 400 with error -32020: pass
tools/call with Mcp-Name =?base64?...?= of fake_tool_add, lower-case header names (id 552) -> 200 with the tool result: pass
Test 56: unsupported versions, missing capabilities and unknown methods in the modern era test modern errors.vi ✅ pass modern request without io.modelcontextprotocol/clientCapabilities (id 562) -> 400 with error -32602: pass
modern request with the legacy version 2025-11-25 in _meta (id 561) -> 400, error -32022, data.supported with 2025-11-25: pass
unknown version 2027-01-01 in header and _meta (id 56) -> 400, error -32022, data.supported with 2026-07-28, data.requested 2027-01-01: pass
modern request with the unknown method foo/bar (id 563) -> 404 with error -32601: pass
modern resources/read of an unknown uri (id 565) -> error -32602 (legacy keeps -32002): pass
modern ping (id 564), which MCP 2026-07-28 removed -> 404 with error -32601: pass
Test 57: elicitation by input_required and retry with inputResponses test elicitation.vi ✅ pass retry with inputResponses confirm_action decline (id 572) -> outcome declined: pass
modern tools/call without the elicitation capability (id 573) -> outcome not supported, no input_required: pass
modern tools/call of fake_tool_confirm with the elicitation capability (id 57) -> resultType input_required with inputRequests.confirm_action: pass
retry with inputResponses confirm_action accept (id 571) -> complete result with outcome confirmed: pass
legacy tools/call (id 574) -> outcome not supported: pass
Test 58: progress notifications as Server-Sent Events for tools/call test progress notifications.vi ✅ pass id 581: exactly 10 notifications/progress events, each with progressToken "t58" and total 10, progress 1..10 in increasing order: pass
modern tools/call with the numeric progressToken 583 (id 583) -> text/event-stream, 10 events with "progressToken":583 in order, then the complete result: pass
legacy tools/call with progressToken "t58" and Accept text/event-stream (id 581) -> HTTP 200, text/event-stream: pass
the same call without progressToken (id 582) -> plain application/json, no progress events: pass
the tool finished all 10 steps (fixture record): pass
id 581: the JSON-RPC result is the last data event, after progress 10: pass
Test 59: closing the stream cancels a streamed tools/call test progress cancel by close.vi ✅ pass modern streamed tools/call over raw TCP (id 591) -> text/event-stream, the first progress event arrives: pass
after the client closed the connection the tool stopped early (fewer than 10 steps) and saw cancelled? TRUE: pass
Test 60: legacy notifications/cancelled stops a streamed tools/call test progress legacy cancel.vi ✅ pass the stream ended without a result for id 601: pass
the tool stopped early (fewer than 10 steps) and saw cancelled? TRUE: pass
legacy streamed tools/call over raw TCP (id 601) -> text/event-stream, the first progress event arrives: pass
notifications/cancelled for id 601 on a second connection -> HTTP 202 within 1 s, while the call runs: pass
Test 61: a client that is not in Allowed clients gets 403 test access allowed clients.vi ✅ pass tools/list from this computer to a server that allows only 192.0.2.1 -> HTTP 403, application/json: pass
the second server (port 37061, Allowed clients = [192.0.2.1]) started: pass
the 403 body is the JSON-RPC error -32600 "Forbidden: client not allowed." with id null: pass
Test 62: Access token requires Authorization: Bearer test access bearer token.vi ✅ pass the token never appears in a response: pass
Authorization: Bearer wrong-token -> HTTP 401 with WWW-Authenticate: Bearer: pass
authorization: Bearer test-token-62 (lower-case header name) -> HTTP 200 with the tools/list result: pass
the 401 body is the JSON-RPC error -32600 "Unauthorized: missing or invalid bearer token." with id null: pass
the second server (port 37062, Access token set) started: pass
Authorization: bearer test-token-62 (lower-case scheme) -> HTTP 200 with the tools/list result, no WWW-Authenticate: pass
no Authorization header -> HTTP 401 with WWW-Authenticate: Bearer (header names compared case-insensitively): pass
Test 63: tools/list leaves out LabVIEW's default error cluster descriptions test tools list error descriptions.vi ✅ pass fake_tool_error_descriptions - the descriptions the author wrote on previous error, last error and their elements are kept unchanged, and NI's status text with a sentence added counts as the author's: pass
tools/list fake_tool_error_descriptions -> error in (no error) and error out are in inputSchema and outputSchema without a description key, and so are their status, code and source; their type is still there: pass
Test 64: a streamed tools/call that fails is answered on the stream and the server keeps answering test streamed tool error.vi ✅ pass legacy streamed tools/call of the unknown tool no_such_tool (id 641): HTTP 200 with Content-Type text/event-stream: pass
legacy streamed tools/call of the unknown tool no_such_tool (id 641): the answer is error -32602: pass
legacy streamed tools/call of the unknown tool no_such_tool (id 641): the last data event is the JSON-RPC answer with id 641: pass
after the legacy streamed tools/call of the unknown tool no_such_tool (id 641): a plain tools/list answers HTTP 200 within 5 s: pass
legacy streamed tools/call of fake_tool_add with x a string (id 642): HTTP 200 with Content-Type text/event-stream: pass
legacy streamed tools/call of fake_tool_add with x a string (id 642): the answer is a result with isError true: pass
legacy streamed tools/call of fake_tool_add with x a string (id 642): the last data event is the JSON-RPC answer with id 642: pass
after the legacy streamed tools/call of fake_tool_add with x a string (id 642): a plain tools/list answers HTTP 200 within 5 s: pass
modern streamed tools/call of the unknown tool no_such_tool (id 643): HTTP 200 with Content-Type text/event-stream: pass
modern streamed tools/call of the unknown tool no_such_tool (id 643): the last data event is the JSON-RPC answer with id 643: pass
modern streamed tools/call of the unknown tool no_such_tool (id 643): the answer is error -32602: pass
after the modern streamed tools/call of the unknown tool no_such_tool (id 643): a plain tools/list answers HTTP 200 within 5 s: pass
modern streamed tools/call of fake_tool_add with x a string (id 644): HTTP 200 with Content-Type text/event-stream: pass
modern streamed tools/call of fake_tool_add with x a string (id 644): the answer is a result with isError true: pass
modern streamed tools/call of fake_tool_add with x a string (id 644): the last data event is the JSON-RPC answer with id 644: pass
after the modern streamed tools/call of fake_tool_add with x a string (id 644): a plain tools/list answers HTTP 200 within 5 s: pass
Test 65: a tool VI with automatic error handling and an unwired error does not stop the server test tool automatic error handling.vi ✅ pass plain tools/call of fake_tool_unwired_error with json "not json" (id 651) -> HTTP 200 with a result and no JSON-RPC error within 10 s: pass
plain tools/call of fake_tool_unwired_error with json "not json" (id 651) -> automatic error handling of its subVI fake unwired error subvi.vi is off afterwards: pass
plain tools/call of fake_tool_unwired_error with json "not json" (id 651) -> automatic error handling of fake tool unwired error.vi is off afterwards: pass
after the plain tools/call of fake_tool_unwired_error with json "not json" (id 651): a plain tools/list answers HTTP 200 within 5 s: pass
streamed tools/call of fake_tool_unwired_error with json "not json" (id 652) -> HTTP 200 with a result and no JSON-RPC error within 10 s: pass
streamed tools/call of fake_tool_unwired_error with json "not json" (id 652) -> automatic error handling of its subVI fake unwired error subvi.vi is off afterwards: pass
streamed tools/call of fake_tool_unwired_error with json "not json" (id 652) -> automatic error handling of fake tool unwired error.vi is off afterwards: pass
after the streamed tools/call of fake_tool_unwired_error with json "not json" (id 652): a plain tools/list answers HTTP 200 within 5 s: pass

Protocol tests

✅ Test-McpServer.ps1 passed against the test server.

Protocol tester output (0 failed required checks)
Testing MCP server at http://127.0.0.1:36987/mcp/server

[PASS] (required) Lifecycle - initialize answers 200 with a JSON result
[PASS] (required) Lifecycle - initialize answer is JSON-RPC 2.0 with the request id
[PASS] (required) Lifecycle - initialize result has protocolVersion, capabilities and serverInfo.name
[PASS] (required) Lifecycle - Content-Type of the answer is application/json
[PASS] (advisory) Lifecycle - a client asking for 2024-11-05 gets that version back
[PASS] (required) Lifecycle - notifications/initialized is accepted with 202 and no body
[PASS] (required) Transport - GET answers 405 or opens an event stream
[PASS] (advisory) Transport - 405 answer names the allowed method in an Allow header
[PASS] (required) Transport - a request from a foreign Origin is rejected (403)
[PASS] (required) Transport - a request from a localhost Origin is accepted
[PASS] (required) Transport - an unsupported MCP-Protocol-Version header is rejected (400)
[PASS] (required) Transport - the negotiated MCP-Protocol-Version header is accepted
[PASS] (required) JSON-RPC - ping is answered with an empty result
[PASS] (required) JSON-RPC - an unknown method gets error -32601 with the request id
[PASS] (required) JSON-RPC - an unknown notification is not answered
[PASS] (required) JSON-RPC - a string request id is returned unchanged
[PASS] (required) JSON-RPC - malformed JSON gets error -32700
[PASS] (advisory) JSON-RPC - a request without a method gets error -32600
[PASS] (required) Tools - tools/list returns a tools array
[PASS] (required) Tools - every tool has a name and an inputSchema of type object (1 tools)
[PASS] (advisory) Tools - array parameters say what their items are
[PASS] (required) Tools - calling an unknown tool is answered with an error
[PASS] (required) Tools - calling an unknown tool with a progressToken is answered with an error
[PASS] (required) Tools - the server still answers after that call
[PASS] (required) Prompts - prompts/list returns a prompts array
[PASS] (required) Prompts - every prompt has a name (1 prompts)
[PASS] (required) Prompts - getting an unknown prompt is answered with an error
[PASS] (required) Resources - resources/list returns a resources array
[PASS] (required) Resources - every resource has a uri and a name (2 resources)
[PASS] (required) Resources - reading an unknown resource is answered with an error
[PASS] (advisory) Resources - resources/templates/list returns a resourceTemplates array

Required: 26 of 26 passed. Advisory: 0 failed.

VI changes

Open the full VI diff

VIs: 99 modified, 6 added, 0 deleted

VI Changes Changed spot, now
Add Array Items To Schema.vi
src/MCP Server
1
Add Control Details To Schema.vi
src/MCP Server
1
Add Prompt.vi
src/MCP Server
1
Add Resource (File).vi
src/MCP Server
1
Add Structured Content.vi
src/MCP Server
1
Add Tool.vi
src/MCP Server
1
93 more modified VIs
VI Changes Changed spot, now
Build Content.vi
src/MCP Server
1
Build Error Response.vi
src/MCP Server
1
Build Method Not Found Response.vi
src/MCP Server
1
Build Picture JSON.vi
src/MCP Server
1
Build Prompt List JSON.vi
src/MCP Server
1
Build Response Error.vi
src/MCP Server
1
Build Response Message.vi
src/MCP Server
1
Build Text JSON for MCP.vi
src/MCP Server
1
Build Tool.vi
src/MCP Server
1
Cache Hints.vi
src/MCP Server
1
Call VI.vi
src/MCP Server
1
Check Client Access.vi
src/MCP Server
1
Check MCP Names.vi
src/MCP Server
1
Check Modern MCP Request.vi
src/MCP Server
1
Check Prompt Arguments.vi
src/MCP Server
1
Check Tool Arguments.vi
src/MCP Server
1
Choose Protocol Version.vi
src/MCP Server
1
Clean Error Message.vi
src/MCP Server
1
Clear Tools.vi
src/MCP Server
1
Complete Tool Entry.vi
src/MCP Server
1
Convert Image To Base64.vi
src/MCP Server
1
Create Events.vi
src/MCP Server
1
Create Server.vi
src/MCP Server
1
Decode Header Value.vi
src/MCP Server
1
Default Tool Arguments.vi
src/MCP Server
1
Finish Tool Call Response.vi
src/MCP Server
1
Generate Unique Server ID.vi
src/MCP Server
1
Get Connector Pane Info.vi
src/MCP Server
1
Get ID from JSON.vi
src/MCP Server
1
Get ID from name.vi
src/MCP Server
1
Get Parameter.vi
src/MCP Server
1
Get Prompts.vi
src/MCP Server
1
Get Resources.vi
src/MCP Server
1
Get Server Name from ID.vi
src/MCP Server
1
Get Server.vi
src/MCP Server
1
Get Tool.vi
src/MCP Server
1
Get Tools.vi
src/MCP Server
1
Handle Server Request Batch.vi
src/MCP Server
1
Handle Server Request.vi
src/MCP Server
1
Is Supported Protocol Version.vi
src/MCP Server
1
JSON To Control Value.vi
src/MCP Server
1
LV Type To JSON Schema.vi
src/MCP Server
1
LV type to MCP type.vi
src/MCP Server
1
Legacy Cancellations.vi
src/MCP Server
1
List Control Elements.vi
src/MCP Server
1
Log.vi
src/MCP Server
1
Connection Local IP.vi
src/MCP Server/MCP Connection Probe
1
Abort Stream.vi
src/MCP Server/MCP SSE Response
1
Create MCP SSE Response.vi
src/MCP Server/MCP SSE Response
1
Get Queues.vi
src/MCP Server/MCP SSE Response
1
Next Segment.vi
src/MCP Server/MCP SSE Response
1
Stream Length.vi
src/MCP Server/MCP SSE Response
1
Make Output Property Schema.vi
src/MCP Server
1
Make Output Schema.vi
src/MCP Server
1
Make Schema Details.vi
src/MCP Server
1
Mark Tool Error Result.vi
src/MCP Server
1
Negotiate Protocol Version.vi
src/MCP Server
1
Null Id For Parse Error.vi
src/MCP Server
1
Read Numeric Limits.vi
src/MCP Server
1
Read Resource Contents.vi
src/MCP Server
1
Reinitialize VI Inputs.vi
src/MCP Server
6
Reject Invalid Request.vi
src/MCP Server
1
Reject Non Object Message.vi
src/MCP Server
1
Remove Default Error Description.vi
src/MCP Server
1
Remove Empty Description.vi
src/MCP Server
1
Remove Server.vi
src/MCP Server
1
Restore Request ID.vi
src/MCP Server
1
Send onError.vi
src/MCP Server
1
Send onRpc.vi
src/MCP Server
1
Server Access Settings.vi
src/MCP Server
1
Server FGV.vi
src/MCP Server
1
Set LabVIEW Version.vi
src/MCP Server
1
Set Parameters.vi
src/MCP Server
1
Set Tool Annotations.vi
src/MCP Server
1
Set Tool Title.vi
src/MCP Server
1
Start.vi
src/MCP Server
1
Stop.vi
src/MCP Server
1
Strip Error Details.vi
src/MCP Server
1
Supported Protocol Versions.vi
src/MCP Server
1
To MCP Name.vi
src/MCP Server
1
Validate HTTP Request.vi
src/MCP Server
1
exit.vi
src/MCP Server
1
initialize.vi
src/MCP Server
1
ping.vi
src/MCP Server
1
prompts get.vi
src/MCP Server
1
prompts list.vi
src/MCP Server
1
resources list.vi
src/MCP Server
1
resources read.vi
src/MCP Server
1
resources templates list.vi
src/MCP Server
1
shutdown.vi
src/MCP Server
1
tool call.vi
src/MCP Server
1
tool list.vi
src/MCP Server
1
Test_MCP_Server.vi
tests
2
Added VIs (6)
VI Block diagram
Disable Automatic Error Handling.vi
src/MCP Server
Add Fixture Unwired Error Tool.vi
tests
fake tool unwired error.vi
tests
fake unwired error subvi.vi
tests
test streamed tool error.vi
tests
test tool automatic error handling.vi
tests

Report for commit 5f3b2e4. The installable test package is under Artifacts of this run once the build job has finished.

JanGoebelsBot and others added 2 commits November 28, 2026 21:29
Review finding: Disable Automatic Error Handling.vi switched the setting
off only for the tool or prompt VI itself. A subVI with automatic error
handling on and an unwired error still opened LabVIEW's modal dialog and
froze the server, the symptom this pull request is meant to fix. The
Datalogger example's own tool calls such a subVI.

The VI now also walks the callees of the tool VI, level by level and
each VI once (Callees' Names), and switches the setting off where it is
on. VIs under vi.lib, locked or password-protected VIs and VIs that
cannot be read are left alone and not walked into. Measured in LabVIEW
2026: about 0.3 ms per call for one subVI, 3 ms for a hierarchy of 220
VIs; the first call after loading takes longer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review finding: Test 65 could not fail after its first run in a LabVIEW
session, because the first call left the fixture switched off in
memory, and inside the CLI-run suite LabVIEW does not open the dialog.

The fixture fake tool unwired error.vi now calls the new fixture subVI
fake unwired error subvi.vi (automatic error handling on, unwired JSON
parse error). Before each half the test switches the setting on for
both, in memory; after each call it asserts that both are off. With
the previous Disable Automatic Error Handling.vi the subVI assertions
fail, with no switching at all all four new assertions fail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JanGoebelsBot

Copy link
Copy Markdown
Collaborator Author

Update: review fixes pushed

New commits: c7f2efc, 5f3b2e4.

  • c7f2efc Disable Automatic Error Handling.vi now also switches automatic error handling off in the subVIs of a tool or prompt VI. Before, only the tool VI itself was switched off, so a subVI with an unwired error still opened LabVIEW's modal dialog and froze the server (the Datalogger example's own tool calls such a subVI). The VI walks the callees level by level, each VI once; VIs under vi.lib, locked or password-protected VIs and VIs that cannot be read are left alone. Measured in LabVIEW 2026: about 0.3 ms per call for one subVI, 3 ms for a hierarchy of 220 VIs.
  • 5f3b2e4 Test 65 now checks the setting itself: before each half it switches automatic error handling on for the fixture tool and its new fixture subVI fake unwired error subvi.vi, and after each call asserts that both are off. With the previous Disable Automatic Error Handling.vi the subVI assertions fail; with no switching at all all four new assertions fail. Before, Test 65 could not fail after its first run in a LabVIEW session.
  • Review report comment, detailed VI diff and the Code summary in the description are refreshed for 5f3b2e4.

Tests: Caraya suite through LabVIEW CLI, LabVIEW 2026 64-bit: 66 of 66 tests, 243 assertions, 0 failures.

Still open: nothing on this pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant