Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

ClientCapabilities.experimental fails to decode object-valued capabilities

オープン
#287 コメント 1 件 リアクション 3 件 担当者 0 名 GitHub で見る

メンテナーはふだん 7 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
swift
領域
api

調査の方向性

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 はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

modelcontextprotocol/swift-sdk のほかの issue

modelcontextprotocol/swift-sdk の issue をすべて見る

似ている issue

Swift の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。