This guide will help you migrate from Google Custom Search to alternative providers (Brave or Tavily) or enable usage tracking for cost control.
- Why Migrate?
- Provider Comparison
- Migration Paths
- Feature Support Matrix
- Cost Estimation
- Troubleshooting
- API Sunset: Google Custom Search API will be discontinued on January 1, 2027
- Closed to New Users: API has been closed to new registrations since 2024
- Limited Free Tier: Only 100 queries/day (vs Brave's 2,000/month)
- Higher Costs: $5 per 1,000 queries (vs Brave's $3 per 5,000)
- Future-Proof: Brave and Tavily have no announced sunset dates
- Better Pricing: 10-20x more free queries per month
- Lower Paid Costs: More cost-effective at scale
- Privacy: Brave doesn't track users (if that matters to your use case)
- AI Optimization: Tavily is specifically designed for AI agents
| Feature | Brave | Tavily | |
|---|---|---|---|
| Free Tier | 100/day | 2,000/month | 1,000/month |
| Paid Pricing | $5/1k queries | $3/mo (5k) | $30/mo (4k) |
| Cost per Query | $0.005 | $0.0006 | $0.0075 |
| Status | Sunsets 2027 | Active | Active |
| New Signups | Closed | Open | Open |
| Best For | Legacy | General use | AI research |
| Privacy | Tracked | Private | Standard |
| Search Depth | Standard | Standard | Advanced |
| Quality Scoring | No | No | Yes |
Recommendation: Brave for most users, Tavily for AI research workflows.
Best for: General usage, privacy-focused, cost-conscious users
- Visit https://api.search.brave.com/app/keys
- Sign up (no credit card required for free tier)
- Copy your API key
# Add Brave configuration
SEARCH_PROVIDER=brave
BRAVE_API_KEY=your_brave_api_key_here
# Optional: Keep Google as fallback
# GOOGLE_API_KEY=your_google_api_key_here
# GOOGLE_SEARCH_ENGINE_ID=your_search_engine_id_herenpm run build
# Restart your MCP serverYou should see:
✓ Using Brave Search as search provider
Free tier: 2,000 queries/month
Run a test search:
# Using Claude Code or your MCP client
google_search(query: "test search")Verify results are returned and have the same structure as Google results.
Enable usage tracking to monitor your Brave usage:
USAGE_TRACKING_ENABLED=true
USAGE_TRACKING_PERSIST=true
USAGE_MAX_SEARCHES_PER_MONTH=2000Best for: AI agents, deep research, academic use, synthesis workflows
- Visit https://app.tavily.com/sign-in
- Sign up
- Navigate to API keys section
- Copy your API key
# Add Tavily configuration
SEARCH_PROVIDER=tavily
TAVILY_API_KEY=your_tavily_api_key_herenpm run build
# Restart your MCP serverYou should see:
✓ Using Tavily Search as search provider
Free tier: 1,000 queries/month
Tavily Specifics:
- Searches take 10-30 seconds (advanced mode)
- Results include quality scores
- Optimized for comprehensive research
- No traditional pagination (each search is independent)
USAGE_TRACKING_ENABLED=true
USAGE_TRACKING_PERSIST=true
USAGE_MAX_SEARCHES_PER_MONTH=1000Track usage and costs across any provider (Google, Brave, or Tavily)
Add to your .env:
USAGE_TRACKING_ENABLED=true
USAGE_TRACKING_PERSIST=true # Optional: persist to SQLite
USAGE_TRACKING_DB_PATH=./.mcp-usage-tracking.db # Optional: custom path# Alert at 80% and 100% of these limits
USAGE_MAX_SEARCHES_PER_MONTH=1000
USAGE_MAX_COST_PER_MONTH=10.00npm run build
# Restart your MCP serverYou should see:
✓ Usage tracking enabled
✓ Usage tracking database initialized: ./.mcp-usage-tracking.db
When you approach limits:
WARNING: Approaching search limit: 800/1000 searches (80%)
Suggestions:
• Monitor your usage carefully
• Consider caching results when possible
| Filter | Brave | Tavily | |
|---|---|---|---|
site |
Yes | Yes (in query) | Yes |
language |
Yes | Yes (mapped) | No |
dateRestrict |
Yes | Yes (mapped) | Yes |
exactTerms |
Yes | Yes | Yes |
resultType |
Yes | No | No |
sort |
Yes | No | No |
page |
Yes | Yes | No |
Note: All providers return results in the same format, so your MCP tools will work identically.
Google → Brave:
d1-7→pw(past week)d1-30→pm(past month)y1→py(past year)
Google → Tavily:
d7→days: 7m1→days: 30y1→days: 365
Google → Brave:
- Uses country codes instead of language codes
- Common mappings:
en,es,fr,de,it,pt,ru,ja,ko,zh
Tavily:
- Language filter not supported
| Provider | Free Tier | Paid Queries | Monthly Cost |
|---|---|---|---|
| 100/day = ~3,000/mo | 0 | $0 | |
| Google (over limit) | 100/day | 2,900 | $14.50 |
| Brave | 2,000/mo | 1,000 | $3 |
| Tavily | 1,000/mo | 2,000 | $30 + overage |
| Provider | Annual Cost |
|---|---|
| Google (within free tier) | $0 |
| Google (100/day) | $174 |
| Brave | $36 |
| Tavily | $360+ |
Best Value: Brave for general usage (94% cost savings vs Google paid)
Cause: API key not set for selected provider
Solution:
# For Brave
BRAVE_API_KEY=your_key_here
# For Tavily
TAVILY_API_KEY=your_key_hereCause: Exceeded free tier or paid plan limit
Solutions:
- Wait until next billing period
- Upgrade your plan
- Switch to different provider:
SEARCH_PROVIDER=brave # or tavily
Cause: Invalid SEARCH_PROVIDER value
Valid values: google, brave, tavily
Fix:
SEARCH_PROVIDER=brave # lowercase, no spacesCause: Tavily uses advanced search mode (10-30 seconds)
This is normal - Tavily prioritizes quality over speed
Alternative: Use Brave for faster results
Expected - Different providers have different indices
All providers return:
title: Page titlelink: URLsnippet: Descriptionsource: Always'google_search'for compatibility
Check:
USAGE_TRACKING_ENABLED=trueis set- Rebuild after changing:
npm run build - Check console for initialization message
- Database errors are logged but non-blocking
If you need to rollback:
SEARCH_PROVIDER=google
GOOGLE_API_KEY=your_google_api_key_here
GOOGLE_SEARCH_ENGINE_ID=your_search_engine_id_herenpm run buildYour server will use Google Custom Search again.
Remember: Google API sunsets January 1, 2027.
- Test Thoroughly: Run your typical queries with the new provider
- Monitor Usage: Enable tracking to understand your patterns
- Adjust Thresholds: Set limits based on your actual usage
- Plan for Scale: Consider paid tiers if approaching free limits
- Provide Feedback: Report any issues or differences you notice
- Documentation: See main README.md
- Issues: https://github.com/anthropics/google-search-mcp/issues
- Provider Docs:
Migration successful? Remember to update your documentation and notify any users of the provider change!