mcp-server-tavily
by: Tomatio13
mcp server 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
A MCP server project that uses the Tavily API to perform searches based on specified queries. Search results are returned in text format, including AI responses, URIs, and titles of the search results.
Components
This server implements the following tools:
- search: Performs searches based on specified queries
- Required argument:
query
- Optional argument:
search_depth
(basic or advanced)
- Required argument:
Installing via Smithery
To install Tavily Search for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install tavily-search --client claude
Installation Steps
-
Download the repository:
git clone https://github.com/Tomatio13/mcp-server-tavily.git
-
Open the Claude Desktop configuration file:
- On MacOS:
~/Library/Application\ Support/Claude/claude_desktop_config.json
- On Windows:
C:\Users\[username]\AppData\Roaming\Claude\claude_desktop_config.json
- On MacOS:
-
Edit the 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" } } }
-
Restart Claude Desktop.
Usage
In Claude Desktop, when you ask "Please search for something," you will receive search results.
Example:
Please search in detail for today's events in Kamakura
Response example:
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.
Log Storage Location
Logs are stored here:
- Windows:
C:\Users\[username]\AppData\Roaming\Claude\logs\mcp-server-tavily-search
Execution with Cursor
-
Create a shell script (
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
-
Configure Cursor's MCP Server settings:
Name: tavily-search Type: command Command: /path/to/your/script.sh
-
Save the settings.
-
You can then ask Cursor's Composer-Agent to "search for something," and it will return the search results.
Running in Local Environment Using Docker Compose
Purpose
For operating systems other than Windows/MacOS where Claude Desktop cannot be used, this section explains how to set up and run an MCP server and client locally using Docker Compose.
Steps
-
Install Docker.
-
Download the repository:
git clone https://github.com/Tomatio13/mcp-server-tavily.git
-
Run Docker Compose:
docker compose up -d
-
Execute the client:
docker exec mcp_server uv --directory /usr/src/app/mcp-server-tavily/src run client.py
Execution Example
After searching for available tools, a query will be issued to Tavily, and a response will be returned:
2024-12-01 11:21:56,930 - tavily-search-server - INFO - Starting Tavily search server
...
2024-12-01 11:22:00,243 - tavily-search-server - INFO - Search successful - Answer generated
...
ツール実行結果: content=[TextContent(type='text', text='AI Answer:
今日の東京タワーのイベントは以下の通りです:
1. Candlelight: エド・シーランとコールドプレイのヒットメドレー - 12月01日
2. チームラボプラネッツ TOKYO - 12月01日から1月21日
他にもイベントがある可能性がありますので、公式ウェブサイト等で最新情報をご確認ください。
Search Results:
1. 東京タワー (東京): 現在のイベントとチケット | Fever
URL: https://feverup.com/ja/tokyo/venue/tokyo-tower
2. 東京タワー(東京都)の施設で開催するイベント一覧|ウォーカープラス
URL: https://www.walkerplus.com/spot/ar0313s03867/e_list.html
3. 東京タワー - Tokyo Tower
URL: https://www.tokyotower.co.jp/event/
')] isError=False