Repository navigation
Pre-release review fixes: utcp_mcp - #23
Merged
Merged
Conversation
- Inline $refs under properties named default, enum, const, example or examples, and leave a ref with a non-UTF-8 escape in place instead of failing discovery. - Resource tools read the URI discovery advertised, kept per manual and server, instead of relisting resources and tools on every call. - A failed SSE fallback reports the streamable HTTP status and the SSE status. - McpHttpServer.fromJson reads transport/type, so SSE servers round-trip. - The legacy SSE test server speaks only MCP 2024-11-05. - Docs: SSE support, the SSE transport's httpClient option, Breaking changelog markers.
…mark the registration requirement breaking
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.
utcp_mcpno longer reads the wrong resource after a server's resource list changes, no longer drops$defsthat a property nameddefaultstill points into, and no longer fails a server's discovery over a malformed$ref. When the SSE fallback fails, the error now gives the streamable HTTP status too. Follow-up to #4, from the pre-release audit.Resource tools resolve to what discovery advertised
Before, every call to
resource_*listed resources and tools again and recomputed the names. After the server added a resource,resource_x_2(advertised asfile:///c) readfile:///b, and a once-uniqueresource_xturned into atools/call. Discovery now keeps each manual's name→URI map per server, and a call reads that URI without listing anything.sequenceDiagram participant C as UtcpClient participant P as McpCommunicationProtocol participant S as MCP server C->>P: registerManual P->>S: tools/list, resources/list P->>P: keep resource_x_1 → file:///a, resource_x_2 → file:///c Note over S: server adds file:///b C->>P: callTool resource_x_2 Note over P: before: list again, recompute → file:///b P->>S: resources/read file:///c C->>P: callTool resource_notes (not in the map) P->>S: tools/call resource_notesA name that isn't in the map is sent as
tools/call. That covers a real tool namedresource_*, a server whose resource listing failed with any error (before, only a JSON-RPC error was tolerated at call time), and a manual this protocol never registered, which the server then rejects. Deregistering a manual drops its map.Other fixes
$refinlining:default,enum,const,exampleandexamplescount as data only where a schema keyword can appear, not as keys ofproperties,patternProperties,$defs,definitions,dependentSchemasordependencies. A$refwhose pointer has a non-UTF-8 escape (%FF) stays in place, like an unresolved ref, instead of throwingFormatException.Could not connect to MCP server 'api': streamable HTTP answered 404, and the legacy HTTP+SSE transport failed: SSE connection request failed (HTTP 404). It contains only status codes; the test checks that the URL query, headers and token don't appear.McpHttpServer.fromJsonreadstransport/type, soMcpHttpServer.fromJson(sseServer.toJson())stays SSE. A non-HTTP transport there throws.McpProtocol.legacynarrowed to2024-11-05. Bothtype: sseand the 405 fallback now check thatinitializecompleted and that later requests carryMCP-Protocol-Version: 2024-11-05.httpClient, but then the caller has to close it, so both transports are still built insidehttp.runWithClient. The root README and the other packages' tables are updated in Pre-release review fixes: docs, interop and conformance reasons #20.authobject on an HTTP server, anyauthon stdio includingnull,ws:///wss://URLs) and{"type": "sse"}changing transport are marked Breaking:.Verification
dart format,dart analyze --fatal-infos: clean.packages/utcp_mcp: 139 tests pass on the VM, and the 120 unit tests pass on Chrome. Every new test fails without its fix.packages/utcp_conformance: 392 pass, with no fixture changes.tool/interop/run.sh(Python 3.12): passes.