Skip to content

feat: import MCP servers from opencode in the setup wizard - #8

Open
wowi42 wants to merge 1 commit into
mainfrom
feat/opencode-mcp-import
Open

feat: import MCP servers from opencode in the setup wizard#8
wowi42 wants to merge 1 commit into
mainfrom
feat/opencode-mcp-import

Conversation

@wowi42

@wowi42 wowi42 commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

What

When the --setup wizard imports from opencode, it now also imports the mcp block from opencode.json(c) and writes it as [mcp.servers.*] entries in config.toml.

Mapping

opencode lecode
type = "local" transport = "stdio" — command array splits into command + args, environmentenv
type = "remote" transport = "http" (or "sse" when the URL ends in /sse); headers carried over
enabled = false enabled = false
timeout (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:

imported from opencode: provider openrouter · api key found · 2 mcp servers

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] to config.toml, and MCP-only import still prompting for a provider. Full suite: 1262 passed (the 7 telemetry failures are pre-existing — optional telemetry extras not installed locally).

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.
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.

1 participant