Conversation
Only HttpServerTransport and StreamableHttpServerTransport use react/http, yet every consumer of this package installs it — including stdio users and framework integrations that drive Server/Protocol/Dispatcher themselves. The cost is not just unused packages. Every release of react/http, v1.0.0 through v1.11.1, requires psr/http-message ^1.0, so this package transitively pins its host project's PSR-7 interfaces to 1.x. On a project already on psr/http-message 2.0 a fresh install silently resolves it down to 1.1, and an existing install cannot update at all. react/http moves to suggest, and to require-dev so this repository's own suite is unaffected. psr/http-message becomes a declared dependency at ^1.0 || ^2.0: src/Context.php type-hints ServerRequestInterface and is not transport-specific, so the dependency already exists — it is merely undeclared, and reaches the tree only through react/http, which is also what narrows it to 1.x. Both HTTP transports now fail with a TransportException naming the package and the command to install it, rather than letting a "class not found" escape. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
jpkalus
added a commit
to Netzhirsch/contao-mcp-bundle
that referenced
this pull request
Sep 22, 2026
php-mcp/server#87 moves react/http to `suggest` and declares psr/http-message at ^1.0 || ^2.0. If it is merged and released, the replace entry, this test and the README section on psr/http-message can all be deleted — so the guard should say so rather than leaving the next reader to wonder whether anyone ever tried. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
jpkalus
added a commit
to Netzhirsch/contao-mcp-bundle
that referenced
this pull request
Sep 22, 2026
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
react/httpis a hard requirement of this package, but only two classes use it:HttpServerTransportandStreamableHttpServerTransport. Everyone else pays for it — stdio users, and framework integrations that driveServer/Protocol/Dispatcherthemselves and do their own HTTP.The cost is more than a few unused packages.
react/httprequirespsr/http-message: ^1.0, and every release of it does — v1.0.0 through v1.11.1, no exceptions. Sophp-mcp/servertransitively pins its host project's PSR-7 interfaces to 1.x.That is a hard blocker downstream rather than a theoretical one. Contao 5.7/6 installs
psr/http-message 2.0, so on such a project:psr/http-messagedown to 1.1, andI maintain an MCP server for Contao built on this package. My workaround has been
"replace": { "react/http": "*" }in my own manifest: a claim to Composer that I shipreact/httpmyself, which I do not. It works, and it has a nasty edge — any other package in the project that legitimately requiresreact/httpis told the need is met, receives no files, and dies at runtime. I would like to stop telling Composer that lie.What this changes
react/httpmoves fromrequiretosuggest, and intorequire-devso this repository's own suite is unaffected.psr/http-messagebecomes a declared dependency at^1.0 || ^2.0.src/Context.phptype-hintsPsr\Http\Message\ServerRequestInterfaceand is not transport-specific, so this dependency already exists — it is simply undeclared today and reaches the tree only throughreact/http, which is also what narrows it to 1.x.Both HTTP transports fail with a clear message instead of a bare "Class not found":
README: one line in Requirements, one block in Installation.
Effect on the dependency tree
react/http)react/http,react/socket,react/dns,react/cache,evenementpsr/http-message^1.0 || ^2.0Installing
react/httprestores the previous tree exactly; nothing about the transports changes.Verification
vendor/bin/peston this branch and on an unmodifiedmain, same container, same PHP: identical results — 480 passed, 65 failed, and a diff of the two failure lists comes back empty. The 65 are the integration tests that spawn child processes, which my container cannot host;tests/Unitis 449/449 either way. Your CI is the authority on those, not me.react/httpat all, to check the change actually delivers what it promises:psr/http-messageresolves to 2.0Server::make()->build(),discover()and atools/callthrough theDispatcherall workStreamableHttpServerTransportthrowsTransportExceptionwith the message aboveNote on scope
Happy to drop the
psr/http-messagedeclaration or the transport guards if you would rather keep this to the one-linecomposer.jsonmove — the manifest change is the part that matters. I kept them in because the first makes an existing implicit dependency honest, and the second is what turns "optional" into something a user can diagnose.🤖 Generated with Claude Code