Skip to main content
Glama

Switchback MCP

MCP server for Switchback — 按复杂度对 AI 智能体回合进行分类,并选择能处理它们的最便宜模型。可直接用于 Claude Desktop、Cursor、Cline 以及任何 MCP 客户端。

npm Powers VibeKit

VibeKit 构建 — 与驱动我们托管产品中每个“Auto”回合的级联路由器相同。了解更多 →

功能

通过 Model Context Protocol 暴露两个工具:

  • classify_turn — 给定用户消息,返回 {tier: 0|1|2, why, fallback, durationMs}。当您决定是否在旗舰模型上花费,还是为下一个智能体步骤保留便宜模型时使用它。

  • recommend_model — 给定用户消息 + 模型阶梯(便宜 → 旗舰),返回阶梯上能合理处理它的最便宜模型。是 classify_turn 的便捷包装。

两个工具都通过 OpenRouter 发起一次小型模型调用(默认:openai/gpt-5.4-mini,约 $0.0001/次)。故障软降级:任何错误都返回 tier 1 且 fallback: true,而不是阻塞您的智能体。

Related MCP server: oracle-models

安装

npm install -g vibekit-switchback-mcp

配置

设置您的 OpenRouter 密钥(在 https://openrouter.ai/keys 获取):

export OPENROUTER_API_KEY=sk-or-...

可选:覆盖分类器模型:

export SWITCHBACK_CLASSIFIER_MODEL=anthropic/claude-haiku-4.5

Claude Desktop

添加到您的 ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "switchback": {
      "command": "npx",
      "args": ["-y", "vibekit-switchback-mcp"],
      "env": {
        "OPENROUTER_API_KEY": "sk-or-..."
      }
    }
  }
}

Cursor / Cline / 其他

任何支持 stdio 服务器的 MCP 客户端。使用相同的 npx 调用。

示例调用

classify_turn:

{
  "userMessage": "rebuild the auth flow with passkeys"
}

返回:

{
  "tier": 2,
  "why": "architectural rework + new auth method",
  "fallback": false,
  "durationMs": 412
}

recommend_model:

{
  "userMessage": "fix typo in README",
  "ladder": [
    "openai/gpt-5.4-mini",
    "openai/gpt-5.4",
    "openai/gpt-5.5"
  ]
}

返回:

{
  "recommended_model": "openai/gpt-5.4-mini",
  "tier": 0,
  "ladder_size": 3,
  "classifier": { "tier": 0, "why": "trivial copy edit", "fallback": false, "durationMs": 318 }
}

何时使用

  • 多步智能体,可以在各轮之间切换模型。

  • BYOK 风格产品,希望将所有路由保留在用户选择的品牌内 — 为每个用户传递品牌锁定的阶梯。

  • 成本敏感的编排器,希望避免在琐碎回合上花费旗舰费率。

何时不要使用

  • 一次性聊天补全,无法在首次调用后更换模型 — 请改用 OpenRouter 的 auto 或 NotDiamond/Martian。

  • 延迟关键的 200ms 以下首 token 体验 — 分类器会增加 200-500ms。

许可证

MIT。参见 LICENSE

VibeKit 构建。核心库是 vibekit-switchback — 本包是其 MCP 包装器。

A
license - permissive license
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    Classifies development task complexity (LIGHT/MEDIUM/HEAVY) and recommends the most cost-efficient AI model per provider, enabling optimized model selection for coding tasks.
    3
    666
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    Optimizes token costs by intelligently delegating low-complexity tasks to local LLMs via LiteLLM, enabling cost-effective development workflows.
    3
    1
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    Pre-execution cost estimation for LLM agent workflows, providing cost estimates before running tasks and improving accuracy over time through calibration.
    6
    2
    MIT

View all related MCP servers

Related MCP Connectors

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/VibeKit-Bot/vibekit-switchback-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server