Repository navigation
Refuse other computers by default and add an optional bearer token - #34
Merged
Merged
Conversation
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>
Tests✅ All 63 tests passed. Per-test results
Protocol tests✅ Protocol tester output (0 failed required checks)VI changesVIs: 6 modified, 25 added, 0 deleted Added VIs (25)Report for commit 60c0b27. The installable test package is under Artifacts of this run once the build job has finished. |
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>
Owner
Author
|
Update: merged |
This was referenced Oct 18, 2026
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>
#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>
Owner
Author
|
Update: merged the rebuilt #33 and main (60c0b27)
|
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.































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.vinow 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.
Allowed clients,*for anyone)Access tokenset, request without or with a wrong tokenWWW-Authenticate: BearerChanges
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) andAccess token(string), stored per server id. Its description has an access-control section:Check Client Access.vi(new, private):localhostor 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 403Forbidden: client not allowed.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 theAuthorizationheader. Check Client Access runs before the Origin and protocol checks (403 first, then 401) and addsWWW-Authenticate: Bearerto a 401.readme.md: new section on access control.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:
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
Generate Unique Server ID.viStart.viAllowed clientsandAccess token, stored per serverServer Access Settings.viCheck Client Access.viProcess HTTP Request.viAuthorizationinto the checks; addsWWW-AuthenticateGenerate Unique Server ID.vi— modifiedStart.vi— modifiedServer Access Settings.vistoresAllowed clientsandAccess tokenunder the id Server FGV has just given the new server.Server Access Settings.vi— addedA 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:
String To IPof an empty name gives this computer's address, andIP To Stringgives the FQDN. Both are lower-cased, and the short name is the part before the first dot.Check Client Access.vi— added*allows anyone. With an empty list: a host starting127.,::1or::ffff:127.,localhost, or one of this computer's names. Otherwise the host must equal an entry, case-insensitively.Authorizationheader is split at the first space, the scheme must equalbearercase-insensitively, and the rest must equal the token exactly.id: nulland code -32600. A refused client wins over a bad token, because the client check comes first.WWW-Authenticate: Beareron a 401. OtherwiseContent-Type: application/jsonagain, which changes nothing.Process HTTP Request.vi— modifiedAuthorizationrequest header.Get Request→Get Client URIgives 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.Set Headeradds the header Check Client Access chose (WWW-Authenticate: Beareron a 401).Tests — added
test access allowed clients.vi): a second server on port 37061 allowing only192.0.2.1answers tools/list from this computer with 403,application/json, code -32600 and the exact message.test access bearer token.vi): a second server on port 37062 with tokentest-token-62:WWW-Authenticate: Bearerbearer test-token-62→ 200authorizationheader name → 200Verified
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:
Not verified
Known rough edges
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.Start.vi, the labels of the two new controls overlap on the diagram.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