Docs import a namespace that does not exist: Mcp\Server\Capability\Attribute\McpTool
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 1/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 85/100
- Issue-Typ
- Dokumentation
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- php
- Bereich
- documentation
Rechercherichtung
Aktualisiere die Imports in docs/get-started/first-server.md und README.md; prüfe zunächst die vorhandenen Beispiele anhand der im Issue aufgeführten Attribut-Namespaces von v0.9.0. Fertig ist die Aufgabe, wenn beide Beispiele die Attribute aus Mcp\Capability\Attribute\ importieren, damit sie zum SDK passen. Der vorgeschlagene class_alias ist optional und müsste separat auf den Umfang geprüft werden.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- PHP
- Sterne
- 1.7k
- Forks
- 206
- Ø Merge
- 1 T. 17 Std.
- Gemergte PRs (30 T.)
- 102
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus modelcontextprotocol/php-sdk
-
[Server] Handler type uses bare Closure, hard to decorate RegistryInterface under strict PHPStanOffenServer
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 78/100
modelcontextprotocol/php-sdk#468 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement P3
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
modelcontextprotocol/php-sdk#733 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
[Server] Handle notifications/cancelled on the handshake eraEvtl. vergeben @ump45nose hat das vor 5 Tagen übernommen. Offenhelp wanted improves spec compliance Server
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 57/100
modelcontextprotocol/php-sdk#732 ·
Maintainer antworten meist innerhalb von 1 Tag
-
[Client][Server] Ship extension classes for the two authorization extensionsEvtl. vergeben @chr-hertel hat das vor 6 Tagen übernommen. Offenauth Client Server
modelcontextprotocol/php-sdk#721 · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
[Client] Test cross-app access against a real identity providerEvtl. vergeben @chr-hertel hat das vor 6 Tagen übernommen. Offenauth Client
modelcontextprotocol/php-sdk#720 · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in modelcontextprotocol/php-sdk
Ähnliche Issues
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 82/100
pluginsGLPI/carbon#396 ·
-
[BUG] Bundle products lose their price in RSS feeds: getPrices() was removedEvtl. vergeben @pcvelz hat das heute übernommen. Offen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 90/100
OpenMage/magento-lts#5869 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Map Info Window ButtonsOffen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 90/100
OpenGIS/waymark-wp#82 ·
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Maintainer antworten meist innerhalb von 1 Tag
-
claude
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
sprain/sprainocchio#39 ·
Maintainer antworten meist innerhalb von 1 Tag