swift-mcp-server-generator
Skill6 starsChanged 34 days agoMITView on GitHub
Generate a complete Model Context Protocol server project in Swift using the official MCP Swift SDK package.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- github/awesome-copilottheir own version, first seen Oct 25, 2026
- ramybarsoum/claude-skillstheir own version, first seen Oct 13, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- github/awesome-copilot★ 41ksame name
- ramybarsoum/claude-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository79 other files it gives its agents.
- adr-phase-coverageSkill
- aposd-red-flag-reviewSkill
- apple-on-device-aiSkill
- artifact-gatesSkill
- asc-app-create-uiSkill
- asc-build-lifecycleSkill
- asc-cli-usageSkill
- asc-crash-triageSkill
- asc-id-resolverSkill
- asc-localize-metadataSkill
- asc-metadata-syncSkill
- asc-notarizationSkill
- asc-ppp-pricingSkill
- asc-release-flowSkill
- asc-revenuecat-catalog-syncSkill
- asc-shots-pipelineSkill
- asc-signing-setupSkill
- asc-submission-healthSkill
- asc-subscription-localizationSkill
- asc-testflight-orchestrationSkill
- asc-wall-submitSkill
- asc-workflowSkill
- asc-xcode-buildSkill
- choose-boring-technologySkill
- ci-preflightSkill
- conways-lawSkill
- cost-routingSkill
- cost-tier-routingSkill
- cunninghams-lawSkill
- ddd-strategic-auditSkill
- ddd-tactical-reviewSkill
- debug-test-captureSkill
- developing-ios-appsSkill
- doerrs-lawSkill
- fitts-lawSkill
- fix-regression-guardSkill
- galls-lawSkill
- goodharts-lawSkill
- greenspuns-tenth-ruleSkill
- gsd-core-hooksSkill
- hofstadters-lawSkill
- hyrums-lawSkill
- ios-accessibilitySkill
- ios-simulator-boot-healthSkill
- kerckhoffs-principleSkill
- kernighans-lawSkill
- knuths-optimization-principleSkill
- lady-lovelaces-objectionSkill
- leaky-abstractionsSkill
- linuss-lawSkill
- mobile-ios-designSkill
- money-boundary-judgmentSkill
- moores-lawSkill
- no-deferSkill
- norvigs-lawSkill
- parkinsons-lawSkill
- peter-principleSkill
- postels-lawSkill
- post-fix-traceSkill
- qa-test-architectSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
When asked to create a Swift MCP server, work through this list and tick each item as it is done:
- Distinctive: line 22
If the user wants something the templates do not cover, adapt the closest template rather than inventing a different project shape.
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Swift MCP Server Generator
Generate a complete, production-ready MCP server in Swift using the official Swift SDK package.
Generation checklist
When asked to create a Swift MCP server, work through this list and tick each item as it is done:
- Ask for the project name and a one-line description
- Generate every file in the structure below from
references/templates.md, renamingMyMCPServerthroughout (drop theResources/orPrompts/group only if the user says the server does not need it) - Shared state lives in actors; async/await throughout, no completion handlers
- swift-log logging and ServiceLifecycle graceful shutdown wired in
main.swift - Errors surfaced as
MCPError; public APIs carry doc comments; Swift naming conventions (camelCase / PascalCase) - A test per handler in
ServerTests.swift swift buildandswift testrun clean before handing over; report their output
If the user wants something the templates do not cover, adapt the closest template rather than inventing a different project shape.
Project structure
Generate the complete project with this layout:
my-mcp-server/
├── Package.swift
├── Sources/
│ └── MyMCPServer/
│ ├── main.swift
│ ├── Server.swift
│ ├── Tools/
│ │ ├── ToolDefinitions.swift
│ │ └── ToolHandlers.swift
│ ├── Resources/
│ │ ├── ResourceDefinitions.swift
│ │ └── ResourceHandlers.swift
│ └── Prompts/
│ ├── PromptDefinitions.swift
│ └── PromptHandlers.swift
├── Tests/
│ └── MyMCPServerTests/
│ └── ServerTests.swift
└── README.mdTemplates
Each file has a complete template in references/templates.md. Read only the sections you need:
| File | Section in references/templates.md |
Package.swift | Package.swift Template |
Sources/MyMCPServer/main.swift | main.swift Template |
Sources/MyMCPServer/Server.swift | Server.swift Template |
Sources/MyMCPServer/Tools/ToolDefinitions.swift | ToolDefinitions.swift Template |
Sources/MyMCPServer/Tools/ToolHandlers.swift | ToolHandlers.swift Template |
Sources/MyMCPServer/Resources/ResourceDefinitions.swift | ResourceDefinitions.swift Template |
Sources/MyMCPServer/Resources/ResourceHandlers.swift | ResourceHandlers.swift Template |
Sources/MyMCPServer/Prompts/PromptDefinitions.swift | PromptDefinitions.swift Template |
Sources/MyMCPServer/Prompts/PromptHandlers.swift | PromptHandlers.swift Template |
Tests/MyMCPServerTests/ServerTests.swift | ServerTests.swift Template |
README.md | README.md Template |
Build and Run
# Build
swift build
# Run
swift run
# Test
swift test
# Release build
swift build -c release
# Install
swift build -c release
cp .build/release/MyMCPServer /usr/local/bin/Integration with Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"my-mcp-server": {
"command": "/path/to/MyMCPServer"
}
}
}Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

