Tavily Search

by arben-adm

1 stars
Not rated
GitHub

About

Integrates with Tavily search API to enable natural language web queries for retrieving up-to-date, contextual information from across the internet.

Details

Author
arben-adm
Repository
arben-adm/tavily-mcp-search
GitHub stars
1
License
MIT License
Categories
Search, Other, AI, Design, Developer Tools, Infrastructure, Knowledge Base, API

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Tavily Search
    Command (node, npx, python, etc.) uv
    Arguments
    • Argument 1 --directory
    • Argument 2 /path/to/mcp-tavily-search/mcp_tavily_search
    • Argument 3 run
    • Argument 4 server.py
    Environment
    • TAVILY_API_KEY YOUR-API-KEY

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Prerequisites

- Python 3.11 or higher
- UV Package Manager (Installation Guide)
- Tavily API key (Get one here)

Installing Via Smithery

To install Tavily Search for Claude Desktop automatically via Smithery:

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

Installing Manually

Here's how you can get up and running with my project in minutes:


1 Create Environment

uv venv && .venv\Scripts\activate # Windows

2 Install Dependencies

uv pip install -e .

3 Set Up Configuration

echo TAVILY_API_KEY=your-key-here > .env

Search Configuration

- I've made the search depth configurable (basic/advanced)
- Adjustable result limits (1-20 results)
- Clean markdown-formatted output
- Snippet previews with source URLs
- Optional image results
- Specialized news search topic

Claude Desktop Setup

I've optimized the Claude Desktop experience with this configuration:

json
{
"mcpServers": {
"tavily-search": {
"command": "uv",
"args": [
"--directory",
"/path/to/mcp-tavily-search/mcp_tavily_search",
"run",
"server.py"
],
"env": {
"TAVILY_API_KEY": "YOUR-API-KEY"
}
}
}
}

πŸ“ Configuration paths:
- Windows: %APPDATA%\Claude\claude_desktop_config.json
- Unix/MacOS: ~/.config/Claude/claude_desktop_config.json

Usage Examples

Here are some examples of how to use the enhanced search capabilities I've implemented:

1. Basic search:

json
{
"name": "search",
"arguments": {
"query": "Latest news on artificial intelligence"
}
}

2. Advanced search with images:
json
{
"name": "search",
"arguments": {
"query": "Elon Musk SpaceX achievements",
"search_depth": "advanced",
"include_images": true,
"max_results": 10
}
}

3. News-specific search:
json
{
"name": "search",
"arguments": {
"query": "Climate change impact on agriculture",
"topic": "news",
"max_results": 5
}
}

4. Search with raw content:
json
{
"name": "search",
"arguments": {
"query": "Python programming best practices",
"include_raw_content": true,
"max_results": 3
}
}

Running Tests

To run the unit tests for this project, follow these steps:

1. Install the development dependencies:

bash
uv pip install -e ".[dev]"

2. Run the tests using pytest:
bash
pytest mcp_tavily_search
``

This will run all the tests in the mcp_tavily_search directory, including both test_client.py and test_server.py`.

search

Perform a search query. Parameters: query (string), search_depth (optional string), include_images (optional boolean), max_results (optional integer), topic (optional string), include_raw_content (optional boolean)

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "tavily search": {
            "env": {
                "TAVILY_API_KEY": "YOUR-API-KEY"
            },
            "args": [
                "--directory",
                "/path/to/mcp-tavily-search/mcp_tavily_search",
                "run",
                "server.py"
            ],
            "command": "uv"
        }
    }
}

Linux

{
    "env": {
        "TAVILY_API_KEY": "YOUR-API-KEY"
    },
    "args": [
        "--directory",
        "/path/to/mcp-tavily-search/mcp_tavily_search",
        "run",
        "server.py"
    ],
    "command": "uv"
}

Macos

{
    "env": {
        "TAVILY_API_KEY": "YOUR-API-KEY"
    },
    "args": [
        "--directory",
        "/path/to/mcp-tavily-search/mcp_tavily_search",
        "run",
        "server.py"
    ],
    "command": "uv"
}

Windows

{
    "env": {
        "TAVILY_API_KEY": "YOUR-API-KEY"
    },
    "args": [
        "--directory",
        "/path/to/mcp-tavily-search/mcp_tavily_search",
        "run",
        "server.py"
    ],
    "command": "uv"
}

πŸ” My Tavily Search MCP Agent

I've created a powerful Model Context Protocol (MCP) Server powered by the Tavily API. With this, you can get high-quality, reliable information from business, news, finance, and politics - all through a robust and developer-friendly interface.

smithery badge
Tavily Search Agent MCP Server
CI
codecov

🌟 Why I Built Tavily Search MCP

In today's fast-paced digital landscape, I recognized the need for quick access to precise information. I needed a web search tool that works with my sequential thinking MCP server. That's why I developed Tavily Search MCP, which excels with:

⚑️ Lightning-fast async search responses
πŸ›‘οΈ Built-in fault tolerance with automatic retries
🎯 Clean, markdown-formatted results
πŸ” Smart content snippets
πŸ› οΈ Comprehensive error handling
πŸ–ΌοΈ Optional image results
πŸ“° Specialized news search

πŸš€ Quick Start

Installing via Smithery

To install Tavily Search for Claude Desktop automatically via Smithery:

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

Installing Manually

Here's how you can get up and running with my project in minutes:

```bash

No reviews yet β€” be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.