feat(mcp): directory config#12131
Open
Mooncake911 wants to merge 4 commits into
Open
Conversation
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (1 files)
Previous Review Summaries (2 snapshots, latest commit fff646a)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit fff646a)Status: 1 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (2 files)
Fix these issues in Kilo Cloud Previous review (commit 79ad350)Status: 2 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (3 files)
Reviewed by gpt-5.6-sol · Input: 41.6K · Output: 4.4K · Cached: 147.2K Review guidance: REVIEW.md from base branch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
Implements feature discussed in kilocode#3579 (comment)
Context
Add support for
.kilocode/mcp/directory-based MCP server configuration. Each.jsonfile insidemcp/defines one MCP server (filename without.jsonextension becomes the server name). This allows users to drop individual MCP server configs as separate files rather than editing a singlemcp.json. Also adds home-level global MCP config from~/.kilocode/and~/.kilo/for consistency with other migrators (rules, workflows, etc.).Implementation
readMcpDirectory()reads individual.jsonfiles from anmcp/subdirectory, skipping non-JSON files and gracefully handling parse errorsloadMcpFromDir()helper loads bothmcp.json(file) andmcp/(directory) from a given base directory — directory entries override file entries for the same server name via deduplicationmigrate()to load home-level global configs (~/.kilocode/and~/.kilo/) alongside the existing VS Code global storage and project-level configs.kilocode<.kilo< project-level.kilocode< project-level.kiloScreenshots / Video
N/A (config-only change, no UI)
How to Test
Manual/local verification
bun test ./test/kilocode/mcp-migrator.test.tsbun run typecheck.kilocode/mcp/directory in a project with a.jsonfile and verify the MCP server loadsReviewer test steps
bun test ./test/kilocode/mcp-migrator.test.ts— all 50 tests should pass.changeset/mcp-directory-config.mdexists and is correctpackages/opencode/src/kilocode/mcp-migrator.tsfor correctness of the loading orderBlocked checks and substitute verification
bun testsuite was run; several pre-existing failures are unrelated to these changes (effect library compatibility, missing node in PATH, timeout-sensitive tests)Checklist
79ad350c614f3b7497595bb2d117d6f0cc95854d)