fix(opencode): pass MCP OAuth scope to client metadata#26854
Open
joshuapbritz wants to merge 6 commits into
Open
fix(opencode): pass MCP OAuth scope to client metadata#26854joshuapbritz wants to merge 6 commits into
joshuapbritz wants to merge 6 commits into
Conversation
Author
|
This is my first open source PR, so I am not sure I am doing everything correctly here. I really don't want to mess time but had this weird issue as detailed in #26301. I had managed to get around the issue I was having with the specific MCP I was trying to connect to, but found that another user had a similar problem and so I thought I would try to do a fix. I did make use of AI in investigating and fixing this but did review the code myself. I am happy to change anything needed if this is the wrong place to fix this, though I might need some guidance from someone with more experience on the codebase. |
6 tasks
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.
Issue for this PR
Fixes #26301
Type of change
What does this PR do?
Adds a fix to the opencode package to pass through the scope of a package through to the client metadata. This addresses and issue where oAuth authentication is rejected due to invalid scope. The fix made added the scope from config if it is present.
In full disclosure, I have not worked on this codebase before and made strong use of GPT5.5 in figuring this out. The session is available to view here: https://opncd.ai/share/nwfye43n
How did you verify your code works?
bun testopencode.json:bun run --conditions=browser ./src/index.ts --print-logs --log-level DEBUG mcp debug medusa 2>&1 | tee "$OC_TEST_HOME/mcp-debug.log"and verified that scope was included in the url.Checklist
If you do not follow this template your PR will be automatically rejected.