-
Notifications
You must be signed in to change notification settings - Fork 23
fix: support remote MCP server migration in mcp-migrator #247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
marius-kilocode
merged 4 commits into
dev
from
session/agent_e1ed26e3-9a3d-4bc7-a45c-a0fc8d154116
Feb 12, 2026
Merged
fix: support remote MCP server migration in mcp-migrator #247
marius-kilocode
merged 4 commits into
dev
from
session/agent_e1ed26e3-9a3d-4bc7-a45c-a0fc8d154116
Feb 12, 2026
Conversation
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
The MCP migrator only handled stdio/local MCP servers. When a user configured a remote streamable-http or sse MCP server in .kilocode/mcp_settings.json, it failed with: The "file" argument must be of type string. Received undefined This happened because convertServer() always assumed local servers, building a command array from server.command (which is undefined for remote servers). Changes: - Add remote transport type detection (streamable-http, sse) - Convert remote servers to Config.McpRemote (type: "remote") - Pass through url and headers fields - Make command optional in KilocodeMcpServer interface - Add comprehensive tests for remote server migration
Contributor
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
Contributor
Author
Code Review SummaryStatus: 1 Issues Found | Recommendation: Address before merge Overview
Fix these issues in Kilo Cloud Issue Details (click to expand)WARNING
Other Observations (not in diff)Issues found in unchanged code that cannot receive inline comments:
Files Reviewed (2 files)
|
Add guard clauses for missing url on remote servers and missing command on local servers instead of using non-null assertions that could crash on malformed config files.
eshurakov
approved these changes
Feb 12, 2026
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.
Problem
The MCP migrator at
packages/opencode/src/kilocode/mcp-migrator.tsonly handled stdio/local MCP servers. When a user configured a remotestreamable-httporsseMCP server in.kilocode/mcp_settings.json:{ "mcpServers": { "local-mcp": { "type": "streamable-http", "url": "http://localhost:4321/mcp" } } }It failed with:
The "file" argument must be of type string. Received undefinedThis happened because
convertServer()always assumed local servers, building a command array fromserver.command— which isundefinedfor remote servers.Solution
Updated
mcp-migrator.tsto detect remote transport types (streamable-http,sse) and convert them toConfig.McpRemote(type: "remote") instead of always producingConfig.McpLocal.Changes
packages/opencode/src/kilocode/mcp-migrator.ts:REMOTE_TYPESset andisRemote()helper to detect remote server configsconvertServer()to branch on remote vs local servers{ type: "remote", url, headers? }(matchingConfig.McpRemote)commandoptional inKilocodeMcpServerinterface since remote servers don't have itpackages/opencode/test/kilocode/mcp-migrator.test.ts:streamable-httpserver conversionsseserver conversionmigrate()for all remote scenariosTest Results
All 27 tests pass (20 existing + 7 new remote-specific tests via
migrate()+ 4 newconvertServerunit tests):Built for Marius Wichtner by Kilo for Slack