swift-mcp-server-generator
Generate a complete Model Context Protocol server project in Swift using the official MCP Swift SDK package.
By github · 8,813 installs
npx skills add github/awesome-copilot --skill swift-mcp-server-generator
Source repository · Upstream listing
Swift MCP Server Generator
Generate a complete, production ready MCP server in Swift using the official Swift SDK package.
Project Generation
When asked to create a Swift MCP server, generate a complete project with this structure:
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
bash
swift build c release
bash
swift run
bash
LOG LEVEL=debug swift run
bash
swift test
Generation Instructions
1. Ask for project name and description
2. Generate all files with proper naming
3. Use actor based state for thread safety
4. Include comprehensive logging with swift log
5. Implement graceful shutdown with ServiceLifecycle
6. Add tests for all handlers
7. Use modern Swift concurrency (async/await)
8. Follow Swift naming conventions (camelCase, PascalCase)
9. Include error handling with proper MCPError usage
10. Document public APIs with doc comments
Build and Run
Integration with Claude Desktop
Add to claude desktop config.json :