GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(core): keep snake_case oauth keys in a direct MCP server entry by 4sDriven · Pull Request #55350 · anomalyco/opencode

Conversation

@4sDriven

@4sDriven 4sDriven commented Oct 14, 2026 •
edited by opencode-agent Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #55335

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

When you write a remote MCP server directly under mcp, the entry is decoded with the V1 schema, and that schema only knew the camelCase oauth keys (clientId, callbackPort, ...). So the snake_case keys the docs show (client_id, callback_port, ...) were dropped by the decode, you ended up with oauth: {}, and the login fell back to dynamic client registration with an error that never mentions your config.

I taught that schema both spellings, so a config copied from the docs works. When a block carries both, the snake_case one wins. And when a key is still unknown, normalize now reports it at its own path instead of dropping it in silence, the same way it already reports things like attachment or reasoning on a model.

How did you verify your code works?

Three tests in packages/core/test/config/normalization.test.ts:

  • a snake_case oauth block in a direct entry survives into the encoded config;
  • a camelCase block still maps, and loses to an explicit snake_case key;
  • an unknown key is reported at mcp.<server>.oauth.<key> (and at mcp.servers.<server>.oauth.<key> for the native form).

The first and third fail without the source change, with oauth decoded to {}. With it: bun test test/config/normalization.test.ts gives 39 pass / 0 fail, and bun typecheck in packages/core is clean.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Added by the opencode bot (AI-generated).

Related: #52177

Public API: a direct mcp.<name>.oauth block accepts snake_case keys; unknown oauth keys now produce a diagnostic (backwards compatible)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@github-actions

github-actions Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

opencode-agent[bot]
opencode-agent Bot reviewed Oct 14, 2026
View reviewed changes

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reproduced #55335 from source with the issue's script and a mock auth server that has no dynamic client registration. On the base, a direct mcp.<name> entry with snake_case oauth keys falls back to DCR and fails with Incompatible auth server. With this change, the authorize URL carries the configured client_id, both for snake_case and for camelCase. The new normalization tests pass (they fail on the base), and typecheck in packages/core is clean.

Public API (config keys), backwards compatible:

  • Added: a direct mcp.<name>.oauth block now also accepts client_id, client_secret, callback_port, redirect_uri and auth_server_metadata_url. The camelCase keys still work, and snake_case wins when both are set.
  • Added: unknown keys in an oauth block, both under mcp.<name> and under mcp.servers.<name>, now produce an unsupported diagnostic instead of being dropped silently. Existing valid configs are unaffected.

I have no blocking concerns.

Related: #52177

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
This was referenced Oct 14, 2026
mcp: invalid server entries are silently dropped from config #55419
Open
fix(core): accept snake_case oauth keys in flat MCP entries #55576
Closed
@4sDriven
fix(core): keep snake_case oauth keys in a direct MCP server entry
406a4bb
A direct `mcp.<name>` server is decoded with the V1 schema, which only knew the camelCase
oauth keys, so a config written with the documented snake_case keys lost them and fell back
to dynamic client registration. Accept both spellings, let the native one win, and report
anything still unknown instead of dropping it silently.
@4sDriven
4sDriven force-pushed the mcp-oauth-keys branch from 3e754fa to 406a4bb Compare October 16, 2026 07:34
@github-actions

github-actions Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot closed this Nov 14, 2026
@github-actions github-actions Bot added the automated-pr-cleanup label Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@opencode-agent opencode-agent[bot] opencode-agent[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

automated-pr-cleanup

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

mcp: snake_case keys in a remote server's oauth block are silently dropped, so auth falls back to dynamic client registration with a misleading error

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@4sDriven
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.