Tavily MCP Server
About
Web search using the Tavily API.
Details
- Author
- altinakseven
- Categories
- Search, Other, API
Jump to
Setup
Install Tavily MCP Server in your MCP client (Claude Desktop, Cursor, Windsurf, and others).
Repository: https://github.com/altinakseven/tavily-mcp-server
Follow the installation instructions in the repository README, then restart your MCP client.
- πWeb Search: Powerful web search using Tavily's AI-optimized search API
- π―Direct Answers: Get immediate answers to queries when available
- πConfigurable Results: Control search depth, result count, and domain filtering
- πProduction Ready: Built with TypeScript, comprehensive testing, and PM2 deployment
- πSecure: Environment-based API key management
- πMonitoring: Full logging and process monitoring with PM2
- π§ͺWell Tested: Comprehensive unit and integration test coverage
- Node.js 18+
- npm or yarn
- Tavily API key (Get one here)
- PM2 (for production deployment)
export TAVILY_API_KEY="your-api-key-here"
That's it! The server is now running and ready for MCP connections.
# Install dependencies npm install # Run in development mode npm run dev # Build for production npm run build # Run unit tests npm test # Run tests with coverage npm run test:coverage # Run integration tests ./test-mcp.js # Lint code npm run lint npm run lint:fix
The project includes comprehensive testing:
- Unit Tests: Test individual components and functions
- Integration Tests: Test the complete MCP server functionality
- MCP Protocol Tests: Validate MCP protocol compliance
- API Tests: Test Tavily API integration (requires valid API key)
# Run all tests npm test # Run with coverage report npm run test:coverage # Test the actual MCP server ./test-mcp.js
- TAVILY_API_KEY(required): Your Tavily API key
- NODE_ENV(optional): Set to "production" for production deployment
Thepm2-apps.jsonfile contains production configuration:
{ "apps": [{ "name": "tavily-mcp-server", "script": "dist/index.js", "instances": 1, "exec_mode": "fork", "env": { "NODE_ENV": "production", "TAVILY_API_KEY": "your-api-key" } }] }
Add to your global MCP settings (~/.roo/mcp_settings.json):
{ "mcpServers": { "tavily-search": { "command": "node", "args": ["/home/ubuntu/roo-tavily/tavily-mcp-server/dist/index.js"], "env": { "TAVILY_API_KEY": "your-api-key-here" } } } }
Add to your project's MCP settings (.roo/mcp.json):
{ "mcpServers": { "tavily-search": { "command": "node", "args": ["./tavily-mcp-server/dist/index.js"], "env": { "TAVILY_API_KEY": "your-api-key-here" } } } }
Once configured, you can use the web search tool in Roo:
<use_mcp_tool> <server_name>tavily-search</server_name> <tool_name>web_search</tool_name> <arguments> { "query": "latest developments in AI", "search_depth": "advanced", "max_results": 10, "include_answer": true } </arguments> </use_mcp_tool>
Search the web using Tavily's AI-optimized search API.
The tool returns formatted search results including:
- Direct Answer: AI-generated answer to the query (if available)
- Search Results: List of relevant web pages with:
- Title and URL
- Content snippet
- Relevance score
- Publication date (if available)
# Search Results for: "latest developments in AI" ## Direct Answer Recent AI developments include advances in large language models, multimodal AI systems, and improved reasoning capabilities... ## Search Results ### 1. Major AI Breakthroughs in 2024 URL: https://example.com/ai-breakthroughs Published: 2024-01-15 Score: 0.95 Recent developments in artificial intelligence have shown remarkable progress in areas such as natural language processing... --- ### 2. OpenAI Announces GPT-5 URL: https://example.com/gpt5-announcement Score: 0.92 OpenAI has announced the development of GPT-5, promising significant improvements in reasoning and multimodal capabilities... --- ## Follow-up Questions 1. What are the implications of these AI developments? 2. How do these advances compare to previous years? 3. What challenges remain in AI development?
# Start the server pm2 start pm2-apps.json # View status pm2 status # View logs pm2 logs tavily-mcp-server # Restart server pm2 restart tavily-mcp-server # Stop server pm2 stop tavily-mcp-server # Monitor all processes pm2 monit
If you need HTTP access, you can set up an Nginx reverse proxy:
server { listen 80; server_name your-domain.com; location / { proxy_pass http://localhost:3000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; } }
- Application Logs:/var/log/pm2/tavily-mcp-server.log
- Error Logs:/var/log/pm2/tavily-mcp-server-error.log
- PM2 Monitoring:pm2 monit
-
"TAVILY_API_KEY environment variable is required"
- Ensure your API key is set:export TAVILY_API_KEY="your-key"
- Check PM2 config has the correct API key
- Runnpm installto install dependencies
- Ensure you've built the project:npm run build
- Check logs:pm2 logs tavily-mcp-server
- Verify API key is valid
- Ensure port is not in use
- Verify API key is valid and has credits
- Check network connectivity
- Review error logs for specific API errors
- Fork the repository
- Create a feature branch:git checkout -b feature-name
- Make your changes
- Add tests for new functionality
- Ensure all tests pass:npm test
- Submit a pull request
MIT License - see LICENSE file for details.
- π§ Email:support@roo.com
- π Issues:GitHub Issues
- π Documentation:Roo Documentation
Search global news using natural language. Webz.io News Search API returns the most relevant articles and content, with filters for source, country, language, date, sentiment, and category.
Search the web using Kagi's search API
Multi-provider search broker for AI agents. Routes across SearXNG, Brave, Serper, Tavily, and Exa with automatic fallback, RRF ranking, content extraction, and budget enforcement.
A search server for the Model Context Protocol (MCP) that uses the Baidu Wenxin API.
Perform web, news, and image searches using the Microsoft Bing Search API.
An MCP server for web and local search using the Brave Search API.
Integrates the Brave Search API for both web and local search capabilities. Requires a BRAVE_API_KEY.
An MCP server for the Brave Search API, providing web and local search capabilities via a streaming SSE interface.
An MCP server for the Brave Search API, providing both web and local search capabilities.
Search for cocktail recipes using the cezzis.com API.
Free search API for AI agents β 105 engines, 22 profiles, 94.3% SimpleQA accuracy, MCP server with 5 tools
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.




