swift
Full-featured Swift SDK for Model Context Protocol servers and clients
claude mcp add --transport stdio depasqualeorg-swift-mcp swift run --configuration release
How to use
This MCP server implements the MCP protocol version 2025-11-25 for Swift-based integrations. It exposes a standardized set of endpoints and tooling to interact with model context and control flows used in MCP-compliant agents. With the Swift MCP server running, you can connect MCP clients to the server to exchange model context, messages, and commands according to the MCP specification. The included Swift examples demonstrate HTTP server integration patterns using Hummingbird and Vapor, which can be used as a reference to adapt clients or build custom endpoints that suit your environment.
How to install
Prerequisites:
- A macOS or Linux machine with the Swift toolchain installed (swift 5.7+ recommended).
- Git installed to clone the repository.
Installation steps:
-
Clone the repository: git clone <repository-url> cd swift-mcp
-
Resolve dependencies and build: swift package resolve swift build -c release
-
Run the server: swift run --configuration release
Notes:
- If you prefer to run a specific executable target, replace the run command with the appropriate target name, e.g., swift run SwiftMCP
- Ensure your environment has network access and any required environment variables configured as described in additional_notes.
Additional notes
Environment variables and configuration tips:
- If the MCP server requires authentication or specific endpoints, set the corresponding environment variables as described in the project documentation (e.g., MCP_SERVER_PORT, MCP_API_TOKEN).
- When integrating with HTTP servers like Hummingbird or Vapor, ensure CORS and routing do not conflict with existing handlers.
- Use the conformance tests linked in the README to validate compatibility with MCP protocol version 2025-11-25 before deploying to production.
- For production deployments, consider running behind a reverse proxy and enabling TLS termination. Monitor with standard Swift logging and observe request/response payloads for debugging.
Related MCP Servers
ReActMCP
ReActMCP is a reactive MCP client that empowers AI assistants to instantly respond with real-time, Markdown-formatted web search insights powered by the Exa API.
spring-ai
From Java Dev to AI Engineer: Spring AI Fast Track
furi
CLI & API for MCP management
mcp-lite-dev
共学《MCP极简开发》项目代码
mcp-client-example
Learn how to implement MCP client with SwiftUI and Anthropic API
unity-editor
An MCP server and client for LLMs to interact with Unity Projects