[Server] Let a framework integration opt out of the HTTP edge middleware without a warning
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
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.
由索引模型根據 Issue 內容生成。
描述
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
- 主要語言
- PHP
- 星號
- 1.6k
- 分支
- 180
- 平均合併
- 3 天 12 分鐘
- 30 天內合併 PR
- 44
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 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 · 2 則留言 ·
維護者通常 1 天內回覆
-
Builder::build() silently skips configured file-based discovery when symfony/finder is missing — should fail loudly可能已有人在做 @ousamabenyounes 於 56 天前認領。 未關閉needs confirmation needs maintainer action Server
難度 2/5 1-3 小時 新手友好度 68/100
modelcontextprotocol/php-sdk#398 · 1 個 reaction ·
維護者通常 1 天內回覆
-
enhancement
難度 2/5 1-3 小時 新手友好度 68/100
modelcontextprotocol/php-sdk#370 ·
維護者通常 1 天內回覆
-
enhancement
難度 4/5 3-5 天 新手友好度 52/100
modelcontextprotocol/php-sdk#587 ·
維護者通常 1 天內回覆
-
bug
難度 3/5 半天 新手友好度 60/100
modelcontextprotocol/php-sdk#586 · 2 則留言 ·
維護者通常 1 天內回覆
查看 modelcontextprotocol/php-sdk 的全部 Issue
相似的 Issue
-
難度 1/5 1 小時以內 新手友好度 85/100
-
L: java:gradle L: java:maven L: ruby:bundler T: bug 🐞
難度 2/5 1-3 小時 新手友好度 76/100
dependabot/dependabot-core#16547 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 65/100
glpi-project/glpi#25922 ·
維護者通常 1 天內回覆
-
Bug
難度 2/5 1-3 小時 新手友好度 70/100
Automattic/safe-publish#726 ·
維護者通常 1 天內回覆
-
[Translation][TwigBridge][TwigBundle] Add `HtmlTranslator` and the `tra…可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉Translation TwigBridge
難度 2/5 1-3 小時 新手友好度 68/100
symfony/symfony-docs#23308 ·
維護者通常 3 天內回覆