Labsco
altinakseven logo

Tavily MCP Server

from altinakseven

Web search using the Tavily API.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedAccount requiredNeeds API keys

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

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:fix

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)
# Run all tests
npm test

# Run with coverage report
npm run test:coverage

# Test the actual MCP server
./test-mcp.js

API Reference

web_search Tool

Search the web using Tavily's AI-optimized search API.

Parameters

ParameterTypeRequiredDefaultDescription
querystringโœ…-The search query to execute
search_depthstringโŒ"basic"Search depth: "basic" or "advanced"
include_answerbooleanโŒtrueWhether to include a direct answer
max_resultsnumberโŒ5Number of results (1-20)
include_domainsstring[]โŒ-Domains to include in search
exclude_domainsstring[]โŒ-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?

Support


Built with โค๏ธ by the Roo team