MCP Swift SDK
The official Swift SDK for building MCP clients and servers.
View on GitHub ↗- Stars
- ★ 1,512
- Last commit
- 29 Apr 2026
- Maintenance
- Slowing
- 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
apfel
Command-line tool, chat mode and local OpenAI-compatible server for the on-device model in Apple's FoundationModels framework. Needs macOS 26 and Apple silicon.
iCTRL
Runs a long-lived XCUITest on a real iPhone and exposes an HTTP API so agents can tap, type, read the UI and take screenshots. Meant for testing on your own devices.
asc-cli
Swift command-line tool for App Store Connect (builds, TestFlight, subscriptions, screenshots), with JSON output made for agents.