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(cli): preserve legacy MCP config shape by yaohuangguan · Pull Request #52667 · anomalyco/opencode

Conversation

@yaohuangguan

@yaohuangguan yaohuangguan commented Oct 2, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #49904

Type of change

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

What does this PR do?

Keeps new/native V2 MCP config on mcp.servers, but preserves an existing legacy flat mcp.<name> map when mcp add writes another server. This avoids turning a shared global config into a mixed shape that 1.x cannot load.

How did you verify your code works?

  • Added 3 regression tests for new, legacy-flat, and native-nested configs
  • Ran the real mcp add --global command against a flat JSONC config
  • bun typecheck in packages/cli
  • oxlint, Prettier, and git diff --check

Screenshots / recordings

Not a UI change.

Checklist

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

Sorry, something went wrong.

Uh oh!

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

All reactions
@yaohuangguan
fix(cli): preserve legacy MCP config shape
e8f3fdd
@github-actions github-actions Bot added the needs:issue label Oct 2, 2026
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

All reactions

Sorry, something went wrong.

Uh oh!

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

@github-actions

github-actions Bot commented Oct 2, 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.

@yaohuangguan yaohuangguan mentioned this pull request Oct 2, 2026
MCP: invalid location of mcp when used --global #49904
Closed
@thdxr
thdxr changed the base branch from v2 to dev October 10, 2026 19:27
@github-actions github-actions Bot removed the needs:issue label Oct 10, 2026
@yaohuangguan

yaohuangguan commented Oct 10, 2026

Copy link
Copy Markdown
Author

Quick follow-up for review: this keeps newly created V2 MCP configs under mcp.servers while preserving an existing flat mcp.<name> map when mcp add --global is used, avoiding a mixed shared config that breaks 1.x. The PR includes regression tests for new, flat, and nested configurations; the current standards/compliance checks are green. Would maintainers be comfortable with this compatibility behavior, or prefer a different detection rule? Happy to adjust.

All reactions

Sorry, something went wrong.

Uh oh!

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

@kvnloo kvnloo mentioned this pull request Oct 11, 2026
[origin-review] anomalyco/opencode#52667 — LIMITED; owner handoff awaiting authorization kvnloo/opencode#203
Open
@kvnloo

kvnloo commented Oct 11, 2026

Copy link
Copy Markdown

Independent, AI-assisted evidence for yaohuangguan's head e8f3fddf9913adc1254cd50ad3d65ed798e0b4e1, base 7b3d4ce3a7dbd2a6d3637722a0d5f22a7d086937: the legacy schema permits { enabled: boolean }, but the writer's detector recognizes only typed local/remote entries. An enabled-only flat map selects mcp.servers.probe. If the legacy entry is literally named servers, the extracted normalizer omits the nested new addition; an existing typed github sibling survives. This is pre-existing incomplete compatibility coverage, not a newly introduced regression or loss of working typed servers.

The immutable packet records 24 passing extracted-source observations, 2 failing conditional flat-preservation expectations, and a passing source-identity negative control. These are recovered receipts, not fresh execution. Two minimal collision checks use no codec stand-ins; four normalizer controls use narrow stand-ins.

Actual JSONC parse/edit, comments/trailing commas, filesystem writes, CLI, Effect/final schema decode, MCP launch, package suites and typecheck were not run; genuine-comment fixtures remain unexecuted acceptance inputs. Implementation/test credit remains with yaohuangguan. Whether to extend flat-map preservation to these enabled-only cases remains an owner/maintainer decision, consistent with the existing detection-rule question.

All reactions

Sorry, something went wrong.

Uh oh!

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

@opencode-agent opencode-agent Bot mentioned this pull request Oct 15, 2026
cli: mcp list / mcp auth ignore the global config — servers added with --global are invisible #55811
Closed
@kvnloo kvnloo mentioned this pull request Oct 16, 2026
Promotion queue — upstream candidates (single canonical issue) kvnloo/opencode#208
Open
@yaohuangguan

yaohuangguan commented Oct 19, 2026

Copy link
Copy Markdown
Author

Closing this to align with the maintainer decision on #49904: V2 intentionally writes new MCP entries under mcp.servers, and the issue was closed as not planned. The compatibility tests passed locally, but this PR proposes a different write policy. Thanks for reviewing the report; I won't keep an implementation open against the decided behavior.

All reactions

Sorry, something went wrong.

Uh oh!

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

@yaohuangguan yaohuangguan closed this Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

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

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

MCP: invalid location of mcp when used --global

Uh oh!

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

2 participants

@yaohuangguan @kvnloo
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.