swift-mcp-server-generator Skill (awesome-copilot): Build a Swift MCP Server
Generates a complete MCP server project in Swift with the official MCP Swift SDK, including tools, resources, prompts and tests.
- Installs
- 8.8K
- on skills.sh
- Stars
- 40.7K
- on GitHub
- Updated
- Oct 2026
- last repo commit
This skill has your assistant write a full Swift package for an MCP server. It asks for a project name and description, then generates 11 templated files: Package.swift, main.swift, Server.swift, tool, resource and prompt files, tests and a README.
The result runs over stdio and includes example tools, resources and one prompt. It needs Swift 6.0 or newer and downloads three Swift packages on the first build. The skill bundles no scripts.
Good for
- Swift developers building an MCP server for iOS, macOS or Linux
- Developers who want a working starting project with logging, graceful shutdown and tests
- Teams exposing Apple-platform code to AI assistants through MCP
Install swift-mcp-server-generator
Claude Code
- 1
Download the skill folder from https://github.com/github/awesome-copilot/tree/HEAD/skills/swift-mcp-server-generator.
- 2
Put it at ~/.claude/skills/swift-mcp-server-generator/ so that SKILL.md sits directly inside.
- 3
Start a new session; the skill loads when its description matches the task.
Requires Swift 6.0 or newer.
Pick one route. The Copilot plugin route installs swift-mcp-development, which lists this skill and the Swift MCP Expert agent (agents/swift-mcp-expert.agent.md) and no hooks or MCP servers. The skills CLI and folder routes install only this skill. The skill runs Swift commands in your project, so there is no Claude app upload route.
Built from the package data we hold. Not yet tested by us.
What's in the skill
When it loads
Generate a complete Model Context Protocol server project in Swift using the official MCP Swift SDK package.
Sections in SKILL.md
- Project Generation
- Package.swift Template
- main.swift Template
- Server.swift Template
- ToolDefinitions.swift Template
- ToolHandlers.swift Template
- ResourceDefinitions.swift Template
- ResourceHandlers.swift Template
- PromptDefinitions.swift Template
- PromptHandlers.swift Template
- ServerTests.swift Template
- README.md Template
- Features
- Requirements
- Installation
- Usage
Key facts
- License
- MIT
- Installs on skills.sh
- 8,768 (Nov 2, 2026)
- Last repo commit
- Oct 30, 2026
- Audits on skills.sh
- Gen Agent Trust Hub: pass, Socket: pass, Snyk: pass
- What it includes
- 1 file including SKILL.md
What it includes
A my-mcp-server package with Sources, Tests and README.md.
Sources hold main.swift, Server.swift and Tools, Resources and Prompts folders with definition and handler files.
Write ·
Project structureSwift 6.0 package using the MCP Swift SDK, swift-log and ServiceLifecycle.
main.swift runs the server over a stdio transport with graceful shutdown.
Write ·
Package.swift and main.swiftCreates the server and registers tool, resource and prompt handlers.
Capabilities enable prompts, resources (with subscribe) and tools, each with listChanged.
Server.swiftTwo example tools, greet and calculate, with their handlers.
calculate takes add, subtract, multiply or divide plus two numbers.
Write ·
Tools templatesTwo example resources (Example Data and Configuration) with subscription state.
Handlers keep subscriptions in an actor for thread safety.
Write ·
Resources templatesOne example prompt, code-review, with language and focus arguments.
language is required and focus is optional.
Write ·
Prompts templatesA test file for the handlers.
Run it with swift test.
Write ·
ServerTests.swiftAsk for a project name and description, then follow ten rules for the code.
Rules include actor-based state, swift-log logging, graceful shutdown, tests for all handlers and doc comments.
Generation instructionsswift build, swift run, swift test, release build, and copy the binary to /usr/local/bin.
Also a claude_desktop_config.json snippet that points command at the built binary.
Runs code ·
Build and run
From the official docs
Permissions
Low risk
It writes a new project and suggests building it and copying the binary into /usr/local/bin. Check the folder it writes to before you approve.
What it can do
- Read your data
- Create and change things
- Delete things
- Read-only mode
Watch out for
The build downloads Swift packages
The Package.swift template depends on three GitHub packages, pinned with from: versions. They are fetched on the first swift build. github.com
It suggests installing into /usr/local/bin
The Install step copies the release binary there. Skip it if you would rather run the binary from the build folder. github.com
The plugin also adds an agent
The swift-mcp-development plugin lists the Swift MCP Expert agent. Its file sets a model and no tool list. github.com
Technical details
| Turning on read-only | No read-only mode. The skill generates files. |
|---|---|
| Talks to | github.com (SwiftPM downloads modelcontextprotocol/swift-sdk, apple/swift-log and swift-server/swift-service-lifecycle) |
| Scopes |
|
Questions
What does swift-mcp-server-generator do?
It makes your assistant generate a full Swift project for an MCP server. The project uses the official MCP Swift SDK and has example tools, resources and prompts, logging, graceful shutdown and tests. It starts by asking for a project name and description.
What do I need to run the result?
Swift 6.0 or newer. The generated README says macOS 13+, iOS 16+ or Linux. The first build downloads three Swift packages: the MCP Swift SDK, swift-log and swift-service-lifecycle.
How do I install it?
Use the install box above. The Copilot CLI tab installs the swift-mcp-development plugin, which adds this skill and a Swift MCP Expert agent. The skills CLI and folder routes install only this skill.
How do I connect the server it generates to Claude Desktop?
The SKILL.md ends with a claude_desktop_config.json snippet. It adds an mcpServers entry whose command is the full path to the built binary. Build a release version first.
Is it safe?
It bundles no scripts. It writes a new project into your folder, and its Build and Run section includes copying the release binary to /usr/local/bin. The first swift build downloads packages from GitHub.
Does it work in Claude?
The SKILL.md names no client. It generates files and runs Swift commands, so it fits an agent that works in your project folder. The install box has Claude Code and Codex routes and no Claude app upload route.
Information
updated Nov 2, 2026
- Repository
- github/awesome-copilot
- Folder
skills/swift-mcp-server-generator
Sources
Docs, issue trackers and discussions this page is built from.
Show all 5Hide
- swift-mcp-server-generator SKILL.md · github.com
- plugin.json · github.com
- swift-mcp-development plugin README · github.com
- awesome-copilot README · github.com
- swift-mcp-expert.agent.md · github.com