Provides comprehensive multi-topic search capabilities powered by the Tavily API.
I've created a powerful Model Context Protocol (MCP) Server powered by the Tavily API. With this, you can get high-quality, reliable information from business, news, finance, and politics - all through a robust and developer-friendly interface.
š Why I Built Tavily Search MCP
In today's fast-paced digital landscape, I recognized the need for quick access to precise information. I needed a web search tool that works with my sequential thinking MCP server. That's why I developed Tavily Search MCP, which excels with:
- ā”ļø Lightning-fast async search responses
- š”ļø Built-in fault tolerance with automatic retries
- šÆ Clean, markdown-formatted results
- š Smart content snippets
- š ļø Comprehensive error handling
- š¼ļø Optional image results
- š° Specialized news search
š” Core Features
ā”ļø Performance & Reliability
- Asynchronous request handling
- Built-in error handling and automatic retries
- Configurable request timeouts
- Comprehensive logging system
šÆ Search Configuration
- Configurable search depth (basic/advanced)
- Adjustable result limits (1-20 results)
- Clean markdown-formatted output
- Snippet previews with source URLs
- Optional image results
- Specialized news search topic
š”ļø Error Handling
- API authentication validation
- Rate limit detection
- Network error recovery
- Request timeout management
š ļø Developer Integration
Prerequisites
- Python 3.11 or higher
- UV Package Manager
- Tavily API key
Claude Desktop Setup
I've optimized the Claude Desktop experience with this configuration:
Project Architecture
I've designed a clean, modular structure to make development a breeze:
mcp-tavily-search/
āāā mcp_tavily_search/ # Core package
ā āāā server.py # Server implementation
ā āāā client.py # Tavily API client
ā āāā test_server.py # Server tests
ā āāā test_client.py # Client tests
ā āāā __init__.py # Package initialization
āāā .env # Environment configuration
āāā README.md # Documentation
āāā pyproject.toml # Project configuration
Key Components
Server (server.py)
- MCP protocol implementation
- Request handling and routing
- Error recovery and health monitoring
Client (client.py)
- Tavily API integration
- Retry mechanism with exponential backoff
- Result formatting and processing
- Error handling and logging
Tests (test_server.py and test_client.py)
- Comprehensive unit tests for both server and client
- Ensures reliability and correctness of the implementation
Usage Examples
Here are some examples of how to use the enhanced search capabilities:
- Basic search:
- Advanced search with images:
- News-specific search:
- Search with raw content:
Troubleshooting Guide
Connection Issues
If things don't work as expected, follow these steps:
- Verify your configuration paths
- Check the Claude Desktop logs
- Test the server manually using the quick start commands
API Troubleshooting
If you're experiencing API issues:
- Validate your API key permissions
- Check your network connection
- Monitor the API response in the server logs
Community and Support
- Report issues and contribute
- Share your implementations and improvements
- Join discussions and help others
Security and Best Practices
Security is paramount in this implementation. The server includes:
- Secure API key handling through environment variables
- Automatic request timeout management
- Comprehensive error tracking and logging