anomalyco / anomalyco/opencode

[FEATURE]: Explicitly add MCP server config to project level opencode.json

Open
#46,104 0 comments 0 reactions 1 assignee View on GitHub

@nexxeln is already working on this.

Since Aug 29, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Feature hasn't been suggested before.
  • I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request

Re-log of #30933, which was auto-closed after 60 days of inactivity. The request is unchanged and still unimplemented on dev.

Ask: opencode mcp add should support an explicit CLI parameter to choose between project-level (opencode.json in the project directory) and global (~/.config/opencode/opencode.json) config, and should always prompt for the target scope when no parameter is given.

Current behaviour (verified on dev, packages/opencode/src/cli/cmd/mcp.ts):

  • The "Current project" vs "Global" prompt is gated on if (project.vcs === "git") (line 516). Outside a git repository, the interactive flow never asks and the server silently lands in the global config — even though the project config file would otherwise be created for you.
  • There is no explicit flag to force either scope, so automation/scripts can't target a project deterministically.

Notes:

  • PR #44803 (feat(mcp): scoped server config, project approval, and keychain storage) adds opencode mcp add --scope local|project|user, which would cover this — still open/unmerged at time of filing; linking for reference.
  • Expected: e.g. opencode mcp add --project / --global (or a single --scope flag) forces the target config; without the flag, always prompt for scope regardless of git state.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.