-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
📮 feat: Custom OAuth Headers Support for MCP Server Config #10014
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
📮 feat: Custom OAuth Headers Support for MCP Server Config #10014
Conversation
e066281 to
75fb68e
Compare
|
This should be accompanied by a doc update for https://github.com/LibreChat-AI/librechat.ai |
Good point @nhtruong , drafted the docs update in LibreChat-AI/librechat.ai#427 |
|
The code looks good to me. |
The headers in the MCP config are not sent during the OAuth operations, and they imho should stay separate from them |
…la#10014) * add oauth_headers field to mcp options * wrap fetch to pass oauth headers * fix order * consolidate headers passing * fix tests
…la#10014) * add oauth_headers field to mcp options * wrap fetch to pass oauth headers * fix order * consolidate headers passing * fix tests
…la#10014) * add oauth_headers field to mcp options * wrap fetch to pass oauth headers * fix order * consolidate headers passing * fix tests
Summary
This PR adds the ability to specify custom headers to be used in OAuth MCP server calls (e.g. register), defined in the
oauth_headerskey in the MCP options YAML config.If that key is present it will be passed to the handler functions, which will include them in the
fetchwrapper.The reason for having a separate key completely outside of the
oauthkey is to ensure there's no risk of inadvertently storing/caching them as they might contain sensitive data.Implementation note: a first draft implementation forwarded the main
headersvalues in the OAuth calls instead of getting them from an extra key (the currentoauth_headers), but after thinking a bit about it the extra key has a bunch of benefits:Change Type
Please delete any irrelevant options.
Testing
Added automated tests to make sure the headers are correctly passed down the chain.
Checklist
Please delete any irrelevant options.