MCPInstall

pal-mcp-server-multi-model-orchestration

Use PAL MCP to orchestrate multiple AI models (Gemini, OpenAI, Grok, Ollama) for code reviews, debugging, planning, and CLI bridging

Installs
226
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/reason-machines/mcp-skills --skill pal-mcp-server-multi-model-orchestration
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads pal-mcp-server-multi-model-orchestration automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

PAL MCP Server: Multi-Model AI Orchestration

Skill by ara.so — MCP Skills collection.

PAL MCP (Provider Abstraction Layer) is an MCP server that enables AI coding assistants like Claude Code, Cursor, and Codex CLI to orchestrate multiple AI models within a single workflow. It provides conversation continuity across models, CLI-to-CLI bridging, and specialized workflows for code review, debugging, planning, and security auditing.

What PAL MCP Does

  • Multi-Model Orchestration: Coordinate Gemini, OpenAI, Anthropic, Grok, Azure, Ollama, and OpenRouter models in one conversation
  • Conversation Threading: Full context flows across tools and models - later models remember what earlier ones said
  • CLI Bridging (clink): Spawn isolated CLI instances (Gemini CLI, Codex CLI, Claude Code) as subagents with specialized roles
  • Context Isolation: Run separate investigations without polluting your primary workspace
  • Extended Context Windows: Delegate to models with larger context (Gemini's 1M tokens, O3's 200K tokens)
  • Specialized Workflows: Built-in tools for code review, debugging, planning, security audits, and pre-commit checks

Installation

Prerequisites

Option A: Clone and Automatic Setup (Recommended)

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

# Handles setup, config, API keys from environment
# Auto-configures Claude Desktop, Claude Code, Gemini CLI, Codex CLI
./run-server.sh

Option B: Instant Setup with uvx

Add to ~/.claude/settings.json or .mcp.json:

{
  "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": "",
        "OPENAI_API_KEY": "",
        "XAI_API_KEY": "",
        "OPENROUTER_API_KEY": "",
        "DISABLED_TOOLS": "analyze,refactor,testgen,secaudit,docgen,tracer",
        "DEFAULT_MODEL": "auto"
      }
    }
  }
}

Required API Keys

Set at least one provider's API key as environment variables or in .env:

# Choose one or more providers
export GEMINI_API_KEY=your_key_here
export OPENAI_API_KEY=your_key_here
export OPENROUTER_API_KEY=your_key_here
export XAI_API_KEY=your_key_here
export AZURE_OPENAI_KEY=your_key_here
# For local models - no key needed
# Just run: ollama serve

Core Tools

pal - Multi-Model Orchestration

The main tool for querying multiple AI models with conversation continuity.

# Basic usage - auto model selection
"Use pal to analyze this authentication code for security issues"

# Specific model
"Use pal with gemini-pro to review the API design"

# Multiple models for consensus
"Get consensus using pal with gpt-5 and gemini-pro: should we use REST or GraphQL?"

# Vision analysis
"Use pal with gemini-pro to analyze this architecture diagram"

Key Parameters:

  • prompt (required): The instruction for the AI model
  • model (optional): Specific model to use (e.g., "gemini-pro", "gpt-5", "o3-mini")
  • conversation_id (optional): Continue a previous conversation thread
  • system_prompt (optional): Custom system instructions
  • max_tokens (optional): Response length limit
  • temperature (optional): 0.0-2.0, controls randomness

Common Models:

  • gemini-pro - Deep thinking, 1M token context
  • gemini-flash - Fast responses
  • gpt-5 - Strong reasoning
  • o3-mini - Fast OpenAI reasoning
  • grok-beta - X.AI's model
  • llama3 - Local via Ollama

clink - CLI-to-CLI Bridge

Spawn external AI CLIs as subagents with isolated contexts and specialized roles.

# Spawn Gemini CLI subagent with code reviewer role
"Use clink with gemini codereviewer to audit the auth module"

# Codex subagent for isolated investigation
"Use clink with codex to investigate the memory leak in isolation"

# Custom role with system prompt
"Use clink with gemini role='security-expert' system_prompt='Focus on OWASP Top 10' to scan for vulnerabilities"

# Multi-step workflow
"""
1. Use consensus with gpt-5 and gemini-pro to decide: add dark mode or offline support next
2. Continue with clink gemini - implement the recommended feature
"""

Key Parameters:

  • cli_name (required): "gemini", "codex", or "claude"
  • prompt (required): Task for the subagent
  • role (optional): "planner", "codereviewer", "debugger", or custom
  • system_prompt (optional): Custom instructions for the subagent
  • timeout (optional): Max execution time in seconds

Benefits:

  • Fresh context window for heavy tasks
  • Parallel investigations without context pollution
  • Role specialization (planner vs. implementer)
  • Full CLI capabilities (web search, file access, MCP tools)

codereview - Multi-Pass Code Analysis

Systematic code review workflow with confidence tracking and multi-model consensus.

# Basic code review
"Perform a codereview of the payment processing module"

# Multi-model review
"Use codereview with gemini-pro and o3 to review the authentication system"

# With planning and implementation
"""
Perform a codereview using gemini-pro and o3, then:
1. Use planner to generate a detailed fix plan
2. Implement the critical and high-priority fixes
3. Do a final precommit check
"""

Workflow:

  1. Initial code exploration (confidence: exploring)
  2. Pattern identification (confidence: low → medium)
  3. Issue collection with severity levels (critical, high, medium, low)
  4. Multi-model validation if specified
  5. Consolidated report with actionable recommendations

debughelp - Systematic Debugging Assistant

Root cause analysis with hypothesis tracking and confidence scoring.

# Debug with error context
"Use debughelp to investigate why the API returns 500 on user creation"

# Multi-model debugging
"Debug this memory leak with o3, then verify the fix with gemini-pro"

Workflow:

  1. Error symptom collection
  2. Hypothesis generation with confidence levels
  3. Systematic investigation
  4. Root cause identification
  5. Fix recommendations with validation steps

planner - Strategic Planning Workflow

Break down complex tasks into phased, actionable plans.

# Migration planning
"Use planner to create a strategy for migrating from REST to GraphQL"

# Multi-model consensus planning
"Use planner with gpt-5 and gemini-pro to design the microservices architecture"

Workflow:

  1. Goal clarification
  2. Constraint identification
  3. Phase breakdown
  4. Risk assessment
  5. Deliverable definition with success criteria

precommit - Pre-Commit Validation

Final validation before committing changes, aware of previous code review context.

# After implementing fixes
"Perform a precommit check on the authentication changes"

# With specific model
"Use precommit with gemini-pro to validate the security fixes"

Checks:

  • Regression risk assessment
  • Security implications
  • Performance impact
  • Test coverage validation
  • Documentation updates

Configuration

Environment Variables

# Provider API Keys
GEMINI_API_KEY=your_key_here
OPENAI_API_KEY=your_key_here
OPENROUTER_API_KEY=your_key_here
XAI_API_KEY=your_key_here

# Azure OpenAI
AZURE_OPENAI_KEY=your_key_here
AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com/
AZURE_OPENAI_DEPLOYMENT=gpt-4o

# Model Settings
DEFAULT_MODEL=auto  # or specific model like "gemini-pro"
DEFAULT_TEMPERATURE=0.7
DEFAULT_MAX_TOKENS=8000

# Tool Configuration
DISABLED_TOOLS=analyze,refactor,testgen,secaudit,docgen,tracer

# Logging
LOG_LEVEL=INFO  # DEBUG, INFO, WARNING, ERROR
LOG_FILE=pal-mcp.log

Model Aliases

PAL supports shorthand aliases for common models:

# These are equivalent
"use pal with gemini-pro"
"use pal with gemini-2.0-flash-exp"

# Aliases
"gemini-flash" → "gemini-2.0-flash-exp"
"gemini-pro" → "gemini-2.0-pro-exp"
"gpt-5" → "gpt-5-turbo"
"o3" → "o3-mini"

Cursor & VS Code Integration

Create .mcp.json in your project root:

{
  "mcpServers": {
    "pal": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/pal-mcp-server",
        "run",
        "pal-mcp-server"
      ],
      "env": {
        "GEMINI_API_KEY": "",
        "OPENAI_API_KEY": ""
      }
    }
  }
}

Real-World Workflows

Multi-Model Code Review Pipeline

# Full code review → planning → implementation → validation
"""
1. Perform a codereview of the payment module using gemini-pro and o3
2. Use planner to break down the critical and high-priority fixes
3. Implement the fixes for issues marked 'critical'
4. Use precommit with gemini-pro to validate before committing
"""

What happens:

  1. Claude walks the code, identifying issues
  2. Gemini Pro performs deep analysis (1M token context)
  3. O3 validates findings with strong reasoning
  4. Consolidated report with severity levels
  5. Planner creates phased fix strategy
  6. Claude implements critical fixes
  7. Gemini Pro validates changes with full context of original review

Context Revival After Reset

# When Claude's context resets mid-workflow
"""
Continue with gemini-pro from conversation_id abc123 to remind me of 
the security issues we discussed and the fixes we planned
"""

Benefit: Other models maintain conversation history and can "refresh" Claude's understanding without re-reading all files.

Isolated Sub-Investigation

# Main task in Claude, detailed analysis in subagent
"""
Use clink with gemini role='security-auditor' to:
1. Scan all API endpoints for OWASP Top 10 vulnerabilities
2. Check for SQL injection, XSS, and auth bypass risks
3. Return summary of critical findings only

Then I'll continue the main implementation here.
"""

Benefit: Heavy security scan runs in isolated context, returns only summary, main context stays clean.

Consensus-Driven Architecture Decision

# Multiple models debate approach
"""
Use pal to get consensus between gpt-5, gemini-pro, and o3:
Should we use event sourcing or traditional CRUD for the order management system?
Consider: scalability, complexity, team expertise, audit requirements.

Each model should provide reasoning, then synthesize a recommendation.
"""

Vision-Assisted Code Review

# Analyze architectural diagrams
"""
Use pal with gemini-pro to:
1. Analyze this system architecture diagram (screenshot attached)
2. Compare it to the actual codebase structure in /src
3. Identify discrepancies and outdated documentation
"""

Common Patterns

Pattern: Model-Specific Strengths

# Extended thinking for complex problems
"Use pal with gemini-pro for deep architectural analysis"

# Fast iteration
"Use pal with gemini-flash for quick syntax checks"

# Strong reasoning
"Use pal with o3 for logical bug analysis"

# Privacy-sensitive code
"Use pal with llama3 via Ollama for local analysis"

Pattern: Conversation Continuity

# Step 1: Initial analysis
response1 = "Use pal with gemini-pro to analyze the auth flow"
# Returns conversation_id: conv_abc123

# Step 2: Follow-up with different model
"Continue conversation conv_abc123 with o3 to verify the CSRF protection"

# Step 3: Back to original model
"Continue conversation conv_abc123 with gemini-pro to implement the fixes"

Pattern: Progressive Validation

# Implementation workflow with validation gates
"""
1. Use planner to design the feature
2. Implement the core logic
3. Use pal with gemini-flash for quick sanity check
4. Use pal with o3 for security validation
5. Use precommit with gemini-pro for final review
"""

Pattern: Parallel Sub-Tasks

# Offload heavy tasks to subagents
"""
Spawn three parallel clink subagents:
1. clink gemini role='tester' - Generate unit tests for auth module
2. clink codex role='documenter' - Write API documentation
3. clink gemini role='security' - Perform security audit

I'll continue the main feature implementation while they work.
"""

Troubleshooting

MCP Connection Issues

# Check MCP server logs
tail -f ~/Library/Logs/Claude/mcp*.log

# Verify uvx installation
which uvx
uvx --version

# Test PAL directly
cd pal-mcp-server
uv run pal-mcp-server

API Key Not Working

# Verify key is set
echo $GEMINI_API_KEY

# Check .env file
cat .env | grep GEMINI_API_KEY

# Test API directly
curl -H "Authorization: Bearer $GEMINI_API_KEY" \
  https://generativelanguage.googleapis.com/v1/models

Model Not Available

# List available models
"Use pal with model='list' to show all available models"

# Check provider status
"Use pal to test connection to gemini-pro"

High Token Usage

# Disable unused tools to reduce context
export DISABLED_TOOLS="analyze,refactor,testgen,secaudit,docgen,tracer"

# Use flash models for quick tasks
"Use pal with gemini-flash instead of gemini-pro"

# Limit response length
"Use pal with max_tokens=2000 for concise analysis"

Conversation Context Lost

# Always capture conversation_id from responses
# Store it for later reference
"Continue conversation conv_abc123 with gemini-pro"

# If lost, start new thread with summary
"Use pal with gemini-pro, here's what we discussed before: [summary]"

clink Subagent Timeout

# Increase timeout for heavy tasks
"Use clink with gemini timeout=600 to perform comprehensive security audit"

# Split into smaller tasks
"Use clink with gemini to audit only the authentication module first"

Ollama Local Models

# Start Ollama server
ollama serve

# Pull models
ollama pull llama3
ollama pull codellama

# Verify availability
ollama list

# Use in PAL
"Use pal with llama3 to analyze this code locally"

Best Practices

  1. Start with Specific Models: Use gemini-pro for deep thinking, gemini-flash for speed, o3 for reasoning
  2. Leverage Conversation IDs: Track multi-step workflows across models
  3. Use clink for Isolation: Keep main context clean by offloading heavy analysis to subagents
  4. Disable Unused Tools: Reduce context window consumption with DISABLED_TOOLS
  5. Cache Conversation Context: When context resets, use another model to "remind" your primary CLI
  6. Model Selection Strategy: Match model strengths to task requirements (vision, speed, reasoning, context size)
  7. Progressive Validation: Use multiple models as validation gates (fast check → deep analysis → security audit)

PAL MCP transforms your AI coding assistant into an orchestrator that can leverage the best model for each subtask while maintaining full conversation continuity across the entire workflow.

FAQ

What does the pal-mcp-server-multi-model-orchestration skill do?

Use PAL MCP to orchestrate multiple AI models (Gemini, OpenAI, Grok, Ollama) for code reviews, debugging, planning, and CLI bridging

How do I install pal-mcp-server-multi-model-orchestration?

Run npx skills add https://github.com/reason-machines/mcp-skills --skill pal-mcp-server-multi-model-orchestration in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/pal-mcp-server-multi-model-orchestration/ (personal) or .claude/skills/pal-mcp-server-multi-model-orchestration/ (project).

Which AI agents can use pal-mcp-server-multi-model-orchestration?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is pal-mcp-server-multi-model-orchestration safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains pal-mcp-server-multi-model-orchestration?

It is published by reason-machines in reason-machines/mcp-skills. It has 226 recorded installs.

More from reason-machines/mcp-skills

View all →

codebase-memory-mcp-intelligence

reason-machines/mcp-skills

High-performance code intelligence MCP server that indexes codebases into knowledge graphs for structural queries, call traces, and architecture analysis

AI & Agents505 installs

playwright-mcp-server

reason-machines/mcp-skills

Browser automation MCP server using Playwright's accessibility tree for LLM-friendly web interaction

AI & Agents285 installs

tradingview-mcp-assistant

reason-machines/mcp-skills

Open the skill to read its SKILL.md instructions.

AI & Agents256 installs

lanhu-mcp-collaboration

reason-machines/mcp-skills

Open the skill to read its SKILL.md instructions.

AI & Agents245 installs

chrome-devtools-mcp-automation

reason-machines/mcp-skills

Expert guidance for Chrome DevTools MCP server - browser automation, debugging, and performance analysis for AI agents

AI & Agents239 installs

github-mcp-server

reason-machines/mcp-skills

Open the skill to read its SKILL.md instructions.

AI & Agents237 installs

Popular ai & agents skills

View category →

google-agents-cli-publish

google/agents-cli

This skill should be used when the user wants to "publish an agent", "publish my ADK agent", "register an agent with Gemini", "publish to Gemini" (formerly Gemini Enterprise), or needs guidance on the agents-cli publish gemini command. Also use when the user wants to "manage agents in Agent Registry", "list/update/delete registered agents", or "register an MCP server". Covers ADK vs A2A registration modes, programmatic and interactive usage, flag reference, auto-detection from deployment metadata, Agent Registry fleet management, and troubleshooting. Part of the agents-cli skills suite. Do NOT use for deployment (use google-agents-cli-deploy).

AI & Agents513.9K installs

google-agents-cli-eval

google/agents-cli

This skill should be used when the user wants to "run an evaluation", "evaluate my agent", "evaluate my ADK agent", "write an eval dataset", "analyze eval failures", "compare eval results", "optimize agent", or needs guidance on the Gemini platform eval methodology and the Quality Flywheel. Covers eval metrics, dataset schema, LLM-as-judge scoring, and common failure causes. Applies to any agents-cli project, whatever framework the agent is written in. Do NOT use for agent API code patterns (ADK: use google-agents-cli-adk-code), deployment (use google-agents-cli-deploy), or project scaffolding (use google-agents-cli-scaffold).

AI & Agents513.5K installs

skill-creator

anthropics/skills

Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.

OfficialAI & Agents416.4K installs

codex-pet

prime-skills/runcomfy-agent-skills

Codex Pet generator on RunComfy. Build a Codex-compatible Codex Pet spritesheet.webp + pet.json from a single reference image, drop it into ${CODEXHOME:-$HOME/.codex}/pets/ / and Codex picks it up as a custom Codex Pet next to the 8 built-ins. This skill produces the exact Codex Pet atlas Codex expects (1536x1872 PNG/WebP, 8 cols x 9 rows, 192x208 cells, 9 animation states — idle, running-right, running-left, waving, jumping, failed, waiting, running, review). Calls OpenAI GPT Image 2 edit ONCE via the local RunComfy CLI as runcomfy run openai/gpt-image-2/edit to produce a canonical Codex Pet pose, then assembles all 9 animation rows programmatically with ImageMagick micro-transforms — no Codex Pro, no $imagegen, no OPENAIAPIKEY required, only RUNCOMFYTOKEN. Triggers on "codex pet", "create codex pet", "make codex pet", "hatch codex pet", "/hatch image", "desktop pet codex", "codex pets", "spritesheet.webp", or any explicit ask to build a custom pet for OpenAI Codex.

AI & Agents402.1K installs

full-output-enforcement

leonxlnx/taste-skill

Overrides default LLM truncation behavior. Enforces complete code generation, bans placeholder patterns, and handles token-limit splits cleanly. Apply to any task requiring exhaustive, unabridged output.

AI & Agents401K installs

executing-plans

obra/superpowers

Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available

AI & Agents245.7K installs