Skip to content

SwiftMCP 1.15.0

Latest

Choose a tag to compare

@odrobnik odrobnik released this 28 Nov 16:57
· 10 commits to main since this release
02a83c1

The 2026-07-28 protocol revision is now on by default on both server and client, servers can publish events to webhooks, and the official Tasks extension is implemented. Servers stay dual-era, so clients on older revisions keep working unchanged.

🚀 2026-07-28 is the default (#252, #255, #256)

  • Server: MCPServer.advertisesModernEra now defaults to true and is an opt-out. server/discover lists 2026-07-28; initialize still negotiates the legacy revisions, so a client proposing 2026-07-28 there gets 2025-11-25.
  • Client: MCPServerProxy probes server/discover first and falls back to initialize. eraPreference (.legacy, .auto, .modern) chooses the behaviour, and the new preferredProtocolVersion proposes one specific revision (#228, #256).
  • Pushes: modern clients receive list-changed and resource-updated notifications through subscriptions/listen, a POST answered with a long-lived SSE stream (#248).
  • Streamable HTTP: CORS allows the Mcp-* headers, and a modern-only server (HTTPSSETransport.servesLegacyEra == false) answers GET and DELETE /mcp with 405 (#245, #246).
  • Utilities: modern requests get log notifications only at or above the logLevel in their own _meta; modern ping and logging/setLevel return -32601. Roots is deprecated (#249).
  • Results: ttlMs and cacheScope cache hints on list results, resources/read and server/discover, with MCPCacheHintProviding as the author hook. tools/list is sorted by name, and unknown inputSchema/outputSchema keywords round-trip (#243).
  • Tracing: traceparent, tracestate and baggage are parsed from _meta into RequestContext.Meta (#244).

📣 Events with webhook delivery (#204)

Servers declare event types with the new @MCPEvent macro, and clients on the modern revision subscribe a webhook to them.

  • Declare and list: @MCPEvent, also inside @MCPExtension extensions. events/list returns the declared types, and the capability is advertised only when there is at least one (#264).
  • Subscribe: events/subscribe and events/unsubscribe, with an in-memory store and a JSON-file store that survives restarts. Subscriptions are bound to the caller and expire unless refreshed (#266).
  • Deliver: emit validates the payload against the event's schema and sends each matching subscription a signed Standard Webhooks POST. Transient failures are retried with backoff and Retry-After, keeping the same webhook-id, and every delivery returns an outcome (#267, #273).
  • Safety: callbacks must be https, redirects are refused, and hosts resolving to private, loopback or link-local addresses are blocked (#265).
  • Client: MCPServerProxy can list, subscribe to and unsubscribe from events. The demo server emits a sample ci.failed event (#270).

⏳ Official Tasks extension (#223)

io.modelcontextprotocol/tasks is implemented: capability negotiation, tasks/get, tasks/update and tasks/cancel, task handles for opted-in tools, TTL and cancellation, and isolation between principals. tasks/list and tasks/result are not part of this release.

🔐 OAuth conformance (#224)

  • The authorization response's iss is validated (RFC 9207).
  • The proxy's POST /oauth/register requires application_type to be web or native. Clients that omit it are now rejected with invalid_client_metadata.
  • OAuthClientCredentialStore binds credentials to their issuer.
  • Client ID Metadata Documents are validated.

🛠 Fixes

  • SIGPIPE no longer kills the process on Linux and Android (#281): libcurl could restore the default SIGPIPE action after a URLSession transfer, and the next NIO write to a closed socket then ended the process without a crash record. SwiftMCP now re-ignores SIGPIPE where the event loops and each URLSession start.
  • MCPServerProxy no longer crashes after disconnect() (#277): a request that started on the invalidated URLSession took the process down.
  • HTTPSSETransport.stop() under load (#216, #218): the listener is closed and accepted connections are quiesced before the event loops shut down. This removes the "leaking promise" crash in debug builds.
  • SSE and U+0085, U+2028, U+2029 (#208, #209): the client splits lines only at CR, LF and CRLF, and the server escapes these characters in data: lines, so a message containing them is no longer cut in two.
  • Generated clients and a parameter named arguments (#274): the real value is sent instead of an empty object.
  • Non-ASCII text in descriptions (#276): doc-comment text such as 1–600, Café or 日本語 is kept in tool and parameter descriptions. Before, 1–600 became 1600.
  • In-process loopback notifications (#207): a captured Session now delivers resource-updated, list-changed and log notifications after its request has finished.
  • TCP send failures (#206): TCPConnection.write throws when a send fails, so pending requests fail instead of hanging, and TCP keepalive is on. StdioConnection.write is now async throws.

Maintenance

  • Swift 6.4 on every CI lane (#253), including Android with Swift 6.4.2 (#226).
  • Steadier tests: webhook delivery tests are deterministic under parallel execution (#279), and connection-churn tests no longer overlap other loopback suites (#220, #268).