Web search and code context search powered by Exa.ai - a search engine designed for AI.
Source: Exa MCP
| Tool | Description |
|---|---|
web_search_exa |
Search the web with AI-optimized results |
get_code_context_exa |
Search for code examples and implementations |
| Feature | Built-in WebSearch | Exa MCP |
|---|---|---|
| AI-optimized results | No | Yes |
| Code-specific search | No | Yes |
| Semantic understanding | Basic | Advanced |
| Result quality | Standard | Higher relevance |
| Rate limits | Stricter | More generous |
- Node.js 18+ or Bun
- Claude Code CLI
- Exa API key (get one at exa.ai)
- Go to exa.ai
- Sign up for an account
- Get your API key from the dashboard
# Using npm
npm install -g @anthropic/mcp-exa
# Or using bun
bun add -g @anthropic/mcp-exaEdit your Claude Code settings file:
# macOS/Linux
~/.claude/settings.json
# Or open via Claude Code
claude configAdd this to the mcpServers section:
{
"mcpServers": {
"exa": {
"command": "npx",
"args": ["-y", "@anthropic/mcp-exa"],
"env": {
"EXA_API_KEY": "your-exa-api-key-here"
}
}
}
}Alternative using Bun:
{
"mcpServers": {
"exa": {
"command": "bunx",
"args": ["@anthropic/mcp-exa"],
"env": {
"EXA_API_KEY": "your-exa-api-key-here"
}
}
}
}# List available MCPs
mcp-cli servers
# Check the tools
mcp-cli tools exa
# Should show:
# exa/web_search_exa
# exa/get_code_context_exa# Check the schema first (REQUIRED)
mcp-cli info exa/web_search_exa
# Search the web
mcp-cli call exa/web_search_exa '{"query": "Next.js 15 server actions best practices"}'# Check the schema first
mcp-cli info exa/get_code_context_exa
# Search for code examples
mcp-cli call exa/get_code_context_exa '{"query": "React useOptimistic hook example"}'| Parameter | Type | Required | Description |
|---|---|---|---|
query |
string | Yes | Search query |
| Parameter | Type | Required | Description |
|---|---|---|---|
query |
string | Yes | Code-related search query |
Add this to your ~/.claude/CLAUDE.md to make Claude automatically use Exa:
### Web Search - Use `exa` MCP (NOT built-in WebSearch)
**ALWAYS use Exa for web searches:**
| Action | MCP Command |
|--------|-------------|
| Web search | `mcp-cli call exa/web_search_exa '{"query": "search terms here"}'` |
| Code context | `mcp-cli call exa/get_code_context_exa '{"query": "code search terms"}'` |
**When to use Exa:**
- User asks to search the web
- User asks "find", "search for", "look up" something online
- Need current information beyond knowledge cutoff
- Researching libraries, frameworks, or documentation
- Finding code examples or implementations
**NEVER use built-in WebSearch - always use Exa MCP**mcp-cli call exa/web_search_exa '{"query": "Supabase RLS policies examples 2024"}'mcp-cli call exa/get_code_context_exa '{"query": "Next.js middleware authentication example"}'mcp-cli call exa/web_search_exa '{"query": "React 19 new features and best practices"}'mcp-cli call exa/web_search_exa '{"query": "Vercel deployment error module not found solution"}'- Check your API key at exa.ai dashboard
- Make sure the key is set in
settings.json:"env": { "EXA_API_KEY": "your-actual-key-here" }
- Restart Claude Code after updating settings
# Reinstall
npm install -g @anthropic/mcp-exa
# Or try with npx directly
npx -y @anthropic/mcp-exaExa has generous rate limits, but if you hit them:
- Wait a few seconds between requests
- Consider upgrading your Exa plan
Exa offers:
- Free tier with generous limits
- Paid tiers for higher usage
Check exa.ai/pricing for current pricing.
MIT