Skip to content

MCP instructions hardcode anthropic as example provider, causing LLMs to default to it #1

@lllyys

Description

@lllyys

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:

  1. Use the OPENCODE_DEFAULT_PROVIDER / OPENCODE_DEFAULT_MODEL env vars in examples when set, or
  2. Auto-detect the first configured provider at startup and use it in examples, or
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions