Skip to content

SwiftMCP 1.9.0

Latest

Choose a tag to compare

@odrobnik odrobnik released this 01 Jul 09:34
7f120fe

Highlights

JSONFoundation's JSON-RPC runtime, end to end — and swift-nio is now optional on the server. 1.9.0 moves both the client and server transports onto the shared JSON-RPC runtime JSONFoundation ships (the same one LSP and SwiftACP build on), and lifts swift-nio out of the HTTP/SSE server's core so it is just one swappable adapter.

Client transports on the shared runtime (#150)

  • The client's line-based transports (stdio spawn, in-process, direct TCP, Bonjour TCP) now run on a single JSONRPCPeer over JSONFoundation's JSONRPCMessageTransport seam, instead of hand-rolled per-transport request/response correlation and framing.
  • In-process stdioHandles uses JSONFoundation's LoopbackTransportno OS pipes; direct host:port TCP uses TCPClientTransport (POSIX sockets, so it now works on Linux with no Network framework).
  • @Schema is consolidated onto JSONFoundation's macro (SwiftMCP's duplicate SchemaMacro removed, −389 lines) — identical expansion, import SwiftMCP still surfaces it.

HTTP/SSE server decoupled from swift-nio (#151)

  • The streamable-HTTP / legacy-SSE server transport now sits behind a new MCPHTTPEngine seam: the engine (routing, sessions, SSE) is NIO-free, and swift-nio lives in a single NIOHTTPServerAdapter. A NIO-free InMemoryHTTPServerAdapter drives the same engine socket-free for hermetic tests.
  • The SSE stream registry (replay buffers, resume-after-disconnect, retention, priming anchors) is delegated to JSONFoundation's new JSONRPCSSEServer.SSEStreamHub; JSON-RPC response correlation on both the server Session and the client proxy moves to JSONRPCPeer.RequestCorrelator.

Also

  • Fixes a pre-existing InMemoryTransport pre-connect race that could deadlock a waiting caller.
  • CI: skip macro validation in the iOS xcodebuild job.

Dependency: requires JSONFoundation 2.4.0 (ships JSONRPCSSEServer + RequestCorrelator). Deployment floor stays macOS 13 / iOS 15. The NIO-free core, Client, and OpenAPI configurations continue to build without swift-nio.

What's Changed

  • Adopt JSONFoundation's JSON-RPC runtime for the client transports by @odrobnik in #150
  • Decouple HTTP/SSE server from NIO; delegate SSE registry + correlation to JSONFoundation 2.4.0 by @odrobnik in #151

Full Changelog: v1.8.0...v1.9.0