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

  1. 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

Any MCP client

Listed in

swiftskills.devawesome-ios-ai

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