[FEATURE]: Provider/Model-specific MCP servers #3782

Open
opened 2026-02-16 17:41:27 -05:00 by yindo · 0 comments
Owner

Originally created by @ramarivera on GitHub (Dec 23, 2025).

Originally assigned to: @thdxr on GitHub.

Describe the enhancement you want to request

Currently, OpenCode loads all configured MCP servers globally, regardless of which model or provider is selected. This creates several challenges:

Problem Examples

  1. MiniMax Coding Plan MCP (https://platform.minimax.io/docs/guides/coding-plan-mcp-guide) - These MCPs provide MiniMax-specific capabilities that are only useful when using MiniMax models

  2. GLM/Z.AI Coding Plan MCP (https://docs.z.ai/devpack/mcp/vision-mcp-server) - Vision MCP servers that are only relevant for models that explicitly support vision capabilities

  3. Duplication and Pollution - When switching between providers, users end up with unnecessary MCP servers active, causing tool pollution in the context window, unnecessary resource usage, and confusion about which tools are actually relevant

Proposed Solution

Allow MCP servers to be conditionally enabled based on the selected model or provider:

{
  "mcp": {
    "minimax-coding-plan": {
      "type": "local",
      "command": ["minimax-mcp", "serve"],
      "when": {
        "provider": ["minimax"]
      }
    },
    "zai-vision-mcp": {
      "type": "remote",
      "url": "https://mcp.example.com",
      "when": {
        "provider": ["zai-coding-plan"],
        "model": ["glm-*-vision"]
      }
    }
  }
}

Benefits

  1. Cleaner tool environment - Only relevant MCPs are active per model
  2. Reduced context pollution - Smaller tool list improves model performance
  3. Resource optimization - No unnecessary MCP server connections
  4. Better user experience - Clearer tool availability per model

Implementation Notes

  • Support glob patterns for model names (e.g., "glm-*-vision")
  • Support array of providers for servers that work across multiple providers
  • Default to current behavior (all MCPs enabled) if "when" is not specified for backward compatibility

Thank you for considering this enhancement!

Originally created by @ramarivera on GitHub (Dec 23, 2025). Originally assigned to: @thdxr on GitHub. ## Describe the enhancement you want to request Currently, OpenCode loads all configured MCP servers globally, regardless of which model or provider is selected. This creates several challenges: ### Problem Examples 1. **MiniMax Coding Plan MCP** (https://platform.minimax.io/docs/guides/coding-plan-mcp-guide) - These MCPs provide MiniMax-specific capabilities that are only useful when using MiniMax models 2. **GLM/Z.AI Coding Plan MCP** (https://docs.z.ai/devpack/mcp/vision-mcp-server) - Vision MCP servers that are only relevant for models that explicitly support vision capabilities 3. **Duplication and Pollution** - When switching between providers, users end up with unnecessary MCP servers active, causing tool pollution in the context window, unnecessary resource usage, and confusion about which tools are actually relevant ### Proposed Solution Allow MCP servers to be conditionally enabled based on the selected model or provider: ```jsonc { "mcp": { "minimax-coding-plan": { "type": "local", "command": ["minimax-mcp", "serve"], "when": { "provider": ["minimax"] } }, "zai-vision-mcp": { "type": "remote", "url": "https://mcp.example.com", "when": { "provider": ["zai-coding-plan"], "model": ["glm-*-vision"] } } } } ``` ### Benefits 1. **Cleaner tool environment** - Only relevant MCPs are active per model 2. **Reduced context pollution** - Smaller tool list improves model performance 3. **Resource optimization** - No unnecessary MCP server connections 4. **Better user experience** - Clearer tool availability per model ### Implementation Notes - Support glob patterns for model names (e.g., "glm-*-vision") - Support array of providers for servers that work across multiple providers - Default to current behavior (all MCPs enabled) if "when" is not specified for backward compatibility Thank you for considering this enhancement!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3782