[Server] Let a framework integration opt out of the HTTP edge middleware without a warning
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 62/100
Rechercherichtung
Start with StreamableHttpTransport's empty-middleware warning and handshakeMiddleware(), then trace how Drupal's mcp_server integration supplies the empty list. Define an explicit opt-out that suppresses only the deliberate warning while preserving protocol validation, and keep accidental empty lists distinguishable.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
StreamableHttpTransport logs a warning whenever it gets an empty middleware list (added in #307):
Streamable HTTP transport started with an empty middleware list. Default security protections (CORS, DNS rebinding, protocol version validation) are disabled. …
In the Drupal integration (mcp_server), the empty list is deliberate. Drupal's HTTP layer already handles both edge checks:
- CORS comes from Drupal's
cors.config.CorsMiddlewarewould add a second set of CORS headers. - Host validation comes from Drupal's
trusted_host_patterns, which are regular expressions.DnsRebindingProtectionMiddlewaretakes an exact host list and answers 403 for any host not on it.
Since 0.8, the protocol version check runs through handshakeMiddleware() no matter what list is passed, so the "protocol version validation" part of the message no longer applies.
PHP builds a new transport for every request, so this warning becomes one log entry per MCP request on every Drupal site using the SDK.
Could the transport accept an explicit opt-out that doesn't warn? For example, a constructor flag, or a documented value that means "the host application handles CORS and Host validation". The warning still makes sense for an accidental [].
Downstream: https://git.drupalcode.org/project/mcp_server/-/work_items/3585939
- Vorherrschende Sprache
- PHP
- Sterne
- 1.6k
- Forks
- 180
- Ø Merge
- 2 T. 16 Std.
- Gemergte PRs (30 T.)
- 36
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 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Builder::build() silently skips configured file-based discovery when symfony/finder is missing — should fail loudlyEvtl. vergeben @ousamabenyounes hat das vor 55 Tagen übernommen. Offenneeds confirmation needs maintainer action Server
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
modelcontextprotocol/php-sdk#398 · 1 Reaktion ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
modelcontextprotocol/php-sdk#370 ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 52/100
modelcontextprotocol/php-sdk#587 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 3/5 Ein halber Tag Anfängerfreundlichkeit 60/100
modelcontextprotocol/php-sdk#586 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in modelcontextprotocol/php-sdk
Ähnliche Issues
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 78/100
backdrop-contrib/commerce#60 ·
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 76/100
-
needs-triage Platform(Default)
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
Maintainer antworten meist innerhalb von 1 Tag
-
Feature-Request
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
RSS-Bridge/rss-bridge#5123 ·
Maintainer antworten meist innerhalb von 1 Tag
-
[Store] RstLoader detects headings inside indented code blocksEvtl. vergeben @lazerg hat das heute übernommen. OffenBug Status: Needs Review Store
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 1 Tag