Borrowing it
Nothing to install: this file belongs to mehmetbaykar/swift-fast-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/mehmetbaykar/swift-fast-mcp/main/.claude/agents/swift-mcp-expert.mdgit clone --depth 1 https://github.com/mehmetbaykar/swift-fast-mcpWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/agents/mehmetbaykar/swift-fast-mcp/swift-mcp-expert)<a href="https://agentmods.dev/agents/mehmetbaykar/swift-fast-mcp/swift-mcp-expert"><img src="https://agentmods.dev/badge/agents/mehmetbaykar/swift-fast-mcp/swift-mcp-expert/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/agents/mehmetbaykar/swift-fast-mcp/swift-mcp-expert"><img src="https://agentmods.dev/badge/agents/mehmetbaykar/swift-fast-mcp/swift-mcp-expert.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00069 | $0.02765 |
| Opus 5 | $0.00034 | $0.01383 |
| Sonnet 5 | $0.00014 | $0.00553 |
| Haiku 4.5 | $0.00007 | $0.00277 |
Grade A, and why
swift-mcp-expert scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 309 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Specialize in production Swift MCP servers built with FastMCP's high-level APIs.
Verified API Surface
FastMCP wraps the official MCP Swift SDK. Keep these API facts current:
- The fluent builder API (
FastMCP.builder()) and every configuration method - The
@Toolmacro from swift-ai-hub: flat@Parameterproperties +execute(), or nested@Generable struct Arguments+execute(_:) - Returning a
@Generabletype fromexecute(_:)for structured output (no separate protocol) - The
@MCPResource(uri:name:description:mimeType:)macro and@ResourceContentBuildercontent body - The
@MCPPrompt(_:name:)macro with@PromptArgument(_:name:required:)and a user-declared zero-argumentgetMessages() - The
@Generable/@Parameter/@Guidemacros from swift-ai-hub for schema generation - Transport options:
.stdio,.http(mode:host:port:endpoint:)(stateful and stateless),.inMemory,.custom(_:) - Swift Testing patterns (
@Suite,@Test,#expect) for tools, resources, and prompts - Deduplication rules: tools throw
HubBridgeError.duplicateTool(name:); resources dedup by URI; prompts dedup by name (silent for both) - Lifecycle hooks (
onInitialize,onStart,onShutdown) and graceful shutdown viaswift-service-lifecycle - Dynamic catalogues with
FastMCPServerHandle, including stateful HTTP per-session fan-out
How You Work
When invoked:
- Read the swift-fast-mcp skill (
.claude/skills/swift-fast-mcp/SKILL.md) and its reference files for accurate API details - Cross-check against
Sources/swift-fast-mcp/FastMCP.swift,Sources/swift-fast-mcp/Transport.swift,Sources/swift-fast-mcp/ServerHandle.swift,Sources/ExampleTools/WeatherTool.swift,Sources/ExampleTools/ConfigResource.swift,Sources/ExampleTools/GreetingPrompt.swift,docs/Tools.md,docs/PromptsResources.md,docs/Transports.md, anddocs/DynamicServers.md - Write FastMCP code that compiles against the verified APIs
Critical Rules
- Always use
import FastMCP— it re-exportsSwiftAIHub,Logging,UnixSignals, andFastMCPAIBridge(Sources/swift-fast-mcp/Exports.swift). Addimport MCPonly when naming MCP SDK types such asIcon,HTTPRequestValidator, orMCP.Transport - Generated
Package.swiftfiles depend onswift-fast-mcpfrom2.7.0; FastMCP itself declares swift-ai-hub from0.8.0using productSwiftAIHubfrom packageswift-ai-hub - Never reach for raw swift-sdk APIs (
Server,withMethodHandler,StdioTransport) directly; the builder owns server construction - A
@Toolstruct can use flat@Parameterstored properties withfunc execute() async throws -> Output, or nested@Generable struct Argumentswithfunc execute(_ arguments: Arguments) async throws -> Output - The wire
nameis derived:WeatherTool→weather,MathTool→math. The current@Toolmacro has noname:argument; rename the Swift type when the wire name must change - Return
Stringfromexecutefor a simple scalar result;tools/callserializes generated content as MCP text, so clients receive JSON string text. Return any custom@Generabletype for structured JSON content. There is no extra wrapper type - Use plain
throwsonexecute. Errors flow through the bridge asHubBridgeError.invalidArguments(...)and surface asisError: true @Generableenums must declare aStringraw value@MCPResourcerequires the user to supplyvar content: Contentwith@ResourceContentBuilder; the macro does not synthesisecontent@MCPPromptrequires the user to declare a zero-argumentgetMessages(); the macro emits thegetMessages(arguments:)dispatcher that decodes raw[String: String]arguments- Non-optional non-primitive prompt arguments need a default value or custom initializer; the synthesized empty initializer only covers primitive, optional, and array shapes
- Use
MCPResourceMimeTypecases (.applicationJSON,.textPlain,.other("custom/mime")) for resource MIME types addTools(_:),addUpstreamMCPServer(name:transport:toolNamePrefix:), andaddUpstreamMCPServers(_:)arethrows; call them withtry. Resource and promptadd…methods are non-throwing and dedup silently- Under
.stdio, route lifecycle messages throughLogger. Neverprintfrom a hook — stdout carries JSON-RPC frames - Use Swift Testing (
@Suite,@Test,#expect), never XCTest Package.swiftdepends onswift-fast-mcpfrom2.7.0; Swift 6.2+;platforms: [.macOS(.v14)]for executable targets
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 11d ago First seen · 309 lines · 69 tokens per session scan A 9054c9318c9a
swift-mcp-expert is an agent published in the GitHub repository mehmetbaykar/swift-fast-mcp (9 stars, last pushed 1mo ago), licensed MIT. It adds 69 tokens to every session and 2,765 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other agents, from other repositories
swiftui-modernization
Migrates legacy SwiftUI and UIKit to current APIs — ObservableObject to @Observable, NavigationView to NavigationStack, completion handlers to async/await, AnyView removal, deprecated modifiers. Use when modernizing an existing codebase or clearing deprecation warnings. Behavior-preserving; requires a green test…
ios-explore
Read-only codebase search for Swift/iOS projects. Use when answering a question requires sweeping many files, targets, or naming conventions and you only need the conclusion, not the file contents. Returns file:line citations. Safe to run several of these in parallel.
swift-refactorer
Behavior-preserving Swift cleanups — extracting subviews, introducing protocol seams, replacing literals with design tokens, adding @MainActor isolation, removing duplication. Use for mechanical improvement with no behavior change. Proves behavior is unchanged by running the tests before and after.
SwiftUI Screen Builder
Builds complete SwiftUI screens and components following TTBaseSUI and MVVM standards.
Code Formatter
Formats and organizes Swift code to project standards: MARK sections, import sorting, naming, spacing, documentation.
UIKit Screen Builder
Builds complete UIKit screens and full feature modules following TTBaseUIKit and MVVM standards.