๐ง BigBrain
March 14, 2026 ยท View on GitHub
MCP server that lets Claude Code talk to Codex (OpenAI) and Gemini (Google) CLIs. Claude stays in charge โ the other models provide second opinions. No API keys needed; both CLIs use their own cached OAuth.
๐น Origin Story
This project was born on a Saturday night vibecoding session fueled by spiced rum.
The kind of evening where you look at your API bill ๐ธ, look at your glass ๐ฅ, and think: "there has to be a better way."
Turns out, both Codex and Gemini have CLIs with free OAuth access. So instead of paying per token like a responsible adult, BigBrain just shells out to the CLIs like a genius cheapskate. No API keys. No billing surprises on Monday morning. Just three AI models arguing with each other over stdio while you sip your drink. ๐น
Does it work? Yes. Is it elegant? Debatable. Did it save money? Absolutely. ๐ฐ Will your future self thank your rum-fueled past self? Also debatable. ๐
Enjoy responsibly (the rum and the code). ๐ฅ
๐๏ธ Architecture
You ๐ซต
โโ> Claude Code (chairman โ decides, writes memory, synthesizes)
โโ> BigBrain MCP Server (Python, FastMCP, stdio)
โโ> Codex CLI (async subprocess)
โโ> Gemini CLI (async subprocess)
๐ Shared context: Every prompt sent to Codex/Gemini is automatically prepended with the current project's CLAUDE.md and MEMORY.md. Claude is the sole writer of these files; the other models only read them.
๐ Dynamic project detection: All tools accept an optional project_path param. Falls back to BIGBRAIN_PROJECT_PATH env var, then cwd. Works with any Claude Code project.
๐ ๏ธ Tools
| Tool | What it does |
|---|---|
ask_codex | Ask Codex a single question ๐ค |
ask_gemini | Ask Gemini a single question ๐ |
ask_both_models | Ask both in parallel, get both answers โก |
request_consensus | Both answer independently, then one synthesizes agreements/differences ๐ค |
request_debate | Multi-round debate โ each model sees the other's previous answer (1โ5 rounds) ๐ฅ |
request_council | Three-stage council with anonymized peer review (see below) ๐ |
๐ Council โ Three-Stage Process
The most thorough tool. All three models participate equally. Based on Karpathy's llm-council:
Stage 1: Individual ๐ฃ๏ธ Stage 2: Peer Review ๐ Stage 3: Chairman ๐๏ธ
โโโโโโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโ
โ Claude โโโ> Answer A โ Codex โโโ> Reviews & โ Claude โโโ> Final
โ Codex โโโ> Answer B โ Gemini โ ranks all โ โ answer
โ Gemini โโโ> Answer C โ Claude โ (anonymized) โ โ
โโโโโโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโ
(all three) (all three) (chairman)
- ๐ฃ๏ธ Individual โ Claude forms its opinion first, then Codex and Gemini answer independently in parallel. All three answers collected.
- ๐ Peer Review โ All answers are anonymized as Model A/B/C. Codex and Gemini each review and rank them. Claude receives the same anonymized prompt and does its own review too. No model knows which answer is whose ๐ต๏ธ
- ๐๏ธ Chairman โ Claude synthesizes all three individual answers + all three peer reviews into the final answer.
๐ Quick Start
1. Prerequisites
Install the Codex and Gemini CLIs, then authenticate once:
npm install -g @openai/codex @google/gemini-cli
codex # follow OAuth prompts ๐
gemini # follow OAuth prompts ๐
2. Install & Register (one command each)
pip install git+https://github.com/Leonard013/BigBrain.git
claude mcp add bigbrain -- bigbrain
3. Done ๐
Restart Claude Code, run /mcp โ bigbrain should show as connected. โ
That's it. Start asking Claude to use ask_codex, ask_gemini, request_council, etc.
โ๏ธ Advanced Configuration
Custom Python environment
If you want a dedicated env (conda, venv, etc.):
conda create -n bigbrain python=3.12 -y
conda activate bigbrain
pip install git+https://github.com/Leonard013/BigBrain.git
Then register with the full path to the bigbrain binary:
claude mcp add bigbrain -- /path/to/envs/bigbrain/bin/bigbrain
Override models
export BIGBRAIN_CODEX_MODEL="gpt-5.4"
export BIGBRAIN_GEMINI_MODEL="gemini-3.1-pro-preview"
Dev install (from source)
git clone https://github.com/Leonard013/BigBrain.git
cd BigBrain
pip install -e ".[dev]"
pytest tests/ -v