swift-fast
The fastest way to build MCP servers in Swift.
claude mcp add --transport stdio mehmetbaykar-swift-fast-mcp docker run -i mehmetbaykar/swift-fast-mcp
How to use
FastMCP provides a Swift-based framework to build MCP servers with a fluent builder API. You define your server name, add tools, resources, and prompts, then run it. Tools are MCPTool conforming types that implement a call(with:) method and are automatically exposed via a generated schema. Resources expose data to AI models, and Prompts provide reusable templates for conversations. The README demonstrates a minimal get-started flow using FastMCP.builder().name(...).addTools([...]).run(), and shows more complex usage including resources and prompts, sampling options, and transport configurations. To connect to Claude Desktop, you typically choose a transport (stdio, in-memory, or a custom transport) and configure Claude with your server’s name and path. In short, you get a production-ready MCP server with built-in tooling, resources, prompts, and lifecycle management, written in Swift and designed to minimize boilerplate.
How to install
Prerequisites:
- macOS 14+ (as recommended by the project) and Swift 6.2+ installed
- Xcode or Swift toolchain with Swift Package Manager (SPM)
-
Install Swift (if not already installed)
- macOS: Install Xcode or download the Swift toolchain from Apple or swift.org
- Verify: swift --version
-
Create a new Swift project or use the provided Swift package approach
- Initialize a new package if starting from scratch: swift package init --type executable
-
Add the swift-fast-mcp dependency to your Package.swift dependencies: [ .package(url: "https://github.com/mehmetbaykar/swift-fast-mcp", from: "1.0.2") ] And add the corresponding target: .target(name: "YourServer", dependencies: ["FastMCP"])
-
Build and run locally
- Build: swift build
- Run: swift run YourServer
-
Optional: Docker-based deployment (using the provided MCP server image)
- Ensure Docker is installed and running
- Start the server with the container image, or adapt the image to your project setup
-
Verify connectivity
- Connect via Claude Desktop or your configured transport and ensure the MCP server registers under its configured name.
Additional notes
Tips:
- The builder API is highly declarative: you can chain calls to configure name, version, tools, resources, prompts, sampling, transport, logger, and lifecycle hooks.
- Tools, Resources, and Prompts are defined as Swift types that conform to MCPTool, MCPResource, and MCPPrompt respectively; use @Schemable for typed parameters to auto-generate schemas.
- If you plan to integrate with Claude Desktop, configure the appropriate transport (stdio for Claude Desktop) and provide the server path in claude_desktop_config.json.
- Ensure your environment variables and file paths are correctly mapped when running inside Docker; expose necessary ports and volumes if your tools require I/O.
- Check for graceful shutdown and lifecycle hooks to avoid abrupt terminations during updates or redeployments.
Related MCP Servers
mirroir
MCP server for controlling a real iPhone via macOS iPhone Mirroring...and any MacOs app. Screenshot, tap, swipe, type — from any MCP client.
mcp-salesforce
🚀 Complete MCP (Model Context Protocol) server for Salesforce integration with Claude Desktop. Provides seamless OAuth authentication, universal CRUD operations on any Salesforce object.
FocusRelayMCP
Talk to your OmniFocus tasks. An OmniFocus MCP server that lets AI assistants query your tasks, projects, and tags using natural language—no more clicking through endless lists.
apple-notes
MCP server for Apple Notes - create, search, update, and manage notes via Claude and other AI assistants
xcode
MCP server for Xcode - enables AI assistants to create, build, test, and manage iOS/macOS projects programmatically
che-apple-mail
The most comprehensive Apple Mail MCP server with 42 tools - Swift native, full Mail.app automation for Claude AI