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 querymax_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 resultsexclude_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 querymax_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 resultsexclude_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 querymax_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 resultsexclude_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
You should see output similar to:
Option 2: From source
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:
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.
Configuration
API Key Setup
The server requires a Tavily API key, which can be provided in three ways:
- Through a
.env
file in your project directory:Copy - As an environment variable:Copy
- As a command-line argument:Copy
Configure for Claude.app
Add to your Claude settings:
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:
To generate a report with domain filtering:
To use answer search mode for direct answers:
For news search:
Testing
The project includes a comprehensive test suite. To run the tests:
- Install test dependencies:Copy
- Run the tests:Copy
You should see output similar to:
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.
Docker
Build the Docker image:
Alternatively, build directly with Docker:
Run a detached Docker container (default name mcp_tavily_container
, port 8000 → 8000):
Or manually:
Stop and remove the container:
Follow container 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:
Contributing
We welcome contributions to improve mcp-tavily! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Make your changes
- Run tests to ensure they pass
- Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
For examples of other MCP servers and implementation patterns, see: https://github.com/modelcontextprotocol/servers
License
mcp-tavily is licensed under the MIT License. See the LICENSE file for details.
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Provides 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.
- Features
- Prerequisites
- Installation
- Configuration
- Usage Examples
- Testing
- Docker
- Debugging
- Contributing
- License
Related Resources
Related MCP Servers
- PythonMIT License
- AsecurityAlicenseAqualityIntegrates 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.Last updated -3649JavaScriptMIT License
- AsecurityAlicenseAqualityAn MCP server implementation that integrates the Tavily Search API, providing optimized search capabilities for LLMs.Last updated -1TypeScriptMIT License
Tavily MCP Serverofficial
AsecurityAlicenseAqualityThis server enables AI systems to integrate with Tavily's search and data extraction tools, providing real-time web information access and domain-specific searches.Last updated -25,133334JavaScriptMIT License