Loading...
Loading...
Use PAL MCP to orchestrate multiple AI models (Gemini, OpenAI, Grok, Ollama) for code reviews, debugging, planning, and CLI bridging
npx skill4agent add aradotso/mcp-skills pal-mcp-server-multi-model-orchestrationSkill by ara.so — MCP Skills collection.
clinkgit 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~/.claude/settings.json.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"
}
}
}
}.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 servepal# 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"promptmodelconversation_idsystem_promptmax_tokenstemperaturegemini-progemini-flashgpt-5o3-minigrok-betallama3clink# 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
"""cli_namepromptrolesystem_prompttimeoutcodereview# 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
"""debughelp# 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"planner# 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"precommit# After implementing fixes
"Perform a precommit check on the authentication changes"
# With specific model
"Use precommit with gemini-pro to validate the security fixes"# 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# 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".mcp.json{
"mcpServers": {
"pal": {
"command": "uv",
"args": [
"--directory",
"/path/to/pal-mcp-server",
"run",
"pal-mcp-server"
],
"env": {
"GEMINI_API_KEY": "",
"OPENAI_API_KEY": ""
}
}
}
}# 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
"""# 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
"""# 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.
"""# 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.
"""# 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
"""# 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"# 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"# 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
"""# 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.
"""# 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# 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# List available models
"Use pal with model='list' to show all available models"
# Check provider status
"Use pal to test connection to gemini-pro"# 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"# 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]"# 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"# 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"gemini-progemini-flasho3DISABLED_TOOLS