Tavily MCP Server
Click on "Deploy 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
Related MCP server: Tavily MCP Server
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
# 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:fixTesting
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.jsConfiguration
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:
{
"apps": [{
"name": "tavily-mcp-server",
"script": "dist/index.js",
"instances": 1,
"exec_mode": "fork",
"env": {
"NODE_ENV": "production",
"TAVILY_API_KEY": "your-api-key"
}
}]
}Usage with Roo
Global Installation
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"
}
}
}
}Project-specific Installation
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"
}
}
}
}Using the Web Search Tool
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>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
# 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?Production Deployment
PM2 Management
# 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 monitNginx Reverse Proxy (Optional)
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;
}
}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:
NODE_ENV=development npm run devTesting Connection
Test the MCP server directly:
./test-mcp.jsContributing
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
Available Tools
1 toolweb_searchB
Search the web using Tavily API. Returns relevant search results with content snippets.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | The search query to execute | |
| search_depth | No | The depth of the search (basic or advanced) | basic |
| include_answer | No | Whether to include a direct answer to the query | |
| max_results | No | Maximum number of search results to return | |
| include_domains | No | List of domains to include in search | |
| exclude_domains | No | List of domains to exclude from search |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden but offers minimal behavioral insight. It mentions the API provider (Tavily) and output format (results with snippets), but lacks details on rate limits, authentication needs, error handling, or performance characteristics that would help the agent anticipate behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that front-loads the core purpose and key output details. Every word contributes essential information with zero waste, making it optimally concise.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a 6-parameter tool with no annotations and no output schema, the description is adequate but minimal. It covers the basic purpose and output format, but lacks depth on behavioral traits, usage context, or richer operational details that would enhance agent understanding.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema fully documents all 6 parameters. The description adds no parameter-specific information beyond what's in the schema, meeting the baseline for high coverage without additional value.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Search the web') and resource ('using Tavily API'), specifying it returns 'relevant search results with content snippets'. It's specific about the API provider and output format, though without sibling tools, differentiation isn't applicable.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives. The description doesn't mention any prerequisites, constraints, or typical use cases, leaving the agent with no contextual direction for tool selection.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
1 tool update
v1.0.0- First observed
web_search
TDQS
Scored across 1 tool
With only one tool, there is no possibility of confusion or overlap between tools. The single tool 'web_search' has a clearly defined and distinct purpose, making it impossible for an agent to misselect between non-existent alternatives.
Since there is only one tool, naming consistency is inherently perfect. The tool name 'web_search' follows a clear verb_noun pattern, but with no other tools to compare against, there can be no inconsistency in the set.
A single tool is too few for a server named 'Tavily MCP Server', which implies broader web search capabilities. While 'web_search' covers the core function, typical search servers might include tools for advanced queries, filtering, or result analysis, making this feel thin and limited in scope.
The tool surface is severely incomplete for a web search domain. It lacks obvious gaps such as tools for refining searches (e.g., by date or source), handling pagination, or accessing cached content, which could lead to agent failures when trying to perform comprehensive search tasks.
Maintenance
Related MCP Connectors
Live AI-native web search with citations. One tool for every MCP client. Flat per-request pricing.
Provides AI assistants with access to Seltz's powerful Web Search capabilities.
Search the agentic web. 4,100+ sites, 11 tools incl. check_url + verify_mcp for probe-before-use.
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceIntegrates Tavily's search API with LLMs to provide advanced web search capabilities, including intelligent result summaries, domain filtering for quality control, and configurable search parameters.11 npm6MIT
- AlicenseNot gradedqualityFmaintenanceProvides AI-powered web search capabilities using Tavily's search API, enabling LLMs to perform sophisticated web searches, get direct answers to questions, and search recent news articles.72MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to perform up-to-date web searches through the Tavily API, providing comprehensive search results with AI-generated summaries.7MIT
- FlicenseBqualityDmaintenanceEnables web search capabilities through the Tavily API. Allows users to search the web for information using natural language queries via the MCP protocol.41-