Skip to content

Refuse other computers by default and add an optional bearer token - #34

Merged
JanGoebel merged 10 commits into
mainfrom
access-control
Oct 20, 2026
Merged

JanGoebel merged 10 commits into
mainfrom
access-control

Conversation

@JanGoebel

@JanGoebel JanGoebel commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

Builds on #33, #31 and #30. This branch starts from progress-and-cancellation, because all four pull requests edit Process HTTP Request.vi and Test_MCP_Server.vi. Until those are merged, this pull request also shows their commits. Review and merge them in order. This pull request's changes are the three commits from 3850cdb on.

Summary

Every MCP server built with the toolkit could be called from the whole network: the IG HTTP Server listens on all interfaces and offers no bind address. Apart from the Origin check there was no authentication.

Start.vi now has an optional bearer token, which is the real protection, and an optional client allow-list. By default the list allows only this computer.

Fixing the tests also exposed an existing bug: every server after the first got the first server's id. That fix is the first commit.

Before Now
Request from another computer answered refused with 403 unless allowed (Allowed clients, * for anyone)
Access token set, request without or with a wrong token — 401 with WWW-Authenticate: Bearer
Second server started in the same LabVIEW got the first server's id; stopping it broke the first gets its own id

Changes

  • Generate Unique Server ID.vi (modified, in place): it checked whether id n was taken but returned n+1. It now returns the id it checked. The first server still gets 1, and the second gets 2 instead of 1.
  • Start.vi (modified, in place): two new optional inputs, Allowed clients (array of strings) and Access token (string), stored per server id. Its description has an access-control section:
    • the server listens on all interfaces
    • client names come from reverse DNS and can be spoofed
    • a server reachable from other computers needs a token
    • the default refuses non-local clients on purpose
  • Check Client Access.vi (new, private):
    • Client: an empty list allows a loopback literal, localhost or this computer's own names (short name, FQDN, IP, looked up once at Start). * allows anyone. Entries match case-insensitively, without forward lookups. Failing clients get 403 Forbidden: client not allowed.
    • Token: scheme case-insensitive, token exact. Failing requests get 401 Unauthorized: missing or invalid bearer token.
  • Server Access Settings.vi (new, private FGV): the settings per server id.
  • Process HTTP Request.vi (modified, in place): reads the client host (Get Request → Get Client URI → Get Host) and the Authorization header. Check Client Access runs before the Origin and protocol checks (403 first, then 401) and adds WWW-Authenticate: Bearer to a 401.
  • readme.md: new section on access control.
  • Tests: new Tests 61 and 62.

What the server can know about a client

The client "address" the IG server provides is a host name, not an IP address: its TCP listener resolves the peer address by reverse DNS. Measured:

Client connects via Host as the server sees it
127.0.0.1, localhost, 127.0.0.2 this computer's short name
its own LAN IP this computer's FQDN
::1 not possible (LabVIEW TCP is IPv4 only here, error 54)

The raw TCP connection is not reachable through IG's public API. On Windows a client on the local network can influence its reverse-DNS name (NetBIOS/LLMNR), so the allow-list cannot be a security boundary. That is why the token exists, and why the documentation says so.

Code summary

Orange numbered boxes in each picture match the numbered points below it. Click a picture to see it full size. This summary covers only this pull request's changes. The CI VI diff also contains the VIs of #30, #31 and #33, because they are not merged yet. A detailed diff of this pull request alone, with every case frame was produced locally with the script from #29.

VI Status Change in one line
Generate Unique Server ID.vi modified Returns the id it checked, so the second server gets 2 instead of 1
Start.vi modified New optional inputs Allowed clients and Access token, stored per server
Server Access Settings.vi added FGV holding the settings and this computer's names per server id
Check Client Access.vi added Client check (403) and token check (401), with the header to add
Process HTTP Request.vi modified Feeds client host and Authorization into the checks; adds WWW-Authenticate
Tests added Tests 61 and 62

Generate Unique Server ID.vi — modified

  1. The loop's id is now incremented before the "is it taken?" check, not after it…
  2. …so the id that leaves the loop is the one that was checked. Before this, the second server got id 1 as well, and stopping it removed the first server's record.

Start.vi — modified

  1. New: Server Access Settings.vi stores Allowed clients and Access token under the id Server FGV has just given the new server.
  2. The two new optional controls. Their labels overlap on the diagram (see Known rough edges).

Server Access Settings.vi — added

A per-server-id store: two arrays (allowed clients, tokens) plus this computer's names, read on every request and written by Start.vi. Its visible False frame is the read. The write frame:

  1. This computer's names, looked up once per write: String To IP of an empty name gives this computer's address, and IP To String gives the FQDN. Both are lower-cased, and the short name is the part before the first dot.
  2. The address itself, as a dotted IP.
  3. The id's entry is replaced in the stored arrays, or appended if the id is new.

Check Client Access.vi — added

  1. Client allowed? * allows anyone. With an empty list: a host starting 127., ::1 or ::ffff:127., localhost, or one of this computer's names. Otherwise the host must equal an entry, case-insensitively.
  2. Token, only when one is set: the Authorization header is split at the first space, the scheme must equal bearer case-insensitively, and the rest must equal the token exactly.
  3. The 401 and 403 bodies, both id: null and code -32600. A refused client wins over a bad token, because the client check comes first.
  4. The header to set: WWW-Authenticate: Bearer on a 401. Otherwise Content-Type: application/json again, which changes nothing.
  5. Reads the settings for this server id.

Process HTTP Request.vi — modified

  1. New: reads the Authorization request header.
  2. New: Get Request → Get Client URI gives the client host (the reverse-DNS name). Both feed Check Client Access, whose status and payload replace Validate HTTP Request's when the request is refused.
  3. New: Set Header adds the header Check Client Access chose (WWW-Authenticate: Bearer on a 401).

Tests — added

  • Test 61 (test access allowed clients.vi): a second server on port 37061 allowing only 192.0.2.1 answers tools/list from this computer with 403, application/json, code -32600 and the exact message.
  • Test 62 (test access bearer token.vi): a second server on port 37062 with token test-token-62:
    • no header → 401 with WWW-Authenticate: Bearer
    • wrong token → 401
    • bearer test-token-62 → 200
    • lower-case authorization header name → 200
    • the token never appears in a response
  • Both stop their server only after a successful start.

Verified

On the runner: all 63 Caraya tests and the protocol tester passed, and all VIs were compared. The package build fails for every pull request until #32 is applied.

Locally, in 64-bit LabVIEW 2026, inside the project:

  • Full Caraya suite, three runs in a row: 209 PASS, 0 FAIL, exit code 0.
  • Protocol tester: 24 of 24 required checks.
  • Negative control: Test 61 with a wrong expected message fails on that assertion, with exit code 1. Restored and read back from disk, the hash is unchanged.
  • The default still allows this computer: all 197 earlier assertions pass unchanged.
  • Examples: Datalogger, Full Featured and Simple still compile.
  • Saved files: all 8 changed VIs are LabVIEW 20.0 with their library.

Not verified

  • A client on another computer, allowed or refused. Test 61 can only show the refusal, using an allow-list without this computer.
  • LabVIEW 2020 itself.
  • The package build: it fails on the runner for every pull request until Give the VIPM package build enough time on the runner #32 is applied.

Known rough edges

  • The allow-list is best-effort, by design, because the server only sees reverse-DNS names.
  • Stop.vi returns IG error -2132869109 (from Endpoint:Close) when a client connected shortly before. This is existing behaviour; the new tests clear exactly that code. Stop.vi may want to tolerate it.
  • Cached host names. This computer's names are read when Start.vi runs, so a host-name change needs a restart.
  • Overlapping labels. In Start.vi, the labels of the two new controls overlap on the diagram.
  • A no-op header. On responses other than 401, Process HTTP Request re-sets Content-Type: application/json, which changes nothing. The in-place edit could not add a conditional header path, because the generator refuses class-typed controls.

Follow-up for the maintainer

Ask IlluminatedG for a bind address in Server:Ctor / Init TCP, or for the raw peer address (resolve remote address = FALSE). With either, the server could bind to localhost or check real IP addresses instead of names.

Maintainer steps

None. Merge #30, #31 and #33 first.

🤖 Generated with Claude Code

CalmyJane and others added 5 commits October 18, 2026 08:22
A long tool call gave the client no feedback and could not be stopped:
every request was answered with one JSON response after the tool ended.

A tools/call with _meta.progressToken and an Accept header that includes
text/event-stream is now answered as a Server-Sent Events stream, in
both protocol eras:
- the tool calls Report Progress.vi, and each call becomes a
  notifications/progress event (progress strictly increasing, optional
  total and message)
- the result follows as the last event
- Process HTTP Request.vi starts such a call asynchronously and returns
  the stream at once
All other requests are answered exactly as before.

Cancellation:
- 2026-07-28: the client closes the stream. The framework then stops
  taking events, which Report Progress.vi and Cancel Requested.vi
  notice when an event is not taken within about a second.
- Older versions: notifications/cancelled is recorded before the request
  reaches the serialised handler and answered with 202. It reaches
  streamed calls; a non-streamed call still blocks other requests.
- A cancelled call sends no result.

New VIs and class:
- Report Progress.vi, Cancel Requested.vi (public): the tool side.
- MCP SSE Response.lvclass: child of the IG HTTP Utils Streamable
  Response, takes its chunks from a queue; sets the SSE headers and
  Transfer-Encoding: chunked.
- Prepare Request Dispatch.vi: records legacy cancellations and decides
  whether a call streams.
- Start Streamed Request.vi, Run Streamed Request.vi: run a streamed
  call asynchronously and end the stream.
- Validate MCP Request.vi: the 2026-07-28 request checks, moved out of
  Handle MCP Request.vi, which now also passes the stream to the tool.
- Stream State.vi, Wait For Stream Drain.vi, Get Request Stream.vi,
  Legacy Cancellations.vi: state and helpers.

The readme describes progress and cancellation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New fixture fake tool progress.vi reports ten steps and stops when told
it is cancelled; Progress Fixture Record.vi keeps how far it got;
Add Fixture Progress Tool.vi registers it.

- Test 58: a call with progressToken streams ten progress events with
  that token, strictly increasing, then the result (legacy call with a
  string token, 2026-07-28 call with a numeric token); the same call
  without a token gets plain JSON
- Test 59: a raw TCP client closes the stream after the first event;
  the tool stops before step 10 and reports cancellation
- Test 60: notifications/cancelled for a running streamed call is
  answered with 202 within a second, the tool stops early and no result
  is sent

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Generate Unique Server ID.vi checked whether id n was taken but returned
n+1, so the second server got the first server's id. Stopping the
second server then removed the first one's record, and the first
server's Stop failed with error 1556. The id it returns is now the one
it checked; the first server still gets 1, the next 2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The IG HTTP Server listens on all network interfaces (Init TCP.vi uses
0.0.0.0 and offers no bind address), so every MCP server built with the
toolkit could be called from the whole network, with no authentication
apart from the Origin check.

Start.vi has two new optional inputs:
- Access token: when set, every request needs
  "Authorization: Bearer <token>" (scheme case-insensitive, token
  exact); otherwise 401 with WWW-Authenticate: Bearer. The token is
  never logged or echoed.
- Allowed clients: client host names as the server sees them. Empty
  (the default) allows only this computer (loopback, localhost, its own
  names), "*" allows anyone; others get 403.

The server never sees the client's IP address, only the name IG gets by
reverse DNS, and such names can be spoofed on a local network. The
allow-list is therefore a best-effort filter, and the token is the
protection; Start.vi and the readme say so. Behaviour change: clients
that do not report as this computer are refused unless allowed.

New VIs:
- Check Client Access.vi: the client and token checks, run before the
  Origin and protocol checks (403, then 401).
- Server Access Settings.vi: the settings per server id.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Test 61: a second server that allows only 192.0.2.1 answers a request
  from this computer with 403 and the error body
- Test 62: a second server with an access token answers 401 with
  WWW-Authenticate: Bearer without or with a wrong token, and 200 with
  the token (lower-case scheme and header name too); the token never
  appears in a response

Both stop their server only if it started. Stop.vi's IG close error
-2132869109, which appears when a client connected shortly before, is
cleared after Stop; any other Stop error still fails the test.

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

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Tests

✅ All 63 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: 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: 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: pass
fake_tool_array_shapes: pass
fake_tool_array_shapes: pass
fake_tool_array_shapes: 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_array_shapes: pass
fake_tool_array_shapes: pass
fake_tool_schema_shapes: pass
fake_tool_schema_shapes: pass
fake_tool_schema_shapes: pass
fake_tool_schema_shapes: pass
fake_tool_schema_shapes: pass
Test 47: tools/call converts timestamps, clusters, enums and 2D and 3D arrays test tools call schema shapes.vi ✅ 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
fake_tool_schema_shapes: pass
fake_tool_schema_shapes: pass
fake_tool_schema_shapes: pass
fake_tool_schema_shapes with timestamp 2026-10-17T12:34:56Z -> no isError, time out 2026-10-17T12:34:56.000Z: 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: 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: pass
fake_tool_schema_details: pass
fake_tool_schema_details: pass
fake_tool_schema_details: pass
fake_tool_schema_details: pass
fake_tool_schema_details: pass
fake_tool_schema_details: pass
fake_tool_schema_details: 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_required_input without arguments (id 503) -> isError true and no structuredContent: pass
fake_tool_picture_outputs: pass
tools/call fake_tool_return_error with status true (id 501) -> isError true and no structuredContent: pass
fake_tool_picture_outputs: 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_return_error with status false (id 502) -> structuredContent carries the error cluster output as an ordinary object: 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: pass
fake_tool_picture_outputs: pass
fake_tool_picture_outputs: 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_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 2025-11-25 (id 542) -> 2025-11-25: pass
server/discover -> capabilities tools, prompts and resources (as initialize), _meta serverInfo, ttlMs 60000, cacheScope public: 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
Test 55: modern requests are refused when their headers do not match the body test modern headers.vi ✅ pass tools/call with an Mcp-Name that is not params.name (id 554) -> 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 without an Mcp-Name header (id 551) -> 400 with error -32020: pass
MCP-Protocol-Version 2025-11-25 while _meta says 2026-07-28 (id 553) -> 400 with error -32020: pass
Mcp-Method prompts/list on a tools/list request (id 55) -> 400 with error -32020: pass
Test 56: unsupported versions, missing capabilities and unknown methods in the modern era test modern errors.vi ✅ 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
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 without io.modelcontextprotocol/clientCapabilities (id 562) -> 400 with error -32602: 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
Test 57: elicitation by input_required and retry with inputResponses test elicitation.vi ✅ 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
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 decline (id 572) -> outcome declined: pass
retry with inputResponses confirm_action accept (id 571) -> complete result with outcome confirmed: pass
Test 58: progress notifications as Server-Sent Events for tools/call test progress notifications.vi ✅ 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
id 581: the JSON-RPC result is the last data event, after progress 10: 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
the tool finished all 10 steps (fixture record): pass
legacy tools/call with progressToken "t58" and Accept text/event-stream (id 581) -> HTTP 200, text/event-stream: 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
legacy streamed tools/call over raw TCP (id 601) -> text/event-stream, the first progress event arrives: 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 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 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
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

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) 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: 24 of 24 passed. Advisory: 0 failed.

VI changes

Open the full VI diff

VIs: 6 modified, 25 added, 0 deleted

VI Changes Changed spot, now
Generate Unique Server ID.vi
src/MCP Server
2
Handle MCP Request.vi
src/MCP Server
4
Process HTTP Request.vi
src/MCP Server
4
Set MCP Request Context.vi
src/MCP Server
4
Start.vi
src/MCP Server
5
Test_MCP_Server.vi
tests
2
Added VIs (25)
VI Block diagram
Cancel Requested.vi
src/MCP Server
Check Client Access.vi
src/MCP Server
Get Request Stream.vi
src/MCP Server
Legacy Cancellations.vi
src/MCP Server
Abort Stream.vi
src/MCP Server/MCP SSE Response
Create MCP SSE Response.vi
src/MCP Server/MCP SSE Response
Get Queues.vi
src/MCP Server/MCP SSE Response
Next Segment.vi
src/MCP Server/MCP SSE Response
Stream Length.vi
src/MCP Server/MCP SSE Response
Prepare Request Dispatch.vi
src/MCP Server
Report Progress.vi
src/MCP Server
Run Streamed Request.vi
src/MCP Server
Select Value.vim
src/MCP Server
Server Access Settings.vi
src/MCP Server
Start Streamed Request.vi
src/MCP Server
Stream State.vi
src/MCP Server
Wait For Stream Drain.vi
src/MCP Server
Add Fixture Progress Tool.vi
tests
Progress Fixture Record.vi
tests
fake tool progress.vi
tests
test access allowed clients.vi
tests
test access bearer token.vi
tests
test progress cancel by close.vi
tests
test progress legacy cancel.vi
tests
test progress notifications.vi
tests

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

@JanGoebel JanGoebel closed this Oct 18, 2026
@JanGoebel JanGoebel reopened this Oct 18, 2026
CalmyJane and others added 2 commits October 18, 2026 17:48
Brings in the VIPM build timeouts of the live workflows, so this pull
request's checks run with them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in the VIPM build timeouts of the live workflows, so this pull
request's checks run with them.

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

Copy link
Copy Markdown
Owner Author

Update: merged main into this branch. Nothing in this pull request changed. The merge brings in the new VIPM build timeouts of the live workflows (#32 plus the workflow commits on main), so the package build gets enough time. The same merge made #30's build pass (run 39130683128). A new run is queued.

JanGoebel pushed a commit that referenced this pull request Oct 18, 2026
Closing LabVIEW alone does not explain or fix #29's failure: the runner
already terminates LabVIEW and VIPM at the end of every job. The error
names Get Tool.vi as the caller of the missing Tool Annotations.ctl and
Tool Hint.ctl, and Get Tool.vi is identical on #29 and #34. The
repository's VIs are saved source-only, so their compiled code lives in
LabVIEW's compiled object cache, keyed by file path; Get Tool.vi's entry
was compiled against #34's Tool Data.ctl and stayed valid because the
checkout did not change the file.

With -Fix -CleanStart the resolver now also deletes the cache folder of
the test/build LabVIEW's version (Documents\LabVIEW Data\VIObjCache\
20.0.0r0 for LabVIEW 2020), after closing that LabVIEW, and notes it in
the job summary. LabVIEW rebuilds it from this checkout's files, at the
cost of compiling the VIs once per job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CalmyJane and others added 3 commits October 20, 2026 00:02
#31 split Handle MCP Request.vi into one subVI per step, and this branch
had changed the old single VI. The binary VI cannot be merged, so this
branch's changes are re-applied to the split VIs in place:

- Set MCP Request Context.vi gets a "stream" input and adds "id",
  "progressToken" and "stream" to the request context.
- Handle MCP Request.vi passes its new "stream" input on to it.
- Prepare Request Dispatch.vi calls Read MCP Request Metadata.vi and
  Check Modern MCP Request.vi instead of Validate MCP Request.vi.

Validate MCP Request.vi is no longer called anywhere and is removed from
the library and the repository.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in #31's split of Handle MCP Request.vi, re-applied on
progress-and-cancellation, and the current main. The only conflict was the
library's member list: both branches added VIs to the same folder, and
both sets are kept.

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

Copy link
Copy Markdown
Owner Author

Update: merged the rebuilt #33 and main (60c0b27)

@JanGoebel
JanGoebel merged commit 5116814 into main Oct 20, 2026
2 checks passed
metman-oss pushed a commit to metman-oss/LabVIEW-MCP-Server-Toolkit that referenced this pull request Oct 21, 2026
JanGoebel#29's package build failed with "The following source VIs or Libraries
are missing: Tool Annotations.ctl, Tool Hint.ctl", files JanGoebel#29 does not
have. The job before it built JanGoebel#34, whose branch has them, in the same
workspace path, and LabVIEW 2020 was still running with that job's
MCP Server.lvlib in memory. The clean start only ended LabVIEW when a
leftover VIPM Desktop was found.

With -Fix -CleanStart (the first step of every job) the resolver now
also closes the LabVIEW chosen for the tests and the build if it is
running, and says so in the job summary. LabVIEW CLI and VIPM start it
again with this checkout's files. The check after the package install
does not pass -CleanStart and keeps what the install started.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

2 participants