BP

beehiveinnovations/pal-mcp-server

开发工具
1.2万 stars 0 forks 质量 99 趋势 99

The power of Claude Code / GeminiCLI / CodexCLI + [Gemini / OpenAI / OpenRouter / Azure / Grok / Ollama / Custom Model / All Of The Above] working as one.

概览

Your AI's PAL – a Provider Abstraction Layer Formerly known as Zen MCP Claude Code · Gemini CLI · Codex CLI · Qwen Code CLI · Cursor · and more Gemini · OpenAI · Anthropic · Grok · Azure · Ollama · OpenRouter · DIAL · On-Device Model The new (CLI + Link) tool connects external AI CLIs directly into your workflow: - like Gemini CLI, Codex CLI, and Claude Code directly into your workflow - - Launch isolated CLI instances from within your current CLI! Claude Code can spawn Codex subagents, Codex can spawn Gemini CLI subagents, etc. Offload heavy tasks (code reviews, bug hunting) to fresh contexts while your main session's context window remains unpolluted. Each subagent returns only final results.

README

PAL MCP: Many Workflows. One Context.


🆕 Now with CLI-to-CLI Bridge

The new clink (CLI + Link) tool connects external AI CLIs directly into your workflow:

  • Connect external CLIs like Gemini CLI, Codex CLI, and Claude Code directly into your workflow
  • CLI Subagents - Launch isolated CLI instances from within your current CLI! Claude Code can spawn Codex subagents, Codex can spawn Gemini CLI subagents, etc. Offload heavy tasks (code reviews, bug hunting) to fresh contexts while your main session’s context window remains unpolluted. Each subagent returns only final results.
  • Context Isolation - Run separate investigations without polluting your primary workspace
  • Role Specialization - Spawn planner, codereviewer, or custom role agents with specialized system prompts
  • Full CLI Capabilities - Web search, file inspection, MCP tool access, latest documentation lookups
  • Seamless Continuity - Sub-CLIs participate as first-class members with full conversation context between tools
# Codex spawns Codex subagent for isolated code review in fresh context
clink with codex codereviewer to audit auth module for security issues
# Subagent reviews in isolation, returns final report without cluttering your context as codex reads each file and walks the directory structure

# Consensus from different AI models → Implementation handoff with full context preservation between tools
Use consensus with gpt-5 and gemini-pro to decide: dark mode or offline support next
Continue with clink gemini - implement the recommended feature
# Gemini receives full debate context and starts coding immediately

👉 Learn more about clink


Why PAL MCP?

Why rely on one AI model when you can orchestrate them all?

A Model Context Protocol server that supercharges tools like Claude Code, Codex CLI, and IDE clients such as Cursor or the Claude Dev VS Code extension. PAL MCP connects your favorite AI tool to multiple AI models for enhanced code analysis, problem-solving, and collaborative development.

True AI Collaboration with Conversation Continuity

PAL supports conversation threading so your CLI can discuss ideas with multiple AI models, exchange reasoning, get second opinions, and even run collaborative debates between models to help you reach deeper insights and better solutions.

Your CLI always stays in control but gets perspectives from the best AI for each subtask. Context carries forward seamlessly across tools and models, enabling complex workflows like: code reviews with multiple models → automated planning → implementation → pre-commit validation.

You’re in control. Your CLI of choice orchestrates the AI team, but you decide the workflow. Craft powerful prompts that bring in Gemini Pro, GPT 5, Flash, or local offline models exactly when needed.

Quick Start (5 minutes)

Prerequisites: Python 3.10+, Git, uv installed

1. Get API Keys (choose one or more):

  • OpenRouter - Access multiple models with one API
  • Gemini - Google’s latest models
  • OpenAI - O3, GPT-5 series
  • Azure OpenAI - Enterprise deployments of GPT-4o, GPT-4.1, GPT-5 family
  • X.AI - Grok models
  • DIAL - Vendor-agnostic model access
  • Ollama - Local models (free)

2. Install (choose one):

Option A: Clone and Automatic Setup (recommended)

git clone https://github.com/BeehiveInnovations/pal-mcp-server.git
cd pal-mcp-server

# Handles everything: setup, config, API keys from system environment. 
# Auto-configures Claude Desktop, Claude Code, Gemini CLI, Codex CLI, Qwen CLI
# Enable / disable additional settings in .env
./run-server.sh  

Option B: Instant Setup with uvx

// Add to ~/.claude/settings.json or .mcp.json
// Don't forget to add your API keys under env
{
  "mcpServers": {
    "pal": {
      "command": "bash",
      "args": ["-c", "for p in $(which uvx 2>/dev/null) $HOME/.local/bin/uvx /opt/homebrew/bin/uvx /usr/local/bin/uvx uvx; do [ -x \"$p\" ] && exec \"$p\" --from git+https://github.com/BeehiveInnovations/pal-mcp-server.git pal-mcp-server; done; echo 'uvx not found' >&2; exit 1"],
      "env": {
        "PATH": "/usr/local/bin:/usr/bin:/bin:/opt/homebrew/bin:~/.local/bin",
        "GEMINI_API_KEY": "your-key-here",
        "DISABLED_TOOLS": "analyze,refactor,testgen,secaudit,docgen,tracer",
        "DEFAULT_MODEL": "auto"
      }
    }
  }
}

3. Start Using!

"Use pal to analyze this code for security issues with gemini pro"
"Debug this error with o3 and then get flash to suggest optimizations"
"Plan the migration strategy with pal, get consensus from multiple models"
"clink with cli_name=\"gemini\" role=\"planner\" to draft a phased rollout plan"

👉 Complete Setup Guide with detailed installation, configuration for Gemini / Codex / Qwen, and troubleshooting 👉 Cursor & VS Code Setup for IDE integration instructions 📺 Watch tools in action to see real-world examples

Provider Configuration

PAL activates any provider that has credentials in your .env. See .env.example for deeper customization.

Core Tools

Note: Each tool comes with its own multi-step workflow, parameters, and descriptions that consume valuable context window space even when not in use. To optimize performance, some tools are disabled by default. See Tool Configuration below to enable them.

Collaboration & Planning (Enabled by default)

  • clink - Bridge requests to external AI CLIs (Gemini planner, codereviewer, etc.)
  • chat - Brainstorm ideas, get second opinions, validate approaches. With capable models (GPT-5.2 Pro, Gemini 3.0 Pro), generates complete code / implementation
  • thinkdeep - Extended reasoning, edge case analysis, alternative perspectives
  • planner - Break down complex projects into structured, actionable plans
  • consensus - Get expert opinions from multiple AI models with stance steering

Code Analysis & Quality

  • debug - Systematic investigation and root cause analysis
  • precommit - Validate changes before committing, prevent regressions
  • codereview - Professional reviews with severity levels and actionable feedback
  • analyze (disabled by default - enable) - Understand architecture, patterns, dependencies across entire codebases

Development Tools (Disabled by default - enable)

  • refactor - Intelligent code refactoring with decomposition focus
  • testgen - Comprehensive test generation with edge cases
  • secaudit - Security audits with OWASP Top 10 analysis
  • docgen - Generate documentation with complexity analysis

Utilities

  • apilookup - Forces current-year API/SDK documentation lookups in a sub-process (saves tokens within the current context window), prevents outdated training data responses
  • challenge - Prevent “You’re absolutely right!” responses with critical analysis
  • tracer (disabled by default - enable) - Static analysis prompts for call-flow mapping

📺 Watch Tools In Action

Key Features

AI Orchestration

  • Auto model selection - Claude picks the right AI for each task
  • Multi-model workflows - Chain different models in single conversations
  • Conversation continuity - Context preserved across tools and models
  • Context revival - Continue conversations even after context resets

Model Support

  • Multiple providers - Gemini, OpenAI, Azure, X.AI, OpenRouter, DIAL, Ollama
  • Latest models - GPT-5, Gemini 3.0 Pro, O3, Grok-4, local Llama
  • Thinking modes - Control reasoning depth vs cost
  • Vision support - Analyze images, diagrams, screenshots

Developer Experience

  • Guided workflows - Systematic investigation prevents rushed analysis
  • Smart file handling - Auto-expand directories, manage token limits
  • Web search integration - Access current documentation and best practices
  • Large prompt support - Bypass MCP’s 25K token limit

Example Workflows

Multi-model Code Review:

"Perform a codereview using gemini pro and o3, then use planner to create a fix strategy"

→ Claude reviews code systematically → Consults Gemini Pro → Gets O3’s perspective → Creates unified action plan

Collaborative Debugging:

"Debug this race condition with max thinking mode, then validate the fix with precommit"

→ Deep investigation → Expert analysis → Solution implementation → Pre-commit validation

Architecture Planning:

"Plan our microservices migration, get consensus from pro and o3 on the approach"

→ Structured planning → Multiple expert opinions → Consensus building → Implementation roadmap

👉 Advanced Usage Guide for complex workflows, model configuration, and power-user features

📖 Documentation

🔧 Setup & Support

License

Apache 2.0 License - see LICENSE file for details.

Acknowledgments

Built with the power of Multi-Model AI collaboration 🤝

Star History

View this README on GitHub

安装

This server does not publish a one-line install command.

Open the repository installation guide

配置

// Add to ~/.claude/settings.json or .mcp.json // Don't forget to add your API keys under env { "mcpServers": { "pal": { "command": "bash", "args": ["-c", "for p in $(which uvx 2>/dev/null) $HOME/.local/bin/uvx /opt/homebrew/bin/uvx /usr/local/bin/uvx uvx; do [ -x \"$p\" ] && exec \"$p\" --from git+https://github.com/BeehiveInnovations/pal-mcp-server.git pal-mcp-server; done; echo 'uvx not found' >&2; exit 1"], "env": { "PATH": "/usr/local/bin:/usr/bin:/bin:/opt/homebrew/bin:~/.local/bin", "GEMINI_API_KEY": "your-key-here", "DISABLED_TOOLS": "analyze,refactor,testgen,secaudit,docgen,tracer", "DEFAULT_MODEL": "auto" } } } }