S

ModelContextProtocol

Created Oct 19, 2025 by JakeSax

Language:

Swift

Stars:

1

Forks:

0

README

A Swift Package for the Model Context Protocol

Swift Platforms License

This was something I was working on, but there is now an official Swift SDK so I can only recommend to use the official version. This package will no longer be maintained or developed, though I would mention that it does have some nice ergonomics + quality of life features that could be integrated into the official SDK.

ModelContextProtocol was an under-development Swift 6.0 implementation of Anthropic's Model Context Protocol (MCP), with the goal of providing an easy-to-use, pluggable Swift Package for MCP use across macOS, iOS, + Linux.

The package is split into three components:

  1. MCPCore: The core data types and functionality shared between the MCPClient and MCPServer.
  2. MCPClient: A relatively simple implementation for an MCPClient.
  3. MCPServer: An interface for a server to provide MCP functionality.

Features

  • 🏃 Modern Swift Concurrency - Built with Swift 6.0, leveraging actors, async/await, + Sendable
  • 🔒 Type-Safe - Full type safety for all MCP messages and operations
  • 🔌 Multiple Transports - Support for stdio and Server-Sent Events (SSE)
  • ⚡️ Performance - Efficient message handling with timeout and retry support
  • 🛠 Rich Capabilities - Support for resources, prompts, tools, and more
  • 📦 SwiftPM Ready - Easy integration through Swift Package Manager

Contributing

  1. Read the MCP Specification
  2. Fork the repository
  3. Create a feature branch
  4. Add tests for new functionality
  5. Submit a pull request

Limitations

  • StdioTransport does not work in sandboxed environments
Last updated: Oct 19, 2025

Publisher info

JakeSax's avatar

JakeSax

iOS Developer + UI/UX Designer

California
0
followers
2
following
5
repos

More MCP servers built with Swift

SwiftFormat

A command-line tool and Xcode Extension for formatting Swift code

By nicklockwood 8.7K
Euclid

A Swift library for creating and manipulating 3D geometry

By nicklockwood 684
iMCP

A macOS app that provides an MCP server to your Messages, Contacts, and more

By loopwork-ai 380