mcp_dart 2.3.0
mcp_dart 2.3 adds the final MCP 2026-07-28 surface while
preserving the public 2.2.2 API. See the
2.2 to 2.3 migration guide
for upgrade steps and the
MCP 2026-07-28 transition guide
for protocol details.
Added
- Added an SDK-owned offline validator with public Draft 2020-12 and declared
Draft 7 APIs, removing thejson_schemaandquiverdependencies. - Added dual-era protocol profiles,
server/discover, stateless metadata,
subscriptions/listen, multi-round tool/resource/prompt callbacks, the
independently pinned experimental Tasks extension, and any-root structured
tool results for MCP2026-07-28. - Added stateless registration helpers and a backward-compatible
RegisteredStatelessToolhandle without widening the existing 2.2.2
registration interfaces.
Changed
McpProtocol.stablenow prefers MCP2026-07-28and falls back to legacy
initialization. Silent body-only discovery probes are bounded to five
seconds;McpProtocol.legacyretains exact initialization-only behavior.- Preserved the 2.2.2 values of
latestProtocolVersionand
supportedProtocolVersions; usedefaultProtocolVersionand
allSupportedProtocolVersionsfor the dual-era profile. - Hardened JSON-RPC parsing, protocol-era isolation, capability and metadata
validation, request direction, notification routing, and error-code mapping
while preserving legacy wire behavior. - Aligned stateless identity, discovery caching, tracing metadata,
request-scoped logging, and required client capabilities with MCP
2026-07-28. - Hardened OAuth discovery and authorization-code flows with exact issuer
matching, safe redirects, endpoint validation, client registration priority,
and issuer/resource-bound tokens. - Restricted legacy server-initiated requests and global list/resource update
helpers to initialization-era sessions; stateless interactions use embedded
input requests and acknowledged subscriptions. - Tool input-schema failures now return
CallToolResult(isError: true)under
MCP2025-11-25and2026-07-28; invalid registered schemas and output
contract violations are reported as server errors. - Structured output validation now compiles schemas before handler side
effects and preserves the accepted schema for task-backed results. - Tasks and
subscriptions/listennow enforce their independent capabilities,
status shapes, acknowledgment scope, URI boundaries, and cancellation
lifecycle. - Stateless stdio clients recover from bounded child failures and restore
subscriptions without replaying ordinary requests. - Streamable HTTP now isolates concurrent requests, promotes responses to SSE
when intermediate traffic requires it, and cancels pending work promptly on
disconnect. mcp_dart inspect-servernow accepts protocol-appropriate array and primitive
output schemas.
Fixed
- Registered tool, prompt, resource, and resource-template handles now remove
and rename their registrations consistently. - Stdio legacy fallback now starts a fresh child when the initial
server/discovercompatibility probe causes the server process to exit. - Malformed newline-delimited frames no longer strand valid messages later in
the same input chunk. - Shutdown, restart, request-ID reuse, subscription cancellation, and
response-stream races no longer leak work or cross request boundaries.
Validation and documentation
- Added public API compatibility checks against
mcp_dart 2.2.2, minimum-Dart
dependency testing, and pinned core, Tasks, and JSON Schema conformance data. - The official alpha.10 MCP
2026-07-28client and server suites pass with no
expected failures, including all 25 OAuth scenarios. - Published TypeScript SDK 2.0.0 and Python SDK 2.0.0rc1 interoperate
bidirectionally on the post-#3002 discovery wire.
Breaking and compatibility notes
DiscoverResult.serverInfois now nullable because MCP2026-07-28permits
anonymous servers. Check fornullbefore reading identity fields. MCP
2025-11-25behavior is unchanged.mcp_dart 2.3requires Dart 3.4 or newer; the CLI requires Dart 3.12.- The direct
httpconstraint is now^1.5.0because cancellation uses APIs
introduced in 1.5. Normal^1.4.0constraints remain compatible, but pins
below 1.5 must be updated. - Stateless stdio clients now restart an unexpectedly terminated child by
default and restore activesubscriptions/listenrequests. Set
StdioServerParameters.restartOnUnexpectedExittofalseto retain the
prior close-on-exit behavior. Ordinary in-flight requests are never replayed. ProtocolOptions.taskStoreandtaskMessageQueueremain available for MCP
2025-11-25 task augmentation and may coexist with the independent Tasks
extension, whose handlers and persistence remain application-owned.- OAuth providers now treat a non-empty
clientIdas pre-registered client
information. Return an emptyclientIdonly to opt into deprecated Dynamic
Client Registration. - OAuth discovery and token endpoints on another origin now require an
explicitoauthUriValidator; client redirect URIs must use HTTPS or loopback
HTTP, and malformed or incomplete metadata is rejected. - The exact v2.2.2
finishAuth(String)override remains available but is
deprecated. New integrations should usefinishAuthRedirectto validate the
returnedstateand optional issuer. - A schema-invalid
tools/callnow completes at the JSON-RPC level and returns
a tool error result instead of throwingMcpError(ErrorCode.invalidParams).
InspectCallToolResult.isErrorinstead; MCP2025-06-18and earlier peers
retaininvalidParams. - Under MCP
2025-11-25and2026-07-28, an invalid registered input or output
schema or invalid server-produced output returns JSON-RPCinternalError.
Malformed call parameters continue to returninvalidParams. - Clients now reject successful tool results that omit
structuredContentwhen
the advertisedoutputSchemarequires it. MCP2025-11-25and earlier
clients retain object-root compatibility; MCP2026-07-28accepts any JSON
root. - Under MCP
2025-11-25, task-mode negotiation now runs before input-schema
validation. Task-required or task-forbidden negotiation failures return
methodNotFound; earlier protocol versions retaininvalidParams. CallToolResult.extraentries namedcontent,isError,_meta, or
structuredContentno longer replace protocol-owned fields. Use their
dedicated constructor parameters.