Tavily Search MCP server

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

This MCP server integrates Tavily's powerful search capabilities with Claude, allowing you to perform web searches directly from your AI assistant. The server processes search queries and returns comprehensive results including AI-generated summaries, URIs, and titles.

Installation Options

Using Smithery (Recommended)

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

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

Manual Installation

If you prefer manual installation:

  1. Clone the repository:

    git clone https://github.com/Tomatio13/mcp-server-tavily.git
    
  2. Open the Claude Desktop configuration file:

    MacOS:

    ~/Library/Application\ Support/Claude/claude_desktop_config.json
    

    Windows:

    C:\Users\[username]\AppData\Roaming\Claude\claude_desktop_config.json
    
  3. Edit the configuration file to add the Tavily search server:

    "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"
        }
      }
    }
    
  4. Restart Claude Desktop.

Usage

Using the Tavily search integration is straightforward:

  1. In Claude Desktop, simply ask for information with a search prompt:

    Please search in detail for today's events in Kamakura
    
  2. Claude will use the Tavily API to search and return relevant results:

    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.
    

Search Parameters

When searching, you can specify:

  • query: Your search term (required)
  • search_depth: Either "basic" or "advanced" (optional)

Alternative Setup Methods

Using 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
    
  2. Configure Cursor's MCP Server settings:

    Name: tavily-search
    Type: command
    Command: /path/to/your/script.sh
    
  3. Save and use by asking Cursor's Composer-Agent to search for something.

Using Docker Compose

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
    
  3. Start the services:

    docker compose up -d
    
  4. Run the client:

    docker exec mcp_server uv --directory /usr/src/app/mcp-server-tavily/src run client.py
    

Debugging

Logs are stored in the following location:

Windows:

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

Check these logs if you encounter any issues with the search functionality.

How to add this MCP server to 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 > MCP and click "Add new global MCP server".

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

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

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