feat(workspace): support mcp configuration from workspace.json#89
feat(workspace): support mcp configuration from workspace.json#89feloy wants to merge 4 commits into
Conversation
Reads the `mcp` block from `.kaiden/workspace.json` and writes MCP server entries into agent settings during the image build. For Claude, command-based servers become stdio entries and URL-based servers become sse entries, both merged into `.claude.json` under `mcpServers`. The `Agent` trait gets a default no-op `set_mcp_servers` so other agents (e.g. OpenCode) are unaffected. Closes openkaiden#88 Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Philippe Martin <phmartin@redhat.com>
Implements set_mcp_servers for OpencodeAgent. Command-based servers become local entries (type "local", command list = [cmd, ...args], environment map) and URL-based servers become remote entries (type "remote", url, headers). Both are merged into the "mcp" key of .config/opencode/config.json, preserving all existing fields. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Philippe Martin <phmartin@redhat.com>
Replace all hardcoded ".config/opencode/config.json" strings in the opencode sub-modules with a shared pub(crate) constant defined in mod.rs, imported via `use super::OPENCODE_CONFIG_FILE` in each module. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Philippe Martin <phmartin@redhat.com>
|
Warning Review limit reached
More reviews will be available in 39 minutes and 7 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds MCP server configuration support to the agent settings pipeline. A new ChangesMCP Server Configuration
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Comment |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/agent/opencode/mod.rs`:
- Around line 99-100: The JSON parsing fallback at the serde_json::from_str call
in the config initialization is using an empty JSON object, which loses the
$schema field when parsing fails. Instead of falling back to an empty json!({})
on parse error, identify what schema-bearing fallback is used elsewhere in the
code for missing files and apply that same fallback pattern here. Replace the
unwrap_or call to use the proper schema object instead of an empty object so the
config maintains schema consistency even when the existing content is malformed.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 74a13d3c-250d-47b8-a3f3-b9bec8e74839
📒 Files selected for processing (8)
src/agent/claude.rssrc/agent/mod.rssrc/agent/opencode/anthropic.rssrc/agent/opencode/mod.rssrc/agent/opencode/ollama.rssrc/agent/opencode/openai.rssrc/agent/opencode/vertexai.rssrc/main.rs
Signed-off-by: Philippe Martin <phmartin@redhat.com>
Fixes #88