How tavily-ai/tavily-mcp works
This repository is a local Tavily MCP server: an MCP client invokes a registered tool, the server dispatches the request to a Tavily operation, and formats the returned data for the client. The README also documents search, extract, map, and crawl, all exposed through the sampled server entry point. Source excerpts are partial, so the graph omits uncertain configuration and authentication wiring.
Main entry points: index.ts Tool dispatcher · format-results.ts Result formatter
Components 12
MCP interface
- MCP server
src/index.ts - stdio transport
src/index.ts - Tool registry
src/index.ts - Tool dispatcher
src/index.ts
Tavily operations
- Web search
src/index.ts - Page extraction
src/index.ts - Website mapping
src/index.ts - Web crawling
src/index.ts
Result handling
- Result formatter
src/format-results.ts - Tool response
src/index.ts
Other components
- MCP client
- Tavily API
Connections 15
- MCP client → stdio transport: sends requests
- stdio transport → MCP server: connects transport
- MCP server → Tool registry: lists tools
- MCP server → Tool dispatcher: handles calls
- Tool dispatcher → Web search: dispatches search
- Tool dispatcher → Page extraction: dispatches extract
- Tool dispatcher → Website mapping: dispatches map
- Tool dispatcher → Web crawling: dispatches crawl
- Web search → Tavily API: posts search
- Page extraction → Tavily API: posts extraction
- Website mapping → Tavily API: posts map
- Web crawling → Tavily API: posts crawl
- Tool dispatcher → Result formatter: formats results
- Result formatter → Tool response: returns text
- Tool response → MCP client: sends response