feat: import MCP servers from opencode in the setup wizard - #8
Open
wowi42 wants to merge 1 commit into
Open
Conversation
opencode.json(c) mcp blocks now translate into [mcp.servers] entries: type=local becomes stdio (command list split into command + args, environment becomes env), type=remote becomes http (or sse for URLs ending in /sse), with headers, enabled, and timeout (ms -> timeout_s) carried over. Unparseable entries are skipped. MCP servers import even when the provider/model doesn't map onto lecode, and the import summary reports the server count.
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.
What
When the
--setupwizard imports from opencode, it now also imports themcpblock fromopencode.json(c)and writes it as[mcp.servers.*]entries inconfig.toml.Mapping
type = "local"transport = "stdio"— command array splits intocommand+args,environment→envtype = "remote"transport = "http"(or"sse"when the URL ends in/sse);headerscarried overenabled = falseenabled = falsetimeout(ms)timeout_s(s)Unparseable entries are skipped (import stays best-effort). MCP servers import even when the provider/model doesn't map onto lecode — previously that path discarded everything — and the import summary now reports the server count:
Tests
4 new cases in
tests/test_setup_wizard.py: local/remote/sse translation with skip of broken entries, MCP-only import, end-to-end wizard writing[mcp.servers]toconfig.toml, and MCP-only import still prompting for a provider. Full suite: 1262 passed (the 7 telemetry failures are pre-existing — optionaltelemetryextras not installed locally).