SwiftMCP
A Swift implementation of the Model Context Protocol over JSON-RPC, supporting stdio, HTTP with Server-Sent Events, and local TCP+Bonjour discovery.
SwiftMCP implements the Model Context Protocol for JSON-RPC 2.0 across multiple transports: standard input/output for command-line use, HTTP with Server-Sent Events for web applications, and TCP with Bonjour for local network discovery. It exposes tools with an MCPTool macro, resources with MCPResource, and prompts with MCPPrompt, alongside progress notifications, structured logging, and completion suggestions for parameters.
On the client side it supports dynamic filesystem roots and sampling, letting a client request small previews of its own files. Optional feature areas, such as the server transports and OpenAPI/AI-plugin manifest support, are exposed as separate Swift package traits, so a client-only consumer can drop the server-only dependencies such as swift-nio and build on Windows.
It is added as a Swift Package Manager dependency and is licensed under BSD-2-Clause.