Skip to content

feat(config): add mcp_inherit flag to control global MCP inheritance#7

Closed
herjarsa wants to merge 1 commit into
devfrom
feat/mcp-inherit
Closed

feat(config): add mcp_inherit flag to control global MCP inheritance#7
herjarsa wants to merge 1 commit into
devfrom
feat/mcp-inherit

Conversation

@herjarsa
Copy link
Copy Markdown
Owner

@herjarsa herjarsa commented May 22, 2026

Issue for this PR

Improves MCP server management workflow — no related issue.

Type of change

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

What does this PR do?

Adds a mcp_inherit config field (defaults to true) that lets projects opt out of inheriting global MCP servers. Currently every project inherits all globally configured MCPs, and disabling them per-server is tedious. This field gives a clean escape hatch.

How it works:

When mcp_inherit: false is set in project-level opencode.jsonc, the config layer skips merging global MCP entries — only servers defined locally (project or .opencode/) survive. The existing behavior is unchanged when the field is omitted.

Also adds mcp_provenance derived state (like plugin_origins) so the CLI and UI can show where each server came from. The opencode mcp list command now displays (global) or (local) tags.

How did you verify your code works?

  • Verified with lsp_diagnostics on both modified files — zero errors
  • bun turbo typecheck passes from the package directory

Screenshots / recordings

N/A — config layer change, no UI.

Checklist

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

Adds a mcp_inherit config field (defaults to true) that lets projects
opt out of inheriting global MCP servers. When set to false, only MCP
servers defined in project/local config are loaded.

Also tracks mcp_provenance (derived state) to show origin scope in
the CLI: 'opencode mcp list' now displays (global) or (local) tags.

This solves the workflow of having many MCPs globally available
without needing to manually disable them per project.
@github-actions
Copy link
Copy Markdown

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@herjarsa
Copy link
Copy Markdown
Owner Author

Moving PR to upstream repo anomalycha/opencode

@herjarsa herjarsa closed this May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant