Docs import a namespace that does not exist: Mcp\Server\Capability\Attribute\McpTool
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 1/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 85/100
- issue の種類
- ドキュメント
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- php
調査の方向性
docs/get-started/first-server.md と README.md のインポートを更新します。まず、既存の例を issue に記載されている v0.9.0 の属性名前空間と照らし合わせて確認します。両方の例で Mcp\Capability\Attribute\ から属性をインポートし、SDK と一致させれば完了です。提案されている class_alias は任意であり、別途スコープの確認が必要です。
索引モデルが issue の本文から書いたものです。
説明
What's wrong
The getting-started docs and the SDK README both tell you to import the tool attribute from a namespace that does not exist in v0.9.0.
docs/get-started/first-server.md:
use Mcp\Server\Capability\Attribute\McpResource;
use Mcp\Server\Capability\Attribute\McpTool;
README.md shows the same import.
What actually exists
Verified against mcp/sdk v0.9.0:
use Mcp\Capability\Attribute\McpTool; // correct
use Mcp\Capability\Attribute\McpResource; // correct
use Mcp\Capability\Attribute\McpPrompt; // correct
use Mcp\Capability\Attribute\McpResourceTemplate; // correct
$ ls vendor/mcp/sdk/src/Server/Capability
ls: vendor/mcp/sdk/src/Server/Capability: No such file or directory
$ php -r 'require "vendor/autoload.php";
var_dump(class_exists("Mcp\Server\Capability\Attribute\McpTool"));
var_dump(class_exists("Mcp\Capability\Attribute\McpTool"));'
bool(false)
bool(true)
All five attribute classes live under Mcp\Capability\Attribute\. The Server\ segment was dropped at some point, and the docs were not updated with it.
Why it's worth fixing
Copying the quickstart verbatim is a fatal error on the very first file a new user writes. The error points at the use statement, so it reads like a typo the user made rather than an outdated doc, and the natural next step is to go looking for a typo instead of checking the installed version.
Suggested fix
Update the quickstart and README imports. If the flattening is recent, a class_alias shim for one release would let code written against the old docs keep working:
class_alias(\Mcp\Capability\Attribute\McpTool::class, \Mcp\Server\Capability\Attribute\McpTool::class);
Happy to open a PR for the docs if that's easier than doing it yourself.
Found while building a hackathon project against mcp/sdk v0.9.0 / symfony/mcp-bundle v1.0.0-BETA1 on PHP 8.5.8.
- 主要言語
- PHP
- スター
- 1.7k
- フォーク
- 206
- 平均マージ
- 1日 17時間
- マージ済み PR(30日)
- 102
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
modelcontextprotocol/php-sdk のほかの issue
-
[Server] Handler type uses bare Closure, hard to decorate RegistryInterface under strict PHPStanオープンServer
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
modelcontextprotocol/php-sdk#468 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement P3
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
modelcontextprotocol/php-sdk#733 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
[Server] Handle notifications/cancelled on the handshake era対応中かも @ump45nose が 5 日前に担当しました。 オープンhelp wanted improves spec compliance Server
難易度 4/5 3〜5日 初心者へのやさしさ 57/100
modelcontextprotocol/php-sdk#732 ·
メンテナーはふだん 1 日以内に返信
-
[Client][Server] Ship extension classes for the two authorization extensions対応中かも @chr-hertel が 6 日前に担当しました。 オープンauth Client Server
modelcontextprotocol/php-sdk#721 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
[Client] Test cross-app access against a real identity provider対応中かも @chr-hertel が 6 日前に担当しました。 オープンauth Client
modelcontextprotocol/php-sdk#720 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
modelcontextprotocol/php-sdk の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
pluginsGLPI/carbon#396 ·
-
[BUG] Bundle products lose their price in RSS feeds: getPrices() was removed対応中かも @pcvelz が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
OpenMage/magento-lts#5869 ·
メンテナーはふだん 2 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
OpenGIS/waymark-wp#82 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
claude
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
sprain/sprainocchio#39 ·
メンテナーはふだん 1 日以内に返信