[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
- 派生
- 177
- 平均合并
- 2 天 16 小时
- 30 天内合并 PR
- 36
环境准备
- 没有 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 于 55 天前认领。 未关闭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
-
FrameworkBundle SecurityBundle
难度 2/5 1-3 小时 新手友好度 68/100
symfony/symfony-docs#23277 ·
维护者通常 3 天内回复
-
[Sync EN] hard link does not need special permissions可能已有人在做 @lacatoire 今天认领。 未关闭sync-en
难度 1/5 1 小时以内 新手友好度 90/100
维护者通常 1 天内回复
-
sync-en
难度 1/5 1 小时以内 新手友好度 76/100
维护者通常 4 天内回复
-
bug mod:appointments
难度 2/5 1-3 小时 新手友好度 78/100
3pontos-tech/gil-benefits#303 ·
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复