Conversation
✅ Deploy Preview for theagentrouter ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
aigw run --mcp-config only recognized credentials supplied as Authorization: Bearer <token>, so MCP servers that require a different header (e.g. Composio's x-consumer-api-key) never got their auth. Extend AddMCPServers to also recognize a single non-Authorization header as the credential, and thread it through to the MCPRoute securityPolicy.apiKey.header field the CRD already supports. Signed-off-by: Anurag Aggarwal <kanurag94@gmail.com>
kanurag94
force-pushed
the
mcp-custom-auth-header
branch
from
September 15, 2026 21:32
bc73f91 to
223e265
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
kanurag94
marked this pull request as ready for review
September 15, 2026 22:57
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.
Description
aigw run --mcp-configonly recognized a credential when it was supplied asAuthorization: Bearer <token>. MCP servers that require a different header for auth, like Composio'sx-consumer-api-key, never got their credential sent, because any non-Authorizationheader was silently dropped by the config generation template.This extends
AddMCPServersto also recognize a single non-Authorizationheader as the server's credential, and threads the header name through to theMCPRoute'ssecurityPolicy.apiKey.headerfield, which the CRD and its controller already fully support, reusing that existing mechanism rather than adding anything new at the CRD/controller layer.Authorization: Bearer <token>keeps working exactly as before.x-consumer-api-key: ${COMPOSIO_API_KEY}) is now extracted and re-injected into that same header name on the upstream request, unprefixed.Test plan:
go test ./internal/autoconfig/...- new unit test for the custom-header extraction, plus a new golden-file test (testdata/composio.yaml) exercising the full template render end-to-endgo test ./cmd/aigw/...go build ./...gofmt -l/go vetclean on changed filesRelated Issues/PRs (if applicable)
None.
Special notes for reviewers (if applicable)
None.