Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Tavily MCP Serversearch for the latest breakthroughs in fusion energy research"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Tavily MCP Server
A production-ready MCP (Model Context Protocol) server that provides web search capabilities using the Tavily API. This server integrates seamlessly with Roo and other MCP-compatible AI assistants.
Features
๐ 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
Quick Start
Prerequisites
Node.js 18+
npm or yarn
Tavily API key (Get one here)
PM2 (for production deployment)
Installation & Deployment
Clone and setup:
cd tavily-mcp-server npm installSet your API key:
export TAVILY_API_KEY="your-api-key-here"Run tests:
npm test npm run test:coverageDeploy with PM2:
./deploy.sh
That's it! The server is now running and ready for MCP connections.
Development
Build and Test
Testing
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)
Configuration
Environment Variables
TAVILY_API_KEY(required): Your Tavily API keyNODE_ENV(optional): Set to "production" for production deployment
PM2 Configuration
The pm2-apps.json file contains production configuration:
Usage with Roo
Global Installation
Add to your global MCP settings (~/.roo/mcp_settings.json):
Project-specific Installation
Add to your project's MCP settings (.roo/mcp.json):
Using the Web Search Tool
Once configured, you can use the web search tool in Roo:
API Reference
web_search Tool
Search the web using Tavily's AI-optimized search API.
Parameters
Parameter | Type | Required | Default | Description |
| string | โ | - | The search query to execute |
| string | โ | "basic" | Search depth: "basic" or "advanced" |
| boolean | โ | true | Whether to include a direct answer |
| number | โ | 5 | Number of results (1-20) |
| string[] | โ | - | Domains to include in search |
| string[] | โ | - | Domains to exclude from search |
Response Format
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)
Follow-up Questions: Suggested related queries
Example Response
Production Deployment
PM2 Management
Nginx Reverse Proxy (Optional)
If you need HTTP access, you can set up an Nginx reverse proxy:
Monitoring and Logs
Application Logs:
/var/log/pm2/tavily-mcp-server.logError Logs:
/var/log/pm2/tavily-mcp-server-error.logPM2 Monitoring:
pm2 monit
Troubleshooting
Common Issues
"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
"Cannot find module" errors
Run
npm installto install dependenciesEnsure you've built the project:
npm run build
Server won't start
Check logs:
pm2 logs tavily-mcp-serverVerify API key is valid
Ensure port is not in use
Search requests failing
Verify API key is valid and has credits
Check network connectivity
Review error logs for specific API errors
Debug Mode
Run the server in debug mode:
Testing Connection
Test the MCP server directly:
Contributing
Fork the repository
Create a feature branch:
git checkout -b feature-nameMake your changes
Add tests for new functionality
Ensure all tests pass:
npm testSubmit a pull request
License
MIT License - see LICENSE file for details.
Support
๐ง Email: support@roo.com
๐ Issues: GitHub Issues
๐ Documentation: Roo Documentation
Built with โค๏ธ by the Roo team