Docs import a namespace that does not exist: Mcp\Server\Capability\Attribute\McpTool
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 1/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 85/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- php
- Lĩnh vực
- documentation
Hướng nghiên cứu
Cập nhật các lệnh import trong docs/get-started/first-server.md và README.md; bắt đầu bằng cách kiểm tra các ví dụ hiện có với các namespace thuộc tính của v0.9.0 được liệt kê trong issue. Công việc hoàn tất khi cả hai ví dụ đều import các thuộc tính từ Mcp\Capability\Attribute\ để khớp với SDK. class_alias được đề xuất là tùy chọn và cần được xem xét phạm vi riêng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- PHP
- Star
- 1.7k
- Fork
- 206
- Merge trung bình
- 1 ngày 17 giờ
- Pull request đã merge (30 ngày)
- 102
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của modelcontextprotocol/php-sdk
-
[Server] Handler type uses bare Closure, hard to decorate RegistryInterface under strict PHPStanĐang mởServer
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
modelcontextprotocol/php-sdk#468 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement P3
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
modelcontextprotocol/php-sdk#733 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Server] Handle notifications/cancelled on the handshake eraCó thể đã có người làm @ump45nose đã nhận 5 ngày trước. Đang mởhelp wanted improves spec compliance Server
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 57/100
modelcontextprotocol/php-sdk#732 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Client][Server] Ship extension classes for the two authorization extensionsCó thể đã có người làm @chr-hertel đã nhận 6 ngày trước. Đang mởauth Client Server
modelcontextprotocol/php-sdk#721 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Client] Test cross-app access against a real identity providerCó thể đã có người làm @chr-hertel đã nhận 6 ngày trước. Đang mởauth Client
modelcontextprotocol/php-sdk#720 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của modelcontextprotocol/php-sdk
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
pluginsGLPI/carbon#396 ·
-
[BUG] Bundle products lose their price in RSS feeds: getPrices() was removedCó thể đã có người làm @pcvelz đã nhận hôm nay. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
OpenMage/magento-lts#5869 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Map Info Window ButtonsĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
OpenGIS/waymark-wp#82 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
claude
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
sprain/sprainocchio#39 ·
Maintainer thường phản hồi trong vòng 1 ngày