SwiftMCP
@Cocoanetics
About SwiftMCP
Model Context Protocol Server for Swift
Config
No standard config provided
This server doesn't expose a parseable MCP config block in its README. See the repository for install instructions.
RepositoryTools
No tools detected
We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.
Overview
What is SwiftMCP?
SwiftMCP is a Swift implementation of the Model Context Protocol (MCP) for JSON-RPC communication over multiple transports. It is intended for Swift developers who want to build MCP servers or clients that expose tools, resources, and prompts to AI models and other MCP-aware applications.
How to use SwiftMCP?
Add SwiftMCP as a dependency in your Package.swift, then declare a server with the @MCPServer macro, define tools with @MCPTool, and configure a transport such as stdio, HTTP+SSE, or TCP+Bonjour. The included demo provides commands like SwiftMCPDemo stdio and SwiftMCPDemo httpsse --port 8080.
Key features of SwiftMCP
- Multiple transport options: stdio, HTTP+SSE, TCP+Bonjour
- JSON-RPC 2.0 compliance with OpenAPI generation
- Built-in authorization and optional OAuth validation
- Macros for tools (
@MCPTool), resources (@MCPResource), and prompts (@MCPPrompt) - Typed client proxy generation for any MCP server
- Cross-platform support (macOS, Linux, Windows via trait selection)
Use cases of SwiftMCP
- Building a command‑line MCP server that communicates via stdin/stdout
- Exposing server tools over HTTP with Server‑Sent Events for web clients
- Creating a locally discoverable server using TCP+Bonjour for LAN environments
- Generating a typed Swift client proxy from any MCP server’s tool schema
- Adding OAuth‑protected endpoints that integrate with AI plugin manifests
FAQ from SwiftMCP
What transports does SwiftMCP support?
SwiftMCP supports Standard I/O (stdio), HTTP+SSE (Server‑Sent Events), and TCP+Bonjour for local discovery. These can even be run in parallel.
How does authorization work in SwiftMCP?
The HTTP+SSE transport can require a bearer token via the --token option, or validate tokens through an OAuth provider using introspection or JWKS. Custom authorization handlers can also be set.
Can I generate a typed client proxy from any MCP server?
Yes. The SwiftMCPUtility generate-proxy command creates a typed Swift proxy from any MCP server (including non‑SwiftMCP servers) by inspecting its tool schemas. Optionally, return types can be enriched from an OpenAPI document.
Does SwiftMCP support OpenAPI integration?
When the --openapi option is enabled, the server exposes an OpenAPI specification at /openapi.json and an AI plugin manifest at /.well-known/ai-plugin.json, enabling integration with AI models that understand OpenAPI.
What are the platform requirements for SwiftMCP?
SwiftMCP is written in Swift and works on macOS, Linux, and Windows. By disabling the Server trait (which drops swift‑nio), the package builds on Windows and reduces dependencies for client‑only consumers.
Frequently asked questions
What transports does SwiftMCP support?
SwiftMCP supports Standard I/O (stdio), HTTP+SSE (Server‑Sent Events), and TCP+Bonjour for local discovery. These can even be run in parallel.
How does authorization work in SwiftMCP?
The HTTP+SSE transport can require a bearer token via the `--token` option, or validate tokens through an OAuth provider using introspection or JWKS. Custom authorization handlers can also be set.
Can I generate a typed client proxy from any MCP server?
Yes. The `SwiftMCPUtility generate-proxy` command creates a typed Swift proxy from any MCP server (including non‑SwiftMCP servers) by inspecting its tool schemas. Optionally, return types can be enriched from an OpenAPI document.
Does SwiftMCP support OpenAPI integration?
When the `--openapi` option is enabled, the server exposes an OpenAPI specification at `/openapi.json` and an AI plugin manifest at `/.well-known/ai-plugin.json`, enabling integration with AI models that understand OpenAPI.
What are the platform requirements for SwiftMCP?
SwiftMCP is written in Swift and works on macOS, Linux, and Windows. By disabling the `Server` trait (which drops swift‑nio), the package builds on Windows and reduces dependencies for client‑only consumers.
Basic information
More Other MCP servers
IDA Pro MCP
mrexodiaAI-powered reverse engineering assistant that bridges IDA Pro with language models through MCP.
Reactive Resume
amruthpillaiA one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever. Try it out today!
MCP Registry
modelcontextprotocolA community driven registry service for Model Context Protocol (MCP) servers.
Production-ready MCP integrations for AI applications
Klavis-AIKlavis AI: MCP integration platforms that let AI agents use tools reliably at any scale
Codelf
unbugA search tool helps dev to solve the naming things problem.
Comments