Skip to content

feat(opencode): support non-interactive MCP add#31054

Merged
rekram1-node merged 2 commits into
devfrom
feat/mcp-noninteractive-add
Jun 6, 2026
Merged

feat(opencode): support non-interactive MCP add#31054
rekram1-node merged 2 commits into
devfrom
feat/mcp-noninteractive-add

Conversation

@rekram1-node
Copy link
Copy Markdown
Collaborator

Summary

  • add non-interactive local MCP registration with repeatable environment variables
  • add non-interactive remote MCP registration with repeatable HTTP headers
  • preserve the existing interactive opencode mcp add flow

Examples

opencode mcp add postgres \
  --env PGUSER=orb \
  -- npx -y @modelcontextprotocol/server-postgres postgresql://localhost/mydb

opencode mcp add github \
  --url https://api.githubcopilot.com/mcp \
  --header "Authorization=Bearer {env:GITHUB_TOKEN}"

Testing

  • bun test test/cli/mcp-add.test.ts
  • bunx prettier --check src/cli/cmd/mcp.ts test/cli/mcp-add.test.ts

Closes #29827

@rekram1-node rekram1-node merged commit ba57718 into dev Jun 6, 2026
8 checks passed
@rekram1-node rekram1-node deleted the feat/mcp-noninteractive-add branch June 6, 2026 02:21
kurom1ii pushed a commit to kurom1ii/opencode that referenced this pull request Jun 6, 2026
ShamirSecret pushed a commit to ShamirSecret/auto-code-machine that referenced this pull request Jun 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: The opencode mcp add command should support directly entering the information required for MCP within the command line

1 participant