The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Swift SDK
The official Swift SDK for Model Context Protocol servers and clients.
Install
git clone https://github.com/modelcontextprotocol/swift-sdkInstall command taken from the project's README or registry entry. Always review code before running it.
README excerpt
Read full README on GitHub →MCP Swift SDK
Official Swift SDK for the [Model Context Protocol][mcp] (MCP).
Overview
The Model Context Protocol (MCP) defines a standardized way for applications to communicate with AI and ML models. This Swift SDK implements both client and server components according to the [2025-11-25][mcp-spec-2025-11-25] (latest) version of the MCP specification.
Table of contents
- Requirements
- Installation
- Client Usage
- Server Usage
- Transports
- Authentication
- Platform Availability
- Debugging and Logging
- Additional Resources
- Changelog
- License
Requirements
- Swift 6.0+ (Xcode 16+)
See the Platform Availability section below for platform-specific requirements.
Installation
Swift Package Manager
Add the following to your Package.swift file:
dependencies: [
.package(url: "https://github.com/modelcontextprotocol/swift-sdk.git", from: "0.11.0")
]
Then add the dependency to your target:
.target(
name: "YourTarget",
dependencies: [
.product(name: "MCP", package: "swift-sdk")
]
)
Client Usage
The client component allows your application to connect to MCP servers.
Basic Client Setup
import MCP
// Initialize the client
let client = Client(name: "MyApp", version: "1.0.0")
// Create a transport and connect
let transport = StdioTransport()
let result = try await client.connect(transport: transport)
// Check server capabilities
if result.capabilities.tools != nil {
// Server supports tools (implicitly including tool calling if the 'tools' capability object is present)
}
Similar plugs
Reverse engineer anything with agents, from app behavior down to native binaries.
Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.
Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype…
User-friendly AI Interface (Supports Ollama, OpenAI API, ...)