Problem
The MCP server instructions in index.js hardcode anthropic and claude-sonnet-4-5 in all example code blocks:
// line 73
"2. Call `opencode_provider_models({providerId: 'anthropic'})` — lists available models for a provider.",
// line 115
'opencode_ask({prompt: "How does auth work in this project?", providerID: "anthropic", modelID: "claude-sonnet-4-5"})',
// line 121
'opencode_run({prompt: "Build a React login form with validation...", providerID: "anthropic", modelID: "claude-opus-4-6", maxDurationSeconds: 600})',
// line 124
'opencode_fire({prompt: "Build a full React app with auth, dashboard...", providerID: "anthropic", modelID: "claude-opus-4-6"})',
// line 132
'opencode_reply({sessionId: "ses_xxx", prompt: "Now add form validation", providerID: "anthropic", modelID: "claude-sonnet-4-5"})',
Combined with line 142's strong instruction:
"ALWAYS specify providerID and modelID when using opencode_ask, opencode_reply, opencode_message_send, or opencode_message_send_async."
This causes LLM clients (e.g. Claude Code) to always pass providerID: "anthropic" even when the user has no Anthropic API key configured and is using a different provider (e.g. the built-in opencode provider).
Expected behavior
The instructions should either:
- Use the
OPENCODE_DEFAULT_PROVIDER / OPENCODE_DEFAULT_MODEL env vars in examples when set, or
- Auto-detect the first configured provider at startup and use it in examples, or
- At minimum, use generic placeholders like
<your-provider> / <your-model> and instruct the LLM to call opencode_setup first to discover available providers.
Suggested fix
At server startup, query the first configured provider and use it in the instruction examples. Fall back to the env var defaults, then to generic placeholders. This way the instructions match the user's actual setup.
Environment
- opencode-mcp v1.10.0
- Client: Claude Code
Problem
The MCP server instructions in
index.jshardcodeanthropicandclaude-sonnet-4-5in all example code blocks:Combined with line 142's strong instruction:
This causes LLM clients (e.g. Claude Code) to always pass
providerID: "anthropic"even when the user has no Anthropic API key configured and is using a different provider (e.g. the built-inopencodeprovider).Expected behavior
The instructions should either:
OPENCODE_DEFAULT_PROVIDER/OPENCODE_DEFAULT_MODELenv vars in examples when set, or<your-provider>/<your-model>and instruct the LLM to callopencode_setupfirst to discover available providers.Suggested fix
At server startup, query the first configured provider and use it in the instruction examples. Fall back to the env var defaults, then to generic placeholders. This way the instructions match the user's actual setup.
Environment