anomalyco / anomalyco/opencode
[FEATURE]: Explicitly add MCP server config to project level opencode.json
Open
@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--scopeflag) forces the target config; without the flag, always prompt for scope regardless of git state.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.