Repository navigation
fix(mcp): honour the private-endpoint opt-in during OAuth - #2101
Merged
Merged
Conversation
With MCP_ALLOW_PRIVATE_ENDPOINT on, a plain-HTTP server on the private network connected with a static token but failed OAuth with "MCP remote URL must use HTTPS". The broker's fetches already honoured the flag, but the browser authorization URL check and the RFC 8707 resource binding (including the one used on refresh) validated with the default policy. Pass the flag to the provider and to both checks. Behaviour is unchanged when the flag is off.
|
@tc3oliver is attempting to deploy a commit to the Inbox Zero Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
[Medium impact] The PR appears safe to merge, with the previous test coverage gap addressed. SummaryOAuth URL checks now honor the existing instance opt-in for private endpoints.
Reviews (2) · Last reviewed commit: "test(mcp): cover the private-endpoint op..." · Reviewed by Greptile |
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
An instance that sets
MCP_ALLOW_PRIVATE_ENDPOINT=truecan connect to a plain-HTTP MCP server on its private network with a static token, but OAuth fails with "MCP remote URL must use HTTPS". This blocks servers that advertise OAuth metadata on a LAN, such as a Home Assistant install. The broker's own requests already honour the flag; two URL checks in the OAuth provider did not.What changed
The provider now receives the instance's existing
allowPrivateEndpointsetting from the broker. The browser authorization URL check and the RFC 8707 resource binding, including the one used when refreshing a token, apply it. No new setting.Security note: the flag is an existing owner opt-in, and nothing changes when it is off. When it is on, OAuth authorization URLs and resource bindings may use plain HTTP, the same relaxation the flag already applies to the server URL.
How tested
Two new unit tests in
mcp-oauth.test.tscheck that a private HTTP authorization URL and a private HTTP resource are accepted with the flag and rejected without it. Both failed before the change. Lint, typecheck and the MCP OAuth, transport and connector tests pass.