MCP Tool: gemini-research — saves ~95% of research tokens
Title: gemini-research — MCP tool that saves ~95% of research tokens in Claude Code
The problem
Every time Claude Code uses WebSearch or WebFetch, it dumps 5,000 to 20,000+ tokens of raw HTML/markdown into the context window. On a research-heavy session (checking versions, looking up docs, comparing tools), you can burn through 50,000–100,000 tokens just on web searches — leaving less room for actual coding work.
The solution
I built gemini-research — an MCP server + CLI tool that delegates web research to Gemini's free API (250 requests/day with Google Search grounding). Instead of raw web pages, Claude Code gets back ~200–400 focused tokens per query.
Real-world example from today
I asked Claude Code to research GPU server rental pricing for running DeepSeek. It made 5 research calls:
| Method | Tokens consumed in context |
|--------|---------------------------|
| WebSearch/WebFetch (5 calls) | ~50,000–60,000 tokens |
| gemini-research (5 calls) | ~3,650 tokens |
| Savings | ~93% |
That's 50,000 tokens saved on a single question — tokens that stay available for actual coding.
How it works
Claude Code ──► MCP tool call ──► gemini-research ──► Gemini API (with Google Search)
│
check cache
check rate limit
build focused prompt
│
Claude Code ◄── ~300 tokens ◄────── concise answer
Instead of Claude Code parsing entire web pages, Gemini does the research and returns a concise, structured summary. Results are cached locally (4h TTL) to avoid redundant API calls.
Features
- 3 MCP tools:
research,check_versions,verify_github_repo - 4 research modes: general, versions, github, deps
- Google Search grounding — real-time web data, not just LLM knowledge
- Local cache with configurable TTL
- Rate limiter tracking the 250 req/day free tier
- CLI fallback — also works via
Bash: gemini-research "query"if MCP isn't loaded - Zero cost — uses Gemini's free tier
Setup (2 minutes)
git clone https://github.com/MichaelGagnon13/gemini-research.git
cd gemini-research
pip3 install --user -e .
gemini-research --setup # Free API key from https://aistudio.google.com/apikey
Add to your CLAUDE.md to make Claude Code prefer it:
## Research Policy
Always use gemini-research MCP tools instead of WebSearch/WebFetch.
MCP config for .claude.json:
{
"gemini-research": {
"type": "stdio",
"command": "python3",
"args": ["/path/to/gemini-research/mcp_server/server.py"]
}
}
Why this matters for Claude Code users
- Longer sessions — context window fills up slower, fewer message compressions
- Faster responses — less data to process per research query
- Free — Gemini's free tier is generous (250 req/day)
- Drop-in — works as MCP server or CLI, no changes to workflow
GitHub: https://github.com/MichaelGagnon13/gemini-research
License: MIT — use it, fork it, improve it.
Happy to hear feedback or suggestions!
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗