Tavily Search MCP server

Perform web searches and retrieve structured results via Tavily.
Back to servers
Setup instructions
Provider
Tomatio13
Release date
Nov 30, 2024
Language
Python
Stats
43 stars

This MCP server integrates Tavily's search capabilities into Claude Desktop and other compatible clients. It allows you to perform web searches directly within your AI assistant interface, returning formatted search results including AI-generated summaries, titles, and URLs.

Installation Options

Using Smithery (Automated Installation)

The easiest way to install the Tavily Search server for Claude Desktop is via Smithery:

npx -y @smithery/cli install tavily-search --client claude

Manual Installation

1. Clone the Repository

git clone https://github.com/Tomatio13/mcp-server-tavily.git

2. Configure Claude Desktop

Edit the Claude Desktop configuration file located at:

  • MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json
  • Windows: C:\Users\[username]\AppData\Roaming\Claude\claude_desktop_config.json

Add the following configuration:

"mcpServers": {
  "tavily-search": {
    "command": "uv",
    "args": [
      "--directory",
      "C:\\your_path\\mcp-server-tavily",
      "run",
      "tavily-search"
    ],
    "env": {
      "TAVILY_API_KEY": "YOUR_TAVILY_API_KEY",
      "PYTHONIOENCODING": "utf-8"
    }
  }
}

3. Restart Claude Desktop

Restart the Claude Desktop application to apply the changes.

Using the Search Tool

Once installed, you can use the search functionality by asking Claude to search for information. The search tool accepts the following parameters:

  • query (required): The search term or question
  • search_depth (optional): Can be "basic" or "advanced"

Example Queries

Simply ask Claude to search for information:

Please search in detail for today's events in Kamakura

Claude will return formatted search results including relevant information found online:

According to the search results, the following events start today, December 1st:
"Kamakura Promotion Photo Contest 2025"
Period: December 1, 2024 - January 31, 2025
A photo contest for those who love Kamakura
Applications start accepting from today
Also, as a related upcoming event:
On December 7th, an exhibition by 12 Kamakura artists will be held at the Seibu Press Inn Kamakura Ofuna Station East Exit Lounge.

Alternative Setups

Setting Up with Cursor

  1. Create a shell script (e.g., script.sh):
#!/bin/bash
TARGET_DIR=/path/to/mcp-server-tavily
cd "${TARGET_DIR}"
export TAVILY_API_KEY="your-api-key"
export PYTHONIOENCODING=utf-8
uv --directory $PWD run tavily-search
  1. Configure Cursor's MCP Server settings:
Name: tavily-search
Type: command
Command: /path/to/your/script.sh
  1. Save the settings and ask Cursor's Composer-Agent to "search for something"

Docker Compose Setup

For operating systems where Claude Desktop isn't available:

  1. Install Docker

  2. Clone the repository:

git clone https://github.com/Tomatio13/mcp-server-tavily.git
  1. Run Docker compose:
docker compose up -d
  1. Execute the client:
docker exec mcp_server uv --directory /usr/src/app/mcp-server-tavily/src run client.py

Log Locations

Logs are stored at:

  • Windows: C:\Users\[username]\AppData\Roaming\Claude\logs\mcp-server-tavily-search

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "tavily-search" '{"command":"uv","args":["--directory","C:\\your_path\\mcp-server-tavily","run","tavily-search"],"env":{"TAVILY_API_KEY":"YOUR_TAVILY_API_KEY","PYTHONIOENCODING":"utf-8"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "tavily-search": {
            "command": "uv",
            "args": [
                "--directory",
                "C:\\your_path\\mcp-server-tavily",
                "run",
                "tavily-search"
            ],
            "env": {
                "TAVILY_API_KEY": "YOUR_TAVILY_API_KEY",
                "PYTHONIOENCODING": "utf-8"
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "tavily-search": {
            "command": "uv",
            "args": [
                "--directory",
                "C:\\your_path\\mcp-server-tavily",
                "run",
                "tavily-search"
            ],
            "env": {
                "TAVILY_API_KEY": "YOUR_TAVILY_API_KEY",
                "PYTHONIOENCODING": "utf-8"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later