MCP Connector

Enhance LLM Web Search with Tavily

Deprecated Tavily MCP server for AI-powered web/news search; superseded by Tavily's own official MCP server.

Works with tavily

90
Spark score
out of 100
Updated 8 months ago
Version 0.1.10
Models
universal

Add to Favorites

Why it matters

Integrate Tavily's AI-powered web search capabilities into your LLM applications. Retrieve direct answers, find the latest news, and extract AI-processed content from web searches.

Outcomes

What it gets done

01

Perform AI-powered web searches for LLMs.

02

Retrieve direct answers with supporting evidence from web searches.

03

Search for and extract content from the latest news articles.

04

Filter search results by domain inclusion and exclusion.

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/vb-tavily-search | bash

Capabilities

Tools your agent gets

tavily_web_search

Performs comprehensive web searches with AI-powered content extraction

tavily_answer_search

Performs web searches and generates direct answers with supporting evidence

tavily_news_search

Searches for the latest news articles with publication dates

Overview

Tavily search MCP server

A deprecated Tavily MCP server providing AI-powered web, answer, and news search, superseded by Tavily's own official, actively maintained MCP server. Deprecated - use Tavily's official MCP server for new integrations. Only use this legacy implementation if you have a specific reason not to switch.

What it does

Tavily MCP Server (mcp-tavily) is a Model Context Protocol server providing AI-powered web search using Tavily's search API. Built in early 2025 before the MCP ecosystem had standardized search patterns, it is now explicitly deprecated by its own author in favor of Tavily's official, actively maintained Tavily MCP server, which stays in sync with Tavily's latest capabilities.

It exposes three tools: tavily_web_search (comprehensive web search with AI-powered content extraction, configurable result count and basic/advanced search depth, plus domain include/exclude filters), tavily_answer_search (searches the web and generates a direct answer backed by supporting evidence, defaulting to advanced search depth), and tavily_news_search (searches recent news articles with publication dates, with a configurable lookback window in days). Each tool also has a corresponding prompt template.

{
  "mcpServers": {
    "tavily": {
      "command": "python",
      "args": ["-m", "mcp_server_tavily"],
      "env": { "TAVILY_API_KEY": "your_api_key_here" }
    }
  }
}

It requires Python 3.11+ and a Tavily API key (via .env file, environment variable, or CLI argument), installable via pip/uv, from source, or via Docker. The project includes automated weekly dependency-compatibility testing across Python 3.11-3.13 via GitHub Actions, and Make-based release tooling that avoids dependency downgrades during publishing.

When to use - and when NOT to

This server is deprecated - its own maintainer recommends using Tavily's official MCP server instead, which is actively maintained and kept current with Tavily's capabilities. Use this connector only if you have a specific reason to run the older, unmaintained implementation rather than the official one; for new integrations, prefer Tavily's official server.

It requires a Tavily API key and Python 3.11+; the underlying search functionality (web, answer, and news search with domain filtering) mirrors what the official server provides.

Capabilities

tavily_web_search: AI-extracted web search results with domain filtering. tavily_answer_search: direct answer generation backed by web sources. tavily_news_search: recent news search with a configurable date-range lookback.

How to install

Install via pip (pip install mcp-tavily) or uv (uv add mcp-tavily), or clone and build from source. Set TAVILY_API_KEY via .env file, environment variable, or CLI flag. Configure in Claude Desktop's mcpServers block, or use the one-click VS Code install buttons with a prompted API key input. Docker images are also available (docker build -t mcp_tavily . or via the provided Makefile targets).

Who it's for

Developers who specifically need the legacy mcp-tavily implementation; for new projects, Tavily's official MCP server is the recommended choice.

Source README

########################################################

Deprecation notice

I built this MCP server back in early March of 2025 when the MCP protocol was brand new and there were no consistent ways to do search in chatbots, predating other implementations.

Since then, the good folks at Tavily have released their official Tavily MCP server which is well-maintained and in sync with their latest capabilities. Therefore, I'm now deprecating this server in favor of theirs.

########################################################

Tavily MCP Server

A Model Context Protocol server that provides AI-powered web search capabilities using Tavily's search API. This server enables LLMs to perform sophisticated web searches, get direct answers to questions, and search recent news articles with AI-extracted relevant content.

Features

Available Tools

  • tavily_web_search - Performs comprehensive web searches with AI-powered content extraction.

    • query (string, required): Search query
    • max_results (integer, optional): Maximum number of results to return (default: 5, max: 20)
    • search_depth (string, optional): Either "basic" or "advanced" search depth (default: "basic")
    • include_domains (list or string, optional): List of domains to specifically include in results
    • exclude_domains (list or string, optional): List of domains to exclude from results
  • tavily_answer_search - Performs web searches and generates direct answers with supporting evidence.

    • query (string, required): Search query
    • max_results (integer, optional): Maximum number of results to return (default: 5, max: 20)
    • search_depth (string, optional): Either "basic" or "advanced" search depth (default: "advanced")
    • include_domains (list or string, optional): List of domains to specifically include in results
    • exclude_domains (list or string, optional): List of domains to exclude from results
  • tavily_news_search - Searches recent news articles with publication dates.

    • query (string, required): Search query
    • max_results (integer, optional): Maximum number of results to return (default: 5, max: 20)
    • days (integer, optional): Number of days back to search (default: 3)
    • include_domains (list or string, optional): List of domains to specifically include in results
    • exclude_domains (list or string, optional): List of domains to exclude from results

Prompts

The server also provides prompt templates for each search type:

  • tavily_web_search - Search the web using Tavily's AI-powered search engine
  • tavily_answer_search - Search the web and get an AI-generated answer with supporting evidence
  • tavily_news_search - Search recent news articles with Tavily's news search

Prerequisites

  • Python 3.11 or later
  • A Tavily API key (obtain from Tavily's website)
  • uv Python package manager (recommended)

Installation

Option 1: Using pip or uv

# With pip
pip install mcp-tavily

# Or with uv (recommended)
uv add mcp-tavily

You should see output similar to:

Resolved packages: mcp-tavily, mcp, pydantic, python-dotenv, tavily-python [...]
Successfully installed mcp-tavily-0.1.4 mcp-1.0.0 [...]

Option 2: From source

# Clone the repository
git clone https://github.com/RamXX/mcp-tavily.git
cd mcp-tavily

# Create a virtual environment (optional but recommended)
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Install dependencies and build
uv sync  # Or: pip install -r requirements.txt
uv build  # Or: pip install -e .

# To install with test dependencies:
uv sync --dev  # Or: pip install -r requirements-dev.txt

During installation, you should see the package being built and installed with its dependencies.

Usage with VS Code

For quick installation, use one of the one-click install buttons below:

Install with UV in VS Code Install with UV in VS Code Insiders

For manual installation, add the following JSON block to your User Settings (JSON) file in VS Code. You can do this by pressing Ctrl + Shift + P and typing Preferences: Open User Settings (JSON).

Optionally, you can add it to a file called .vscode/mcp.json in your workspace. This will allow you to share the configuration with others.

Note that the mcp key is not needed in the .vscode/mcp.json file.

{
  "mcp": {
    "inputs": [
      {
        "type": "promptString",
        "id": "apiKey",
        "description": "Tavily API Key",
        "password": true
      }
    ],
    "servers": {
      "tavily": {
        "command": "uvx",
        "args": ["mcp-tavily"],
        "env": {
          "TAVILY_API_KEY": "${input:apiKey}"
        }
      }
    }
  }
}

Configuration

API Key Setup

The server requires a Tavily API key, which can be provided in three ways:

  1. Through a .env file in your project directory:

    TAVILY_API_KEY=your_api_key_here
    
  2. As an environment variable:

    export TAVILY_API_KEY=your_api_key_here
    
  3. As a command-line argument:

    python -m mcp_server_tavily --api-key=your_api_key_here
    

Configure for Claude.app

Add to your Claude settings:

"mcpServers": {
  "tavily": {
    "command": "python",
    "args": ["-m", "mcp_server_tavily"]
  },
  "env": {
    "TAVILY_API_KEY": "your_api_key_here"
  }
}

If you encounter issues, you may need to specify the full path to your Python interpreter. Run which python to find the exact path.

Usage Examples

For a regular web search:

Tell me about Anthropic's newly released MCP protocol

To generate a report with domain filtering:

Tell me about redwood trees. Please use MLA format in markdown syntax and include the URLs in the citations. Exclude Wikipedia sources.

To use answer search mode for direct answers:

I want a concrete answer backed by current web sources: What is the average lifespan of redwood trees?

For news search:

Give me the top 10 AI-related news in the last 5 days

Testing

The project includes a comprehensive test suite with automated dependency compatibility testing.

Running Tests

  1. Install test dependencies:

    source .venv/bin/activate  # If using a virtual environment
    uv sync --dev  # Or: pip install -r requirements-dev.txt
    
  2. Run the standard test suite:

    ./tests/run_tests.sh
    # Or using Make
    make test
    

Dependency Compatibility Testing

To ensure the project works with the latest dependency versions, use these commands:

# Test with latest dependencies using Make
make test-deps

# Full compatibility test with verbose output
make test-compatibility

# Or use the standalone script
./scripts/test-compatibility.sh

These commands will:

  • Update all dependencies to their latest versions
  • Run the full test suite with coverage
  • Report any compatibility issues
  • Show version changes for transparency

Automated Testing

The project includes automated dependency compatibility testing through GitHub Actions:

  • Weekly Testing: Runs every Monday at 8 AM UTC
  • Multi-Python Support: Tests against Python 3.11, 3.12, and 3.13
  • Issue Creation: Automatically creates GitHub issues when tests fail
  • Manual Trigger: Can be triggered manually from the GitHub Actions tab

Understanding Test Results

When tests pass: Your project is compatible with the latest dependency versions. You can safely update your requirements files.

When tests fail: Review the test output to identify breaking changes, update your code to handle API changes, update tests if needed, or consider pinning problematic dependency versions.

Test Output Example

You should see output similar to:

======================================================= test session starts ========================================================
platform darwin -- Python 3.13.3, pytest-8.3.5, pluggy-1.5.0
rootdir: /Users/ramirosalas/workspace/mcp-tavily
configfile: pyproject.toml
plugins: cov-6.0.0, asyncio-0.25.3, anyio-4.8.0, mock-3.14.0
asyncio: mode=Mode.STRICT, asyncio_default_fixture_loop_scope=function
collected 50 items                                                                                                                 

tests/test_docker.py ..                                                                                                      [  4%]
tests/test_integration.py .....                                                                                              [ 14%]
tests/test_models.py .................                                                                                       [ 48%]
tests/test_server_api.py .....................                                                                               [ 90%]
tests/test_utils.py .....                                                                                                    [100%]

---------- coverage: platform darwin, python 3.13.3-final-0 ----------
Name                                Stmts   Miss  Cover
-------------------------------------------------------
src/mcp_server_tavily/__init__.py      16      2    88%
src/mcp_server_tavily/__main__.py       2      2     0%
src/mcp_server_tavily/server.py       149     16    89%
-------------------------------------------------------
TOTAL                                 167     20    88%

The test suite includes tests for data models, utility functions, integration testing, error handling, and parameter validation. It focuses on verifying that all API capabilities work correctly, including handling of domain filters and various input formats.

Release Management

The project includes tools for building and releasing with the latest dependency versions:

Building with Latest Dependencies

# Build package with latest dependency versions
make build-latest

# Complete release workflow: test, build, and check with latest deps
make release-all

# Prepare a release with version management
./scripts/prepare-release.sh [new_version]

Release Workflow

Recommended approach for releases with latest dependencies:

  1. Complete release preparation: make release-all
  2. Upload without downgrades: make upload-latest

Alternative step-by-step approach:

  1. Test with latest dependencies: make test-compatibility
  2. Build for release: make release-build
  3. Upload without rebuilding: make upload-latest

One-command release and publish:

make release-publish

Important: Use make upload-latest instead of make upload to prevent dependency downgrades during the upload process. The upload-latest command uses existing distribution files without reinstalling dependencies.

The release commands ensure your package is built and tested with the most recent compatible dependency versions, preventing the downgrades that can occur with traditional build chains.

Docker

Build the Docker image:

make docker-build

Alternatively, build directly with Docker:

docker build -t mcp_tavily .

Run a detached Docker container (default name mcp_tavily_container, port 8000 → 8000):

make docker-run

Or manually:

docker run -d --name mcp_tavily_container \
  -e TAVILY_API_KEY=your_api_key_here \
  -p 8000:8000 mcp_tavily

Stop and remove the container:

make docker-stop

Follow container logs:

make docker-logs

You can override defaults by setting environment variables:

  • DOCKER_IMAGE: image name (default mcp_tavily)
  • DOCKER_CONTAINER: container name (default mcp_tavily_container)
  • HOST_PORT: host port to bind (default 8000)
  • CONTAINER_PORT: container port (default 8000)

Debugging

You can use the MCP inspector to debug the server:

# Using npx
npx @modelcontextprotocol/inspector python -m mcp_server_tavily

# For development
cd path/to/mcp-tavily
npx @modelcontextprotocol/inspector python -m mcp_server_tavily

FAQ

Common questions

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.