内容
<!-- Making Gemini Useful with Claude — by Ankit Dwivedi (github.com/ankitdotgg) -->
# Making Gemini Useful with Claude
<p align="center">
<img src="assets/banner.svg" alt="Making Gemini Useful with Claude — MCP Bridge" width="100%"/>
</p>
Use Gemini's 1M token context (free) inside Claude Desktop and Claude Code. Claude orchestrates, Gemini does the heavy lifting.
**15 min setup · $0 recurring · ~200 lines of Python**
```mermaid
flowchart TD
U["👤 You"]
C["🟠 Claude (orchestrator)"]
M["🔌 MCP Bridge (Python)"]
G["💎 Gemini CLI"]
A["☁️ Google AI (free)"]
U -- "prompt" --> C
C -- "tool call" --> M
M -- "subprocess" --> G
G -- "OAuth" --> A
A -. "response" .-> G
G -. "result" .-> M
M -. "answer" .-> C
C -. "response" .-> U
```
```mermaid
flowchart TD
subgraph WITHOUT [WITHOUT]
direction TD
A["Upload 500k tokens to Claude"]
B["Claude processes everything"]
C["Result"]
N1>500,000+ Claude tokens burned]
A --> B --> C -.-> N1
end
subgraph WITH_BRIDGE [WITH BRIDGE]
direction TD
D["Send 50-token instruction"]
E["Gemini reads 500k FREE"]
F["Returns 200-token summary"]
G["Claude displays"]
N2>~250 Claude tokens · 2000x savings]
D --> E --> F --> G -.-> N2
end
style WITHOUT fill:#ffebee,stroke:#c62828,stroke-width:2px,color:#c62828
style WITH_BRIDGE fill:#e8f5e9,stroke:#2e7d32,stroke-width:2px,color:#2e7d32
classDef redNode fill:#ffcdd2,stroke:#b71c1c,color:#000000
classDef greenNode fill:#c8e6c9,stroke:#1b5e20,color:#000000
classDef redNote fill:#b71c1c,color:#ffffff,stroke:none
classDef greenNote fill:#1b5e20,color:#ffffff,stroke:none
class A,B,C redNode
class D,E,F,G greenNode
class N1 redNote
class N2 greenNote
```
---
## Quick Start
```bash
brew install gemini-cli # or: npm install -g @google/gemini-cli
gemini # sign in with Google → Ctrl+C
python3 -m pip install mcp
mkdir -p ~/gemini-mcp && curl -o ~/gemini-mcp/server.py \
https://raw.githubusercontent.com/ankitdotgg/making-gemini-useful-with-claude/main/server.py
```
Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
```json
"gemini": {
"command": "python3",
"args": ["/Users/YOUR_USERNAME/gemini-mcp/server.py"],
"env": {}
}
```
Restart Claude Desktop (Cmd+Q → reopen). Test: *"Use Gemini Flash to tell me a fun fact."*
> Use `which python3` for the absolute path. Replace `YOUR_USERNAME`.
---
## Usage
| You say | What happens |
|---|---|
| "Use Gemini to explain X" | Auto model |
| "Ask Gemini Pro to review this code" | Deep reasoning |
| "Use Gemini Flash to summarize this" | Fast |
### File delegation (the real power)
> "Use Gemini Pro to read ~/my-project and list the 5 most complex files."
Claude sends ~50 tokens. Gemini reads the project in its 1M context (free). **~2000x token savings.**
| Alias | Best for |
|---|---|
| `auto` | Let Gemini decide |
| `pro` | Code review, complex analysis |
| `flash` | Summaries, research |
| `flash-lite` | Quick facts |
---
## FAQ
**Gemini misses context that Opus would catch?**
Don't ask Gemini to judge — ask it to extract. Gemini reads 500k → returns 3k relevant code → Opus reviews those 3k. Opus on focused input beats Opus on unfocused input.
**Can I use Haiku agents?**
Yes. Haiku spawns → calls Gemini → gets a 200-token summary back. Cheapest Claude-side spend possible.
**Slow Gemini CLI startup?**
~4-8s cold start. Doesn't matter — you're using this for 15-30s tasks where 4s is noise.
**Can this create images?**
Not yet. Headless mode returns text only. Architecture supports it when Google adds image output.
**Is this a Google ToS violation?**
No. Claude never touches OAuth. The script calls Google's own CLI on your machine with your credentials. `-p` flag exists for programmatic use. Zero bans reported across 22k+ GitHub issues.
**Why not just use shorter prompts?**
Do both. Short prompts cut output ~3x. Bridge cuts input ~2000x. **650x combined.**
---
## Docs
| Topic | Link |
|---|---|
| Troubleshooting | [docs/troubleshooting.md](docs/troubleshooting.md) |
| How it works (technical) | [docs/how-it-works.md](docs/how-it-works.md) |
| Slash commands (Claude Code) | [docs/slash-commands.md](docs/slash-commands.md) |
| Usage examples | [examples/usage.md](examples/usage.md) |
| Contributing | [CONTRIBUTING.md](CONTRIBUTING.md) |
| Security policy | [SECURITY.md](SECURITY.md) |
---
## Contributors
| Who | What |
|---|---|
| [@ankitdotgg](https://github.com/ankitdotgg) | Author — architecture, bridge, docs |
| [@Angrycomik](https://github.com/Angrycomik) | Windows compatibility fix ([#1](https://github.com/ankitdotgg/making-gemini-useful-with-claude/pull/1)) |
Thank you [@Angrycomik](https://github.com/Angrycomik) for the Windows fix — stdin prompt passing and cwd context isolation. First contributor, first PR, shipped same day.
---
MIT License · Built by [Ankit Dwivedi](https://ankitdwivedi.com)
<!-- github.com/ankitdotgg — ankitdwivedi.com -->