Tavily MCP server in Claude Code.
Real-time web search from the terminal agent. One claude mcp add command with your API key and Claude Code can search and extract live pages.
tavily-mcp (github.com/tavily-ai/tavily-mcp, 2.1k stars) puts Tavily's search engine — built for LLM consumption, returning clean extracted content instead of result-page HTML — behind MCP tools. In Claude Code that means the agent debugging your dependency upgrade can search for the actual breaking-change notes instead of reasoning from its training cutoff.
Unlike a browser-automation server, Tavily is an API-backed service: you'll need an API key from app.tavily.com (a free tier exists; check their docs for current limits) before anything connects.
Get the key, run the command
Sign up at app.tavily.com and copy your key — it starts with tvly-. Then register the server, passing the key as an environment variable:
claude mcp add tavily --env TAVILY_API_KEY=tvly-YOUR_KEY -- npx -y tavily-mcp@latest
That installs at local scope (this project only). Web search is the kind of capability you usually want everywhere, so consider --scope user to make it global. The package is tavily-mcp on npm; npx -y fetches it on first start.
Team setup via .mcp.json
To share the server through version control, declare it in a .mcp.json at the project root. Don't hardcode the key — Claude Code expands environment variable references, so each developer supplies their own TAVILY_API_KEY from their shell:
{
"mcpServers": {
"tavily": {
"command": "npx",
"args": ["-y", "tavily-mcp@latest"],
"env": {
"TAVILY_API_KEY": "${TAVILY_API_KEY}"
}
}
}
}Verify and put it to work
claude mcp list confirms registration; inside a session, /mcp shows connection status and the tool list — tavily-search for queries and tavily-extract for pulling clean content from specific URLs are the two you'll use constantly.
Useful first prompts: "search for the migration guide for <library> v5 and summarize the breaking changes," or point tavily-extract at a changelog URL. Because results come back as extracted text rather than raw HTML, they're cheap on context — noticeably cheaper than driving a full browser for the same lookup.
Troubleshooting in Claude Code
Connection fails at startup: run /mcp for the error. An invalid or missing TAVILY_API_KEY is the most common cause and fails fast; re-add the server with the corrected --env flag (claude mcp remove tavily first if needed).
Works in one repo, not another: scope. Servers added without flags are local to the project where you ran the command. claude mcp list in the failing repo will show it missing; re-add with --scope user.
env expansion not happening: the ${TAVILY_API_KEY} form in .mcp.json requires the variable to be set in the shell where you launch claude. Launching from a GUI shortcut skips your shell profile — start from a terminal where echo $TAVILY_API_KEY prints the key.
Searches erroring mid-session: Tavily enforces plan-based quotas; a burst of agent searches can exhaust a free tier. The error text names the limit — check usage on the Tavily dashboard.
On the Loomal index
tavily-mcp's live listing is at https://loomal.ai/marketplace/tavily-mcp, in Loomal's Search category with its probed tool list. It's also a glimpse of where API-backed MCP servers are heading: on Loomal, a hosted search endpoint can be claimed and priced per call over x402, letting an agent pay in USDC per query instead of someone provisioning keys up front.
FAQ
How do I install Tavily MCP in Claude Code?
Get an API key from app.tavily.com, then run claude mcp add tavily --env TAVILY_API_KEY=tvly-YOUR_KEY -- npx -y tavily-mcp@latest. Verify with claude mcp list, or /mcp inside a session. Add --scope user if you want the server in every project.
How do I avoid committing my Tavily key?
Use the env-reference form in .mcp.json — "TAVILY_API_KEY": "${TAVILY_API_KEY}" — and have each developer export the variable in their shell. The checked-in file then carries the server definition but no secrets.
What tools does tavily-mcp expose?
The core pair is tavily-search (web search with LLM-ready extracted results) and tavily-extract (clean content from URLs you already have). Recent versions add crawling and site-mapping tools as well — /mcp in a session shows the full list your installed version provides.
Why use this instead of giving Claude Code a browser?
Different jobs. Tavily returns extracted, ranked content in one cheap call — right for lookups and research. A browser server like playwright-mcp renders and interacts with pages — right for testing your own app. Many setups run both; the agent picks per task.
Browse more MCP servers for Claude Code.
The Loomal index lists packages, tools, and x402 pricing.