-
Notifications
You must be signed in to change notification settings - Fork 4
MCP instructions hardcode anthropic as example provider, causing LLMs to default to it #1
Copy link
Copy link
Open
Description
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
providerIDandmodelIDwhen usingopencode_ask,opencode_reply,opencode_message_send, oropencode_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_MODELenv 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 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
- opencode-mcp v1.10.0
- Client: Claude Code
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels