Repository navigation
feat: register MCP OAuth2 clients when MCP server configs are updated - #31559
Conversation
38d622f to
8aa1922
Compare
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8aa1922c22
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
8aa1922 to
8f76f57
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8f76f57002
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
8f76f57 to
e3de740
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e3de74095d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
e3de740 to
5f3bccb
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
5f3bccb to
1f7381c
Compare
1f7381c to
c62f94f
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Relates to CODAGT-779
We only ran Dynamic Client Registration when an MCP server config was created. If an admin later switched an existing server to OAuth2, or changed the URL of a server whose client Coder had registered, the server was left without a working client, and users couldn't connect to it.
To fix, create and update now go through the same planner, which registers a client whenever a save needs one. That's when a config becomes
dynamic(on create, when the auth type changes to OAuth2, or whenoauth2_client_registrationchanges frommanualtodynamic), or when the URL of adynamicconfig changes. The update request gets an optionaloauth2_client_registrationfield. When it's omitted, we usedynamicif the resulting config has no client ID, auth URL or token URL, and keep the stored value otherwise.Coder owns the client ID, secret, auth URL and token URL of a
dynamicconfig, so we ignore them when a request leaves them empty or repeats them, and any other value fails with a 400 unless the request also setsmanual. Updates that touch auth fields are also validated now, so amanualconfig without a client ID, auth URL or token URL is rejected. A new client replaces the client ID, so it deletes every user's stored token. If discovery or registration fails, nothing changes, and if the config changes whilst we're registering, the request fails with a409 Conflict.There are a few gaps I've left for now, and documented. A change to the deployment's access URL doesn't register a new client. Configs broken by the old behaviour stay
manualuntil an admin switches them todynamic. We also don't re-register when the provider rejects the client withinvalid_client.