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.
What it is
Pal MCP Server is a Model Context Protocol gateway that connects Claude Code to multiple LLM providers through a single configuration. It supports Gemini, OpenAI, Azure OpenAI, X.AI/Grok, OpenRouter, DIAL, and Ollama, letting you route prompts to the best model for each task without switching tools.
The server is designed for developers who want to leverage model diversity from within their existing Claude Code workflow. Instead of context-switching between CLIs, you send requests through Pal and let it handle provider routing, conversation continuity, and response formatting.
How it saves time or tokens
Pal reduces token waste by routing tasks to the most cost-effective model. A simple code formatting request can go to a smaller model, while complex architecture decisions stay with Claude. The CLI-to-CLI bridge feature (called 'clink') maintains conversation context across model switches, so you do not lose context when switching providers mid-session. This avoids re-prompting and the token overhead that comes with it.
How to use
- Install prerequisites: Python 3.10+, Git, and uv (
pip install uv). - Add the Pal server to your
.mcp.jsonconfiguration:
{
"mcpServers": {
"pal": {
"command": "bash",
"args": ["-c", "uvx --from git+https://github.com/BeehiveInnovations/pal-mcp-server.git pal-mcp-server"],
"env": {
"GEMINI_API_KEY": "your-gemini-key",
"DEFAULT_MODEL": "auto"
}
}
}
}
- Restart Claude Code. The tools
chat,thinkdeep,planner, andconsensusbecome available for multi-model interaction.
Example
Send a planning request through Pal to get perspectives from multiple models:
# In Claude Code, use the planner tool
'Plan a microservices migration for a monolithic Node.js app'
# Pal routes sub-tasks to different models and merges results
The consensus tool queries multiple providers with the same prompt and synthesizes agreement points, useful for architecture decisions where you want diverse AI perspectives.
Related on TokRepo
- AI Gateway Providers — Compare gateway solutions like LiteLLM, OpenRouter, and Portkey alongside Pal
- MCP Integrations — Browse other MCP server configurations for extending Claude Code
Common pitfalls
- Setting
DEFAULT_MODELto a specific model instead of 'auto' defeats the routing benefit. Keep it on 'auto' unless you have a reason to pin. - Each provider needs its own API key in the env block. Missing keys cause silent failures on routes to that provider.
- Conversation continuity via clink requires all participating models to be available. If one provider is down, the context chain breaks.
- Always check the official documentation for the latest version-specific changes and migration guides before upgrading in production environments.
Frequently Asked Questions
Pal supports 7+ providers: Gemini, OpenAI, Azure OpenAI, X.AI/Grok, OpenRouter, DIAL, and Ollama for local models. You configure API keys for each provider you want to use in the .mcp.json env block.
Yes. Pal includes Ollama as a supported provider, so you can route requests to locally running models. This is useful for sensitive data that should not leave your machine or for reducing API costs on simple tasks.
Clink is Pal's CLI-to-CLI bridge that maintains conversation continuity across different AI models. When Claude's context resets, other models can remind Claude of the full discussion history, preventing context loss during long sessions.
No. You only add a new entry to your .mcp.json file and restart Claude Code. Pal runs as a standard MCP server alongside any other servers you already have configured.
Pal exposes four main tools: chat (send messages to any model), thinkdeep (extended reasoning with model selection), planner (multi-step project planning across models), and consensus (get agreement from multiple models on a question).
Citations (3)
- Pal MCP Server GitHub— Pal MCP Server supports 7+ providers with model routing and CLI bridge
- Anthropic MCP Docs— Model Context Protocol specification for tool servers
- Anthropic Docs— Claude Code supports MCP server integration
Related on TokRepo
Source & Thanks
Created by BeehiveInnovations. Licensed under custom license.
pal-mcp-server — ⭐ 11,300+
Thank you for building a powerful multi-model gateway for the AI developer community.