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

Empty cacheScope on tools/list drops every tool

オープン 初心者向け
#1,242 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
rust

調査の方向性

まず、tools/list と resources/read の結果型における cacheScope の serde デシリアライズから始め、次に提供された JSON を対象を絞ったテストとして再現します。空文字列そのものが省略されたフィールドとして扱われ、tools が引き続き利用可能で、"shared" や " " のような値は引き続き失敗すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

bug P2 ready for work T-model

Describe the bug

Some hosted MCP servers send cacheScope: "" on tools/list and resources/read results. SEP-2549 only allows "public", "private", or omitting the field, so serde rejects the empty string. Because ServerResult is an untagged enum, that failure does not stay on ListToolsResult. The payload falls through to CustomResult, and the client ends up with no tools.

Negative ttlMs is already normalized. Empty cacheScope is not.

To Reproduce

Deserialize a valid tools/list result that includes an empty cache scope:

{
  "tools": [{ "name": "search", "inputSchema": { "type": "object" } }],
  "ttlMs": 0,
  "cacheScope": ""
}

On current main this does not parse as ListToolsResult.

Expected behavior

Treat an exact empty cacheScope the same as an omitted field (None). Unknown values such as "shared" or " " should still fail.

Additional context

I hit this against a hosted server that emits cacheScope: "" on an otherwise valid tools/list body. The tools were present on the wire and disappeared after decode.

主要言語
Rust
スター
3.9k
フォーク
645
平均マージ
4日 22時間
マージ済み PR(30日)
37

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

modelcontextprotocol/rust-sdk のほかの issue

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

似ている issue

Rust の issue をもっと見る

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

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