Repository navigation
Serve MCP 2026-07-28 next to the initialize handshake, with elicitation - #31
Conversation
The server spoke only the handshake-based versions up to 2025-06-18. Clients that speak only MCP 2026-07-28, which is stateless and has no initialize, could not use it, and a tool had no way to ask the user anything. Each request is now judged on its own: - A request with io.modelcontextprotocol/protocolVersion in _meta is served as 2026-07-28. Its headers (MCP-Protocol-Version, Mcp-Method, Mcp-Name, base64 values decoded) must match the body (otherwise 400, -32020). It needs clientCapabilities (otherwise 400, -32602), and unknown methods, including ping, are 404 / -32601. Results carry resultType and serverInfo in _meta, and lists and resources/read carry ttlMs and cacheScope. A missing resource is -32602. server/discover is new. - Anything else takes the old path unchanged. 2025-11-25 is added to the versions initialize negotiates, and it is now the fallback for an unknown requested version. - An unsupported MCP-Protocol-Version header is answered with 400 and -32022 listing every supported version, in both eras, so clients that speak both recognise the server. Elicitation follows the 2026-07-28 multi round-trip pattern: a tool that asks returns input_required with an elicitation/create form, and the client calls the tool again with the answer. Older clients and clients without the elicitation capability get "not supported" in the tool. New VIs: - Handle MCP Request.vi: per-request era detection, validation, HTTP status and the 2026-07-28 result fields. - Ask User.vi, Confirm With User.vi (public): ask the user from inside a tool; pending on the first run, the answer on the retry. - Cache Hints.vi: the ttlMs and cacheScope per method, in one place. - Build Unsupported Version Error.vi: the -32022 error body. Requests are still handled one at a time, as before (Process HTTP Request.vi is not reentrant). The readme describes both protocol eras and how to use elicitation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New fixture fake tool confirm.vi asks for confirmation with Confirm With User.vi and reports which path it took; Add Fixture Confirm Tool.vi registers it. - Test 53: 2026-07-28 tools/list has resultType, ttlMs, cacheScope and serverInfo; a legacy tools/list has none of them - Test 54: server/discover fields and versions; initialize never negotiates 2026-07-28 - Test 55: header checks, including lower-case header names and a base64 Mcp-Name - Test 56: unsupported version, missing capabilities, unknown method, ping and resources/read errors for 2026-07-28 requests - Test 57: elicitation (input_required, accept, decline, no capability, legacy request) Changed on purpose: - Test 11 expects -32022 instead of -32600 for an unsupported MCP-Protocol-Version header - Test 29 expects the fallback 2025-11-25 instead of 2025-06-18, the newest version initialize can negotiate Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tests✅ All 58 tests passed. Per-test results
Protocol tests✅ Protocol tester output (0 failed required checks)VI changesVIs: 7 modified, 18 added, 0 deleted Added VIs (18)Report for commit 26089fc. The installable test package is under Artifacts of this run once the build job has finished. |
|
The |
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>
|
Update: merged |
PR #30 was merged into main; this brings main's CI and diff-report changes (#29, #35) into the branch. The toolkit and test files that both branches touched are PR #30's final versions on main, which this branch already builds on, so the branch's versions are kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Handle MCP Request.vi was one flat diagram of about 120 nodes, which made the request path hard to follow and review. It is now a short pipeline of subVIs, one per step, with the same interface, description and icon, and the same behaviour. New private subVIs in MCP Server.lvlib (Private/SubVIs): - MCP Request Metadata.ctl: typedef for what is read from a request (method, id, era, discover, batch, protocol version, client capabilities, name or uri, elicitation, input responses). - Read MCP Request Metadata.vi: reads that metadata and decides whether the request is 2026-07-28 or legacy. - Check Modern MCP Request.vi: the 2026-07-28 checks in their original order, returning the refusal status and response. - Set MCP Request Context.vi: puts the request context into the queue Ask User reads while a tool runs. - Collect MCP Input Requests.vi: collects the questions a tool asked and releases both queues. - Complete Modern MCP Result.vi: adds resultType, serverInfo and cache hints, answers server/discover, maps resource-not-found and builds input_required. The legacy path still calls Handle Server Request Batch.vi unchanged. Diagrams are auto-arranged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Update: two pushes since the last update.
Tests: on the runner, 58 of 58 Caraya tests and 24 of 24 required protocol checks passed, and every VI was compared. The results were the same locally in 64-bit LabVIEW 2026. Open: |
Brings in #36, which keeps tools/ out of the VI package; the test build failed on the duplicate Print Diagram Frames.vi it removes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Update: merged main (26089fc)
|
#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>
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>
Ask User.vi, Confirm With User.vi, Report Progress.vi and Cancel Requested.vi are public since JanGoebel#31 and JanGoebel#33, but the package's Functions palette still listed only Start, Add Tool, Add Prompt, Add Resource (File) and Stop, with Stop twice (once at row 0, outside the visible grid). The MCP Server SDK palette now has one row with the five basic VIs and an "Advanced" sub-palette below them, holding the four VIs a tool calls while it runs: Ask User, Confirm With User, Report Progress and Cancel Requested. The duplicate Stop entry is gone. The sub-palette icon follows the style VIPM generated for the main palette icon (text on white, the company band at the bottom). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

























Summary
The server now also speaks MCP 2026-07-28, the current, stateless revision without
initialize, on the same endpoint. Older clients that start withinitializekeep getting exactly what they got before.On top of that, tools can ask the user (elicitation) through the 2026-07-28 multi round-trip pattern. For example, a tool can confirm with the user before it moves hardware.
initialize)_metaversioning, header checks,resultType,serverInfo, caching hintsserver/discoverinitializenegotiatesMCP-Protocol-Versionheader-32600-32022with the supported versionsConfirm With User.vi/Ask User.vi→input_required, answer on the retryChanges
Handle MCP Request.vi(new): decides the era per request; a request is 2026-07-28 whenparams._metacarriesio.modelcontextprotocol/protocolVersion.For those requests it checks, in this order:
MCP-Protocol-Versionheader vs_meta(400, -32020)Mcp-Method(400, -32020)Mcp-Name, base64-decoded first (400, -32020)clientCapabilities(400, -32602)ping(404, -32601)It then:
server/discoverresultType,_meta.serverInfoand, via Cache Hints,ttlMs/cacheScopeinput_requiredresultLegacy requests take the old path unchanged.
Each step is its own private subVI, all new:
Read MCP Request Metadata.vi,Check Modern MCP Request.vi,Set MCP Request Context.vi,Collect MCP Input Requests.viandComplete Modern MCP Result.vi. They pass the request's metadata as the typedefMCP Request Metadata.ctl.Ask User.vi,Confirm With User.vi(new, public): ask the user from inside a tool.pendingand register anelicitation/createform.elicitationcapability, they returnnot supported.Cache Hints.vi(new):ttlMs/cacheScopeper method, kept in one place:server/discoverresources/readBuild Unsupported Version Error.vi(new): the -32022 body withdata.supportedanddata.requested.Supported Protocol Versions.vi(modified): still the single list. It now has three outputs:initializenegotiates fromIs Supported Protocol Version.vi,Validate HTTP Request.vi(modified): accept 2026-07-28 headers, and answer an unsupported version with -32022.Process HTTP Request.vi(modified):Mcp-MethodandMcp-Namereadme.md: new sections on protocol versions and elicitation.Tests:
fake tool confirm.viand its registration VICode summary
Handle MCP Request.viProcess HTTP Request.viValidate HTTP Request.viSupported Protocol Versions.viCache Hints.viAsk User.vi,Confirm With User.viIs Supported Protocol Version.vi,Build Unsupported Version Error.viHandle MCP Request.vi— addedThe new entry point for every request body. A request is treated as 2026-07-28 when
params._metacarriesio.modelcontextprotocol/protocolVersion. Anything else takes the old path unchanged. The diagram is a short pipeline: each step is its own private subVI, and the per-request metadata travels between them as one typedef cluster,MCP Request Metadata.ctl.Read MCP Request Metadata.vireadsmethod,id, the_metaprotocol version and client capabilities,params.name/params.uri,inputResponsesandelicitation. It also decides the era and flagsserver/discoverand batches.Check Modern MCP Request.viruns the checks for 2026-07-28 requests, in order. Each failed check picks its HTTP status (400 / 404), its code and its message:_metaversion: -32020Mcp-Method: -32020Mcp-Name, base64-decoded first: -32020Set MCP Request Context.viputs the era, capabilities andinputResponsesinto the "MCP Request Context" queue, so that Ask User can read them while the tool runs.server/discover, nothing is handled. Otherwise the False frame calls the unchangedHandle Server Request Batch.vi, exactly as before. This is why Tests 1–52 are unchanged.Collect MCP Input Requests.vicollects the questions a tool registered in "MCP Input Requests" and releases both queues.Complete Modern MCP Result.viaddsresultType,_meta.serverInfoand the cache hints, answersserver/discover, maps "resource not found" to -32602, and buildsinput_requiredwhen a tool asked something. Legacy responses pass through untouched.responseandstatus code.Handler frame (step 4, False):
The five subVIs, whole diagrams
Read MCP Request Metadata.viCheck Modern MCP Request.viSet MCP Request Context.viCollect MCP Input Requests.viComplete Modern MCP Result.viProcess HTTP Request.vi— modifiedMcp-MethodandMcp-Namerequest headers.Request Header.vicall that reads them.Handle MCP Request.vi, which replacesHandle Server Request Batch.vihere. The old 200/202 decision is gone, because the status now comes from Handle MCP Request.Validate HTTP Request.vi,Supported Protocol Versions.vi— modifiedMCP-Protocol-Versionheader now gets its body fromBuild Unsupported Version Error.vi: -32022 withdata.supported(all versions) anddata.requested.Cache Hints.vi— addedserver/discoverand the four list methods are cacheable.resources/readgets 0, because files can change at any time.public, since no result depends on the caller.Ask User.vi,Confirm With User.vi— addedAsk User reads the request context. On a retry that carries
inputResponses.<key>, it returns that answer. On a 2026-07-28 request from a client that declaredelicitation, it registers the question and returnspending. Otherwise it returnsnot supported. Confirm With User calls it with an empty schema and turns the action into three Booleans.Ask User, register frame (True):
{"<key>":{"method":"elicitation/create","params":{"mode":"form","message":…,"requestedSchema":…}}}. The key and message are JSON-escaped by the JSONtext calls, which this local rendering shows as grey "?". The CI report has them.{"type":"object","properties":{}}.Confirm With User
Tests — added and changed
test modern tools list.vi): a 2026-07-28 tools/list has resultType, ttlMs, cacheScope and serverInfo; a legacy one has none of them.test server discover.vi): the server/discover fields; initialize never negotiates 2026-07-28.test modern headers.vi): header mismatches, lower-case header names, a base64Mcp-Name.test modern errors.vi): unsupported version, missing capabilities, unknown method, ping, resources/read.test elicitation.vi): input_required, accept, decline, no capability, legacy request, using the fixturefake tool confirm.vi.Verified
After the split of Handle MCP Request.vi (commit
0c9ad88): on the runner, all 58 Caraya tests and 24 of 24 required protocol checks passed, and every VI was compared, including the six new files. Locally, in 64-bit LabVIEW 2026, the same results: 182 PASS, 0 FAIL; protocol tester 24 of 24. All new files are LabVIEW 20.0, source-only, owned byMCP Server.lvlib, and runnable. The interface, description and icon ofHandle MCP Request.viare unchanged. The split is a pure restructure, so no test changed and no new negative control was run.Before the split:
On the runner: all 58 Caraya tests and the protocol tester passed, and all VIs were compared. For the package build, see the update comment.
Locally, in 64-bit LabVIEW 2026, inside the project, after reopening it so the saved files ran:
ttlMsfails on exactly that assertion (Tests 55–57 then show Caraya's usual cascade errors). It passes again once restored, and the wrong value never reached disk..lvlibdiffs only add items.Not verified
Known rough edges
Process HTTP Request.viwas already non-reentrant on main, so requests were handled one at a time before too. Handling requests in parallel would mean making the request path reentrant, which belongs in its own pull request.initialize.viwith a synthetic request. It also rewrites the server's own parameter table, with the same values.tools/calland only in form mode, not URL mode.initializewith 2026-07-28_metagets 404, sinceinitializebelongs to the legacy era.Supported Protocol Versions.vi, the labels "modern versions" and "all versions" overlap.Maintainer steps
None. The package build (
test-build) fails on every pull request since #29 was merged, because the build job checks main'stools/ciout into_ci/inside the workspace and the.vipbpacks the whole repository, soPrint Diagram Frames.viis found twice. The fix is separate from this pull request.🤖 Generated with Claude Code