★ 1385 Swift NOASSERTION sse 更新 1分钟前

Swift Sdk

The official Swift SDK for Model Context Protocol servers and clients.

安装配置

暂未识别到可直接复制的 MCP 配置,请查看 GitHub README。后台管理员可以补充配置。

README 摘要

# MCP Swift SDK 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](#requirements) - [Installation](#installation) - [Client Usage](#client-usage) - [Basic Client Setup](#basic-client-setup) - [Transport Options for Clients](#transport-options-for-clients) - [Tools](#tools) - [Resources](#resources) - [Prompts](#prompts) - [Completions](#completions) - [Sampling](#sampling) - [Elicitation](#elicitation) - [Roots](#roots) - [Logging](#logging) - [Error Handling](#error-handling) - [Cancellation](#cancellation) - [Progress Tracking](#progress-tracking) - [Advanced Client Features](#advanced-client-features) - [Server Usage](#server-usage) - [Basic Server Setup](#basic-server-setup) - [Tools](#tools-1) - [Resources](#resources-1) - [Prompts](#prompts-1) - [Completions](#completions-1) - [Sampling](#sampling-1) - [Elicitations](#elicitations) - [Roots](#roots-1) - [Logging](#logging-1) - [Progress Tracking](#progress-tracking-1) - [Initialize Hook](#initialize-hook) - [HTTP Request Context in Handlers](#http-request-context-in-handlers) - [Graceful Shutdown](#graceful-shutdown) - [Transports](#transports) - [Authentication](#authentication) - [Client: Client Credentials Flow](#client-client-credentials-flow) - [Client: Authorization Code Flow](#client-authorization-code-flow) - [Client: Custom Token Provider](#client-custom-token-provider) - [Client: Custom Token Storage](#client-custom-token-storage) - [Client: private\_key\_jwt Authentication](#client-private_key_jwt-authentication) - [Client: Endpoint Overrides](#client-endpoint-overrides) - [Server: Serving Protected Resource Metadata](#server-serving-protected-resource-metadata) - [Server: Validating Bearer Tokens](#server-validating-bearer-tokens) - [Platform Availability](#platform-availability) - [Debugging and Logging](#debugging-and-logging) - [Additional Resources](#additional-resources) - [Changelog](#changelog) - [License](#license) ## Requirements - Swift 6.0+ (Xcode 16+) See the [Platform Availability](#platform-availability) section below for platform-specific requirements. ## Installation ### Swift Package Manager Add the following to your `Package.swift` file: ```swift dependencies: [ .package(url: "https://github.com/modelcontextprotocol/swift-sdk.git", from: "0.11.0") ] ``` Then add the dependency to your target: ```swift .target( name: "YourTarget", dependencies: [ .product(name: "MCP", package: "swift-sdk") ] ) ``` ## Client Usage The client component allows your application to connect to MCP servers. ### Basic Client Setup ```swift import MCP // Initialize the client let client = Client(name: "MyApp", version: "1.0.0") // Create a transport and connect let transport = StdioTransport() let result = try await client.connect(transport: transport) // Check server capabilities if result.capabilities.tools != nil { // Server supports tools (implicitly including tool calling if the 'tools' capability object is present) } ``` > [!NOTE] > The `Client.connect(transport:)` method returns the initialization result. > This return value is...

相关 MCP

Fastapi

Expose your FastAPI endpoints as Model Context Protocol (MCP) tools, with Auth!

★ 11870 Python sse 待补充
mcp Python sse

Chrome

Chrome MCP Server is a Chrome extension-based Model Context Protocol (MCP) server that exposes your Chrome browser funct...

★ 11662 TypeScript sse 有配置
mcp sse TypeScript

Unity

Unity MCP acts as a bridge, allowing AI assistants (like Claude, Cursor) to interact directly with your Unity Editor via...

★ 9768 C# sse 有配置
mcp sse C#

Go

A Go implementation of the Model Context Protocol (MCP), enabling seamless integration between LLM applications and exte...

★ 8722 Go sse 待补充
mcp sse Go

Agent

Build effective agents using Model Context Protocol and simple workflow patterns

★ 8330 Python sse 待补充
mcp Python sse

Registry

A community driven registry service for Model Context Protocol (MCP) servers.

★ 6836 Go sse 待补充
mcp sse Go