Skip to content

fix: ship discover-and-add-mcps as a builtin command#409

Merged
kulvirgit merged 1 commit intomainfrom
feat/auto-skill-discovery-fixes
Mar 23, 2026
Merged

fix: ship discover-and-add-mcps as a builtin command#409
kulvirgit merged 1 commit intomainfrom
feat/auto-skill-discovery-fixes

Conversation

@kulvirgit
Copy link
Collaborator

@kulvirgit kulvirgit commented Mar 23, 2026

Summary

  • Toast suggests /discover-and-add-mcps but the command only existed as a project-level .opencode/command/ file not shipped with the package. Register it as a hardcoded command with a .txt template (same pattern as configure-claude) so it ships with every install.

Test plan

  • bun turbo typecheck — clean (pre-existing tracing-viewer-e2e.test.ts error on main, unrelated)
  • Verify /discover-and-add-mcps resolves as a slash command in a fresh install

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added a new "discover-and-add-mcps" command to help users discover and integrate additional Model Context Providers into their workspace.
  • Documentation
    • Simplified the command's prompt/template content for clearer guidance when running the new command.

Copy link

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review.

Tip: disable this comment in your organization's Code Review settings.

@coderabbitai
Copy link

coderabbitai bot commented Mar 23, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: ab2a4e4c-6370-404f-8dc3-368e61a35068

📥 Commits

Reviewing files that changed from the base of the PR and between 36d59fa and dee4895.

📒 Files selected for processing (2)
  • packages/opencode/src/command/index.ts
  • packages/opencode/src/command/template/discover-and-add-mcps.txt
💤 Files with no reviewable changes (1)
  • packages/opencode/src/command/template/discover-and-add-mcps.txt
✅ Files skipped from review due to trivial changes (1)
  • packages/opencode/src/command/index.ts

📝 Walkthrough

Walkthrough

Added a new built-in command discover-and-add-mcps to the command registry with template-backed metadata; removed the YAML front-matter (delimiters and description) from the command's template file.

Changes

Cohort / File(s) Summary
Command Registry
packages/opencode/src/command/index.ts
Added DISCOVER_MCPS: "discover-and-add-mcps" to Command.Default; registered a new default command entry that exposes name/description, source: "command", a template getter using PROMPT_DISCOVER_MCPS, and hints derived from that template.
Template Files
packages/opencode/src/command/template/discover-and-add-mcps.txt
Removed YAML front-matter block (leading --- delimiters and the description: field); remaining template content unchanged.

Estimated Code Review Effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 I hopped through code, found a brand-new track,
A command to scout MCPs and bring them back.
The template's tidy, the registry sings,
I nibble on bugs and dream of spring. ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: shipping a previously unavailable discover-and-add-mcps command as a builtin, which aligns with the core objective of making the command available in fresh installs.
Description check ✅ Passed The description covers the Summary and Test Plan sections from the template, explaining why the change was made and how it was tested, though the Checklist items are not explicitly addressed.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/auto-skill-discovery-fixes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/docs/configure/mcp-servers.md`:
- Around line 92-94: The docs incorrectly state project-scoped configs (e.g.,
`.vscode/mcp.json`) are "discovered but disabled by default"; update the copy to
reflect the actual behavior: discovered project-scoped MCP servers are
auto-loaded at startup unless the opt-out flag `experimental.auto_mcp_discovery:
false` is set, and keep mention of the interactive `/discover-and-add-mcps`
command as an alternative discovery/review flow; adjust the sentence near the
existing lines that reference "Project-scoped configs" and ensure
`experimental.auto_mcp_discovery` and the example `.vscode/mcp.json` are
referenced so users know how to opt out or manually review.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: c7833869-ed6f-4318-a1f4-6ac8462601ba

📥 Commits

Reviewing files that changed from the base of the PR and between 3b6d5d4 and d18215a.

📒 Files selected for processing (4)
  • .opencode/skills/discover-and-add-mcps/SKILL.md
  • docs/docs/configure/mcp-servers.md
  • packages/opencode/src/installation/index.ts
  • packages/opencode/test/installation/installation.test.ts

Comment on lines +92 to +94
- **Home-directory configs** (e.g., `~/.claude.json`) are auto-enabled since they are user-owned.
- **Project-scoped configs** (e.g., `.vscode/mcp.json`) are discovered but **disabled by default** — run `/discover-and-add-mcps` to review and enable them.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Docs appear to contradict current project-scope auto-discovery behavior.

The statement that project-scoped configs are “discovered but disabled by default” looks inconsistent with current behavior, which auto-loads discovered project-scope MCP servers unless experimental.auto_mcp_discovery is set to false. Please align this wording to avoid misleading users on security expectations.

Suggested doc adjustment
-- **Project-scoped configs** (e.g., `.vscode/mcp.json`) are discovered but **disabled by default** — run `/discover-and-add-mcps` to review and enable them.
+- **Project-scoped configs** (e.g., `.vscode/mcp.json`) are discovered and auto-loaded at startup. Run `/discover-and-add-mcps` to review what was found and manage entries.

Based on learnings: auto_mcp_discovery intentionally auto-loads project-scoped MCP servers at startup without a per-server trust prompt, and experimental.auto_mcp_discovery: false is the opt-out.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- **Home-directory configs** (e.g., `~/.claude.json`) are auto-enabled since they are user-owned.
- **Project-scoped configs** (e.g., `.vscode/mcp.json`) are discovered but **disabled by default** — run `/discover-and-add-mcps` to review and enable them.
- **Home-directory configs** (e.g., `~/.claude.json`) are auto-enabled since they are user-owned.
- **Project-scoped configs** (e.g., `.vscode/mcp.json`) are discovered and auto-loaded at startup. Run `/discover-and-add-mcps` to review what was found and manage entries.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/docs/configure/mcp-servers.md` around lines 92 - 94, The docs
incorrectly state project-scoped configs (e.g., `.vscode/mcp.json`) are
"discovered but disabled by default"; update the copy to reflect the actual
behavior: discovered project-scoped MCP servers are auto-loaded at startup
unless the opt-out flag `experimental.auto_mcp_discovery: false` is set, and
keep mention of the interactive `/discover-and-add-mcps` command as an
alternative discovery/review flow; adjust the sentence near the existing lines
that reference "Project-scoped configs" and ensure
`experimental.auto_mcp_discovery` and the example `.vscode/mcp.json` are
referenced so users know how to opt out or manually review.

@kulvirgit kulvirgit changed the title fix: ship discover-and-add-mcps as builtin skill & auth GitHub API calls fix: ship discover-and-add-mcps as builtin skill Mar 23, 2026
@kulvirgit kulvirgit force-pushed the feat/auto-skill-discovery-fixes branch from 43e0e18 to 31d19c7 Compare March 23, 2026 21:41
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
docs/docs/configure/mcp-servers.md (1)

92-94: ⚠️ Potential issue | 🟠 Major

Documentation contradicts actual auto-load behavior.

Line 93 states project-scoped configs are "discovered but disabled by default" — this contradicts the actual behavior where project-scoped MCP servers are auto-loaded at startup without a per-server trust prompt. Users may incorrectly believe these servers won't run automatically, creating false security expectations.

Based on learnings: auto_mcp_discovery intentionally auto-loads project-scoped MCP servers at startup without a per-server trust prompt, and experimental.auto_mcp_discovery: false is the opt-out.

📝 Proposed correction
 - **Home-directory configs** (e.g., `~/.claude.json`) are auto-enabled since they are user-owned.
-- **Project-scoped configs** (e.g., `.vscode/mcp.json`) are discovered but **disabled by default** — run `/discover-and-add-mcps` to review and enable them.
+- **Project-scoped configs** (e.g., `.vscode/mcp.json`) are discovered and **auto-loaded at startup**. Run `/discover-and-add-mcps` to review what was found and manage entries.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/docs/configure/mcp-servers.md` around lines 92 - 94, The docs
incorrectly state project-scoped MCP configs are "disabled by default"; update
the wording to reflect the actual behavior: project-scoped MCP servers are
auto-loaded at startup without a per-server trust prompt, controlled by the
auto_mcp_discovery setting, and can be opted out by setting
experimental.auto_mcp_discovery: false (or the equivalent auto_mcp_discovery
flag); locate and update the section referencing "project-scoped configs" /
".vscode/mcp.json" to clearly state auto-load behavior and the opt-out
configuration.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@docs/docs/configure/mcp-servers.md`:
- Around line 92-94: The docs incorrectly state project-scoped MCP configs are
"disabled by default"; update the wording to reflect the actual behavior:
project-scoped MCP servers are auto-loaded at startup without a per-server trust
prompt, controlled by the auto_mcp_discovery setting, and can be opted out by
setting experimental.auto_mcp_discovery: false (or the equivalent
auto_mcp_discovery flag); locate and update the section referencing
"project-scoped configs" / ".vscode/mcp.json" to clearly state auto-load
behavior and the opt-out configuration.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 8707ce65-2256-40b9-b231-0b314877cbf0

📥 Commits

Reviewing files that changed from the base of the PR and between d18215a and 31d19c7.

📒 Files selected for processing (2)
  • .opencode/skills/discover-and-add-mcps/SKILL.md
  • docs/docs/configure/mcp-servers.md
✅ Files skipped from review due to trivial changes (1)
  • .opencode/skills/discover-and-add-mcps/SKILL.md

@kulvirgit kulvirgit force-pushed the feat/auto-skill-discovery-fixes branch 2 times, most recently from 7faaea0 to 36d59fa Compare March 23, 2026 22:09
@kulvirgit kulvirgit changed the title fix: ship discover-and-add-mcps as builtin skill fix: ship discover-and-add-mcps as a builtin command Mar 23, 2026
Toast suggests `/discover-and-add-mcps` but the command only existed as a
project-level `.opencode/command/` file not shipped with the package. Register
it as a hardcoded command with a `.txt` template (same pattern as
configure-claude) so it ships with every install.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@kulvirgit kulvirgit force-pushed the feat/auto-skill-discovery-fixes branch from 36d59fa to dee4895 Compare March 23, 2026 23:04
@kulvirgit kulvirgit merged commit 528af75 into main Mar 23, 2026
12 checks passed
kulvirgit added a commit that referenced this pull request Mar 23, 2026
The command now ships as a builtin (merged in #409), so keep the docs
and toast referencing it instead of removing them.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
anandgupta42 pushed a commit that referenced this pull request Mar 24, 2026
…tics

Guard against AI-5975 regression (sql.analyze success:false on issues) and
verify the new discover-and-add-mcps builtin command (#409) is registered.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

https://claude.ai/code/session_01BUHCukhUhWNtR82r8iedHG
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.

2 participants