MCP Swift SDK
The official Swift SDK for building MCP clients and servers.
View on GitHub ↗- Stars
- ★ 1,591
- Last commit
- 23 Nov 2026
- Maintenance
- Active
- Licence
- Other
- Category
- Other
- GitHub
- modelcontextprotocol/
swift-sdk
Overview
The official Swift SDK for the Model Context Protocol. It implements both client and server sides of the 2025-11-25 MCP specification, so you can build MCP clients and servers in Swift. It's for developers adding MCP support to Swift apps and tools.
Features
- Client and server components
- Stdio transport for local subprocesses and HTTP transport for remote servers
- Tools, resources, prompts and completions
- Sampling, elicitation, roots and logging
- Request cancellation and error handling
Requirements
- Swift 6.0 or later (Xcode 16 or later)
- Further platform requirements are listed under Platform Availability
Install
Add the package to Package.swift
.package(url: "https://github.com/modelcontextprotocol/swift-sdk.git", from: "0.11.0")
Example
Create a Client, connect over a StdioTransport, list the server's tools and call one with arguments.
Works with
Listed in
- github.com/modelcontextprotocol/swift-sdk
- raw.githubusercontent.com/modelcontextprotocol/swift-sdk/HEAD/README.md
Read the code before you install anything. SwiftAgents doesn't review or endorse the tools listed here. Active: a commit in the last 90 days. Slowing: last commit within the past year. Stale: older than a year, or archived.
More in this category
Osaurus
A native Swift agent harness for macOS on Apple silicon, with local MLX or Foundation Models, optional cloud providers, persistent memory, skills, tools, automations and a local OpenAI-compatible server.
serve-sim
Streams a booted iOS Simulator to your browser, with touch, keyboard, screen recording and accessibility refs, so agents such as Codex, Cursor and Claude can see and drive it. By Evan Bacon, who develops Expo.
sim-use
A Swift command-line tool from LY Corporation that lets AI agents read and tap the screen of the iOS Simulator and Android emulators, using compact accessibility outlines instead of screenshots. Real iPhone support is experimental.
SwiftAgents