MCP Configs2026年4月4日·1 分钟阅读

Pal MCP Server — Multi-Model AI Gateway for Claude Code

MCP server that lets Claude Code use Gemini, OpenAI, Grok, and Ollama as a unified AI dev team. Features model routing, CLI-to-CLI bridge, and conversation continuity across 7+ providers.

Agent 就绪

这个资产会安全暂存

这个资产会先安全暂存。复制的指令会要求 Agent 读取暂存文件,并在激活脚本、MCP 配置或全局配置前先确认。

Stage only · 17/100策略:需暂存
Agent 入口
任意 MCP/CLI Agent
类型
Mcp Config
安装
Stage only
信任
信任等级:Established
入口
Pal MCP Server — Multi-Model AI Gateway for Claude Code
安全暂存命令
npx -y tokrepo@latest install 09c904b2-4bf7-4f1e-acf5-55cd465b6227 --target codex

先暂存文件;激活前需要读取暂存 README 和安装计划。

TL;DR
Pal MCP is an MCP server that adds Gemini, GPT-4, Grok, and Ollama to Claude Code as callable sub-agents. One config, seven providers.
§01

Why multi-model matters inside one agent

Claude Code is excellent at reasoning. Gemini 2.5 Pro has a 2M context window. GPT-4o is fast. Grok has live web access. Ollama runs offline. A real dev team uses all of them. Pal MCP collapses that into one tool call from Claude Code's perspective — ask it to "call Gemini on this 1.5M-token codebase" and Pal routes the request, returns the result, and maintains conversation continuity.

§02

Single-config setup

Add to .mcp.json:

{
  "mcpServers": {
    "pal": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/BeehiveInnovations/pal-mcp-server.git", "pal-mcp-server"],
      "env": {
        "GEMINI_API_KEY": "your-gemini-key",
        "OPENAI_API_KEY": "your-openai-key",
        "DEFAULT_MODEL": "auto"
      }
    }
  }
}

Restart Claude Code. Now pal_chat, pal_route, and pal_continue are callable.

§03

The routing logic

Set DEFAULT_MODEL=auto and Pal picks a model based on task heuristics:

Task signalRouted modelWhy
Context > 200K tokensGemini 2.5 Pro2M context window
Needs live web factsGrokTwitter/X integration
Code completion loopsOllama CodellamaFree, fast, local
Long reasoning chainso3-previewBest deliberation
DefaultClaude SonnetQuality baseline

Override per-call with pal_chat(model="gpt-4o").

§04

CLI-to-CLI bridge

Pal exposes a raw CLI bridge: call Aider, Continue, or any CLI-based agent from within Claude Code. Useful for chaining specialized agents in a single workflow.

§05

Conversation continuity

Every Pal call can continue an existing thread:

pal_continue(thread_id="xyz", prompt="refactor based on Gemini's suggestions")

Thread state is persisted in SQLite under ~/.pal/threads.db. Survives restarts.

§06

Supported providers in 2026

  • Anthropic (Claude Opus, Sonnet, Haiku)
  • OpenAI (GPT-4o, o3, o3-mini)
  • Google (Gemini 2.5 Pro, Flash)
  • xAI (Grok-3)
  • DeepSeek (R1, V3)
  • Ollama (local, 50+ models)
  • LiteLLM (proxy for 100+ more)
§07

Cost control

Pal emits a cost-summary per session: total tokens, per-model breakdown, $ estimate. Use MAX_COST_PER_SESSION=5 env var to hard-stop runaway loops.

§08

When Pal is not the right choice

  1. Single-model workflows — overhead not worth it, use the provider SDK directly.
  2. Production agents — MCP is still evolving; use LiteLLM Proxy for production-grade routing.
  3. Compliance-regulated environments — each upstream provider has different data policies; Pal doesn't unify compliance.

常见问题

How is Pal different from LiteLLM?+

LiteLLM is a Python proxy library designed for production backends. Pal is an MCP server designed for interactive use inside agents like Claude Code. Pal adds thread continuity and CLI bridging that LiteLLM does not provide, but LiteLLM has stronger production-grade features like retries and load balancing.

Does Pal support local models?+

Yes. Ollama is a first-class provider. Point Pal at your local Ollama instance with OLLAMA_BASE_URL and it will route appropriate tasks to your local models. Useful for offline work or privacy-sensitive data.

Can I use Pal outside Claude Code?+

Yes. Any MCP-compatible client works: Cursor, Codex CLI, Zed, Cline, and others. The MCP protocol is standardized so Pal behaves identically across them.

Is there a cost guardrail?+

Yes. Set MAX_COST_PER_SESSION environment variable to hard-stop sessions that exceed the limit. Pal also emits a per-call cost summary so you can track spending in real time.

Which provider does Pal default to?+

With DEFAULT_MODEL=auto, Pal picks based on task heuristics — Gemini for huge context, Grok for live web facts, Ollama for local code completion, o3 for long reasoning, Claude Sonnet as the quality baseline.

引用来源 (3)
🙏

来源与感谢

Created by BeehiveInnovations. Licensed under custom license.

pal-mcp-server — ⭐ 11,300+

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产