feat: add MCP_ENABLED for the remote MCP surface - #5
Merged
Conversation
Authorizer 2.4.0 can serve its MCP tool surface over HTTP at POST <url>/mcp as an OAuth 2.1 resource server (authorizerdev/authorizer#757). Exposes it through MCP_ENABLED, defaulting to false — it is a new internet-facing authenticated surface and should be opted into. It requires AUTHORIZER_URL. Every token presented at /mcp is checked against this deployment's canonical <url>/mcp, and with no --url that identifier would come from request headers, letting a caller name the audience their own token must match. The server exits at boot rather than serve that, so enabling MCP without AUTHORIZER_URL is a crash, not a degraded mode. Verified: the CMD array still parses as JSON after joining Dockerfile line continuations, and the command string passes `sh -n`.
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.
Adds
MCP_ENABLEDso this deployment can serve Authorizer's MCP tool surface over HTTP atPOST <AUTHORIZER_URL>/mcp, shipped in authorizerdev/authorizer#757.Off by default — it is a new internet-facing authenticated surface and should be opted into.
It requires
AUTHORIZER_URL, and that is a hard failureEvery token presented at
/mcpis checked against this deployment's canonical resource identifier,<url>/mcp. Without--urlthat identifier would be derived from request headers (X-Authorizer-URL,X-Forwarded-Host,Host) — which lets a caller name the audience their own token must match, i.e. no check at all.The server therefore exits at boot in that configuration rather than serving an endpoint that looks authenticated and is not. Enabling MCP without
AUTHORIZER_URLis a crash, not a degraded mode.No new port
MCP is served on the main HTTP port, not one of its own: it must be publicly reachable on the same origin as the OAuth metadata clients discover it through. So there is no Service, Ingress or port change — it inherits the existing routing, CORS, security headers and rate limiting.
Verification
The
CMDarray still parses as JSON after joining Dockerfile line continuations (the way Docker itself parses it), and the resulting command string passessh -n.