- Notifications
You must be signed in to change notification settings - Fork909
chore: allow MCP to use reduced agent token scope#17858
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Merged
+1,067 −459
Conversation
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
This test was failing inside a Coder workspace due to`CODER_AGENT_TOKEN` being set.Signed-off-by: Thomas Kosiewski <tk@coder.com>
Part of#17649Signed-off-by: Thomas Kosiewski <tk@coder.com>---# Allow MCP server to run without authenticationThis PR enhances the MCP server to operate without requiring authentication, making it more flexible for environments where authentication isn't available or necessary. Key changes:- Replaced `InitClient` with `TryInitClient` to allow the MCP server to start without credentials- Added graceful handling when URL or authentication is missing- Made authentication status visible in server logs- Added logic to skip user-dependent tools when no authenticated user is present- Made the `coder_report_task` tool available with just an agent token (no user token required)- Added comprehensive tests to verify operation without authenticationThese changes allow the MCP server to function in more environments while still using authentication when available, improving flexibility for CI/CD and other automated environments.
Change-Id: I67d271a426be98270ff4b3114466e16718e9a7d6Signed-off-by: Thomas Kosiewski <tk@coder.com>
johnstcn approved these changesMay 15, 2025
Emyrk approved these changesMay 15, 2025
4a70bdc
intorelease/2.22 45 of 46 checks passed
Uh oh!
There was an error while loading.Please reload this page.
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
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.
Backports the following PRs:
Signed-off-by: Thomas Kosiewskitk@coder.com