MCP HubMCP Hub
Tomatio13

mcp-server-tavily

by: Tomatio13

mcp server tavily

29created 30/11/2024
Visit
tavily

📌Overview

Purpose: To provide an efficient MCP server that leverages the Tavily API for performing accurate and user-friendly search queries.

Overview: The Tavily Search MCP server enables users to execute searches based on custom queries, returning results in a user-friendly text format that includes AI-generated responses, URIs, and titles. It is compatible with various operating systems and provides installation options through different methods such as Smithery and Docker Compose.

Key Features:

  • Search Functionality: Performs tailored searches using the Tavily API with required and optional parameters for enhanced user experience.

  • User-Friendly Output: Returns search results in a clear, accessible text format, including relevant details like event descriptions and links for further information.


Tavily-Search MCP Server

Overview

The Tavily-Search MCP server utilizes the Tavily API to perform searches based on specified queries, returning results in text format including AI responses, URIs, and titles.

Components

  • Search Tool:
    • Command: search
    • Required Argument: query
    • Optional Argument: search_depth (basic or advanced)

Installation

Via Smithery

To install Tavily Search for Claude Desktop automatically:

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

Usage

In Claude Desktop, to initiate a search, simply input a query:

Please search in detail for today's events in Kamakura

Sample Response:

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

Log Storage

Logs are stored in:

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

Running 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
    
  2. Configure Cursor's MCP Server settings:
    • Name: tavily-search
    • Type: command
    • Command: /path/to/your/script.sh
  3. Save the settings and use Cursor's Composer-Agent to search.

Running in Local Environment Using Docker Compose

Purpose

This section describes how to set up and run an MCP server and client in a local environment using Docker Compose.

Steps

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