An MCP server that lets any AI consult Claude.
The inverse of gpal — where gpal lets Claude consult Gemini, cpal lets Gemini (or any MCP client) consult Claude.
- 🧠 Opus by default — deep reasoning (Sonnet/Haiku available)
- 💭 Extended thinking — explicit chain-of-thought for complex analysis
- 🔧 Autonomous exploration — Claude reads files and searches your codebase
- 📸 Vision — analyze images and PDFs
- 💬 Stateful sessions — conversation history preserved across calls
git clone https://github.com/tobert/cpal && cd cpal
uv tool install -e .Option A: Key file (recommended)
mkdir -p ~/.config/cpal && chmod 700 ~/.config/cpal
echo "sk-ant-..." > ~/.config/cpal/api_key && chmod 600 ~/.config/cpal/api_keyOption B: Environment variable
export ANTHROPIC_API_KEY="sk-ant-..."gemini mcp add cpal --scope user -- cpal --key-file ~/.config/cpal/api_keyclaude mcp add cpal --scope user -- cpal --key-file ~/.config/cpal/api_keyAdd to your MCP config (~/.cursor/mcp.json, etc.):
{
"mcpServers": {
"cpal": {
"command": "cpal",
"args": ["--key-file", "~/.config/cpal/api_key"]
}
}
}Or with env var:
{
"mcpServers": {
"cpal": {
"command": "cpal",
"env": { "ANTHROPIC_API_KEY": "sk-ant-..." }
}
}
}# Basic (uses Opus)
consult_claude(query="Design a caching strategy for this API")
# With extended thinking
consult_claude(
query="Review for subtle bugs",
file_paths=["src/server.py"],
extended_thinking=True
)
# Vision
consult_claude(query="What's wrong with this UI?", media_paths=["screenshot.png"])
# Different models
consult_claude(query="Hard problem", model="opus") # deep reasoning
consult_claude(query="Quick check", model="haiku") # fast & cheap
# Multi-turn conversation
consult_claude(query="Explain the auth flow", session_id="review-123")
consult_claude(query="What about edge cases?", session_id="review-123") # continuesMCP Client (Gemini, Cursor, etc.)
│
▼ MCP
┌─────────┐
│ cpal │ ──▶ Anthropic API ──▶ Claude
└─────────┘
│
Claude autonomously uses tools:
• list_directory
• read_file
• search_project
- Restricted to project directory
- Validates file reads
- Session isolation
- File size limits: 10MB text, 20MB media
- Sessions are in-memory — history is lost when the server restarts.
- Models cost money — Opus is the default; use
haikuorsonnetfor lower costs. - Vision — Supports PNG, JPEG, GIF, WebP, and PDF (max 20MB).
uv sync --all-extras
uv run pytest tests/test_tools.py -v # unit tests (free)pytest tests/ with ANTHROPIC_API_KEY set will run integration tests that cost money. See CLAUDE.md for details.
MIT