Skip to content

feat: default auto_mcp_discovery to true#345

Merged
anandgupta42 merged 3 commits intomainfrom
feat/auto-mcp-discovery-default
Mar 21, 2026
Merged

feat: default auto_mcp_discovery to true#345
anandgupta42 merged 3 commits intomainfrom
feat/auto-mcp-discovery-default

Conversation

@kulvirgit
Copy link
Collaborator

@kulvirgit kulvirgit commented Mar 21, 2026

Summary

  • Changes the auto_mcp_discovery Zod schema from .boolean().optional() to .boolean().default(true) so the config schema explicitly reflects the runtime default (discovery was already enabled unless explicitly set to false)
  • Removes the redundant "(default: true)" note from the describe string since the schema now encodes it
  • Fixes test typechecks by adding the now-required field to test experimental config objects

Test plan

  • Verify bun turbo typecheck passes
  • Confirm MCP auto-discovery still runs by default when auto_mcp_discovery is not set in config
  • Confirm setting "auto_mcp_discovery": false disables discovery

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Configuration
    • Auto MCP discovery is now enabled by default. Explicitly disable it in configuration if preferred.

kulvirgit and others added 2 commits March 20, 2026 17:31
The runtime behavior already defaulted to enabled (discovery runs unless
explicitly set to false), but the Zod schema used `.optional()` which
left the field as `undefined`.  Switch to `.default(true)` so the schema
matches the actual runtime default and serialized configs show the
correct value.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The .default(true) change made the field required in Zod's output type,
so test configs that construct experimental objects need the field.

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

@coderabbitai
Copy link

coderabbitai bot commented Mar 21, 2026

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: cdb7e748-bb78-4293-9577-3f1a78b015db

📥 Commits

Reviewing files that changed from the base of the PR and between d19d813 and d8b6375.

📒 Files selected for processing (3)
  • .opencode/opencode.jsonc
  • packages/opencode/src/config/config.ts
  • packages/opencode/test/tool/skill.test.ts
💤 Files with no reviewable changes (1)
  • .opencode/opencode.jsonc

📝 Walkthrough

Walkthrough

This change modifies the default behavior of auto MCP discovery by removing an explicit false setting from the config file and updating the schema to enforce a default value of true. The schema definition changes from optional to a boolean with a default, ensuring auto discovery is enabled unless explicitly disabled.

Changes

Cohort / File(s) Summary
Config file cleanup
.opencode/opencode.jsonc
Removed the explicit experimental.auto_mcp_discovery: false configuration block and its accompanying comments.
Schema default enforcement
packages/opencode/src/config/config.ts
Updated experimental.auto_mcp_discovery schema from .optional() to .default(true), ensuring the property resolves to true when undefined. Updated descriptive text to reflect startup behavior without explicitly mentioning the default.
Test configuration updates
packages/opencode/test/tool/skill.test.ts
Added explicit experimental.auto_mcp_discovery: true to test project configurations in two test cases to align with the new schema default behavior.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 A discovery awaits, no longer locked away,
Auto MCP springs to life by default each day,
The config grows lighter, the schema more true,
Discovery enabled—let the magic brew! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: making auto_mcp_discovery default to true in the config schema.
Description check ✅ Passed The description covers all required template sections with clear explanations of what changed, why, test plan details, and a checklist.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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-mcp-discovery-default

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.

No longer needed since the schema now defaults to true.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@anandgupta42 anandgupta42 merged commit 2ba7c67 into main Mar 21, 2026
11 checks passed
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