技能潮 SkillTide 提交收录
官方说明3 个来源MCP 服务3 天前
Swift MCP SDK

Swift MCP SDK

The official Swift SDK for Model Context Protocol servers and clients.
在 GitHub 查看 ↗直链 · 无中转页
来源明细
收录自 modelcontextprotocol/servers 榜单(我们从中收集的条目之一) · 条目类型:MCP 服务
收录与活跃
收录于 2026-10-14 · 最近见到 2026-10-16 · 共见到 4 次 · 被 3 个来源列出
评分构成
综合分 303 · 3 个来源 · mcp
常见问题(答案都来自我们的记录)
怎么安装?
我们【没有】从该仓库取到安装命令(我们的 install 覆盖率只有约 4%)。请看它的 README 或 releases 页。
它适合谁 / 用来做什么?
我们把它归在这些标签下: MCP 服务。标签来自条目自身,不是我们强加的分类。
谁维护它、还在更新吗?
我们收录于 2026-10-14;最近见到 2026-10-16。这里没有"官方认证"或"质量评级"——我们只记录来源与时间。
第三方质量标记

MCP Swift SDK

以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →

Official Swift SDK for the [Model Context Protocol][mcp] (MCP).
Overview
The Model Context Protocol (MCP) defines a standardized way
for applications to communicate with AI and ML models.
This Swift SDK implements both client and server components
according to the [2025-11-25][mcp-spec-2025-11-25] (latest) version
of the MCP specification.
Table of contents
- Requirements
- Installation
- Client Usage
- Basic Client Setup
- Transport Options for Clients
- Tools
- Resources
- Prompts
- Completions
- Sampling
- Elicitation
- Roots
- Logging
- Error Handling
- Cancellation
- Progress Tracking
- Advanced Client Features
- Server Usage
- Basic Server Setup
- Tools
- Resources
- Prompts
- Completions
- Sampling
- Elicitations
- Roots
- Logging
- Progress Tracking
- Initialize Hook
- HTTP Request Context in Handlers
- Graceful Shutdown
- Transports
- Authentication
- Client: Client Credentials Flow
- Client: Authorization Code Flow
- Client: Custom Token Provider
- Client: Custom Token Storage
- Client: private\_key\_jwt Authentication
- Client: Endpoint Overrides
- Server: Serving Protected Resource Metadata
- Server: Validating Bearer Tokens
- Platform Availability
- Debugging and Logging
- Additional Resources
- Changelog
- License
Requirements
- Swift 6.0+ (Xcode 16+)
See the Platform Availability section below
for platform-specific requirements.
Installation
Swift Package Manager
Add the following to your Package.swift file:
Then add the dependency to your target:
Client Usage
The client component allows your application to connect to MCP servers.
Basic Client Setup
> [!NOTE]
> The Client.connect(transport:) method returns the initialization result.
> This return value is discardable,
> so you can ignore it if you don't need to check server capabilities.
Transport Options for Clients
Stdio Transport
For local subprocess communication:
HTTP Transport
For remote server communication:
Tools
Tools represent functions that can be called by the client:
Resources
Resources represent data that can be accessed and potentially subscribed to:
Prompts
Prompts represent templated conversation starters:
Completions
Completions allow servers to provide autocompletion suggestions for prompt and resource template arguments as users type:
You can also provide context with already-resolved arguments:
Completions work for resource templates as well:
Sampling
Sampling allows servers to request LLM completions through the client,
enabling agentic behaviors while maintaining human-in-the-loop control.
Clients register a handler to process incoming sampling requests from servers.
> [!TIP]
> Sampling requests flow from **server to client**,
> not client to server.
> This enables servers to request AI assistance
> while clients maintain control over model access and user approval.
Elicitation
Elicitation allows servers to request structured information directly from users through the client.
This is useful when servers need user input that wasn't provided in the original request,
such as credentials, configuration choices, or approval for sensitive operations.
> [!TIP]
> Elicitation requests flow from **server to client**,
> similar to sampling.
> Clients must register a handler to respond to elicitation requests from servers.
Client-Side: Handling Elicitation Requests
Register an elicitation handler to respond to server requests:
Common use cases for elicitation:
- **Authentication**: Request credentials when needed rather than upfront
- **Confirmation**: Ask for user approval before sensitive operations
- **Configuration**: Collect preferences or settings during operation
- **Missing information**: Request additional details not provided initially
Roots
Roots define the filesystem boundaries that a client exposes to servers. Servers discover roots by sending a roots/list request to the client; clients notify servers when the list changes.
> [!TIP]
> To use roots, declare the roots capability when creating the client.
Logging
Clients can control server logging levels and receive structured log messages:
来源
awesome · https://github.com/modelcontextprotocol/swift-sdk
按领域浏览
MCP 服务
收录于
昨天

更多MCP 服务

查看MCP 服务全部 5,525 条 →

所属领域与标签

每个标签都能点进去看同类的全部条目。数字是当前库里的真实条数。

浏览全部领域 →

← 返回索引