ClientCapabilities.experimental fails to decode object-valued capabilities
メンテナーはふだん 7 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start at the Swift SDK's ClientCapabilities.experimental definition and the initialize-request decoding path. Add a regression test for an object-valued experimental capability such as {"example/capability": {}} and verify initialization succeeds while preserving supported existing values.
索引モデルが issue の本文から書いたものです。
説明
Description
Swift MCP SDK 0.12.1 models the experimental client capabilities field as:
public var experimental: [String: String]?
This causes MCP initialization to fail when a client sends an object-valued experimental capability.
For example, current OpenAI Codex sends:
"experimental": {
"codex/auth-change": {}
}
The {} value cannot be decoded as a String, so decoding of the initialize parameters fails and the server returns:
-32603 Internal error:
The data couldn’t be read because it isn’t in the correct format.
The MCP specification defines ClientCapabilities.experimental as a map of capability names to objects, rather than strings.
Minimal reproduction
Using the same unchanged Swift MCP server:
Fails
"experimental": {
"codex/auth-change": {}
}
Result:
-32603 Internal error:
The data couldn’t be read because it isn’t in the correct format.
Succeeds
"experimental": {}
Initialization succeeds and the server advertises its tool capability.
An unrelated object-valued experimental capability produces the same failure, so this is not specific to codex/auth-change.
Expected behavior
ClientCapabilities.experimental should accept arbitrary MCP capability objects, including an empty object:
"experimental": {
"example/capability": {}
}
Unknown experimental capabilities should not prevent initialization.
A possible Swift representation might use the SDK's arbitrary JSON value/object type rather than String, for example conceptually:
[String: JSONValue]?
or the appropriate existing SDK-native equivalent.
Regression test
A regression test should decode an initialize request containing:
"experimental": {
"example/capability": {}
}
and verify that initialization succeeds.
It would also be useful to preserve compatibility with any previously accepted experimental values where appropriate.
Environment
- Swift MCP SDK: 0.12.1
- Swift MCP SDK HEAD tested:
a0ae212ebf6eab5f754c3129608bc5557637e605 - OpenAI Codex CLI:
0.154.0-alpha.6.2 - macOS: 27.0 (
26A428) - Downstream server used for my reproduction:
eneko-codes/apple-reminders-mcp - Downstream server commit:
aa5730b3cea147343528eb9f55bfd6dcaa9e3712
The problem appears SDK-level rather than specific to that downstream server.
Related issue
OpenAI Codex issue #44458 independently reproduces the same failure with other Swift-based MCP helpers:
https://github.com/openai/codex/issues/44458
That report shows the same A/B result:
- object-valued experimental capability → initialization failure
- empty experimental object / omitted field → successful initialization
- 主要言語
- Swift
- スター
- 1.5k
- フォーク
- 254
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
modelcontextprotocol/swift-sdk のほかの issue
-
NetworkTransport leaks the underlying socket (CLOSE_WAIT) when reconnection is disabled and the receive loop terminates対応中かも @skirrellyjones が 43 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
modelcontextprotocol/swift-sdk#282 ·
メンテナーはふだん 7 日以内に返信
-
Value decoding changes data-URL-looking JSON strings into Value.data対応中かも @bitbemol が 53 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
modelcontextprotocol/swift-sdk#277 ·
メンテナーはふだん 7 日以内に返信
-
enhancement
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
modelcontextprotocol/swift-sdk#274 ·
メンテナーはふだん 7 日以内に返信
-
`HTTPClientTransport` fails to build on Windows: `#if !os(Linux)` guards no longer match the `EventSource` platform condition再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
modelcontextprotocol/swift-sdk#261 ·
メンテナーはふだん 7 日以内に返信
-
Value: add numberValue (Double?) that coerces .int and .double対応中かも @gsdali が 164 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
modelcontextprotocol/swift-sdk#225 ·
メンテナーはふだん 7 日以内に返信
modelcontextprotocol/swift-sdk の issue をすべて見る
似ている issue
-
bug good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 63/100
marcovisona/arca#5 ·
-
enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
luis-guillen/airy#2 ·
-
accessibility bug medium-priority mobile
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
lognorman20/monaco#6247 ·
-
documentation windows
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
521xueweihan/HelloGitHub#4060 ·