swift-sdk

swift-sdk

Official Swift SDK for Model Context Protocol, supporting both client and server components.

MCPDevOpen source
Type
MCP
Open source
Yes
GitHub Stars
★ 1.4k
Source
mcp-github

Overview

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 of the MCP specification. With this SDK, developers can easily integrate MCP into their Swift applications, enabling connection and interaction with MCP servers. Ideal for developers looking to incorporate AI capabilities into their Swift apps.

Capabilities

  • Client and server components
  • Multiple transport options (e.g., stdio, HTTP)
  • Tool invocation
  • Resource access and subscription
  • Logging and error handling

Use cases

Integrate AI features into Swift applicationsCommunicate with MCP serversInvoke remote or local AI toolsAccess and subscribe to resources

Setup

Requires: Swift 6.0+Xcode 16+
Add the dependency via Swift Package Manager: ".package(url: \"https://github.com/modelcontextprotocol/swift-sdk.git\", from: \"0.11.0\")" and add the dependency to your target: ".product(name: \"MCP\", package: \"swift-sdk\")"

This information was compiled by AI from public sources and may contain inaccuracies — please refer to the source.

FAQ

How do I initialize the client?

Initialize the client using `Client(name: "MyApp", version: "1.0.0")`.

What transport methods are supported?

Supports stdio, HTTP, and other transport methods.

Related skills