Skip to main content
Glama

tavily-search

tavily-search MCP 服务器

MCP 服务器项目

成分

该服务器使用 Tavily API 根据指定的查询执行搜索。

  • 搜索结果以文本格式返回。
  • 搜索结果包括 AI 响应、URI 和搜索结果的标题。

工具

该服务器实现了以下工具:

  • 搜索:根据指定的查询执行搜索
    • 必需参数:“查询”
    • 可选参数:“search_depth”(基本或高级)

通过 Smithery 安装

要通过Smithery自动安装 Tavily Search for Claude Desktop:

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

安装

  1. 下载存储库。
git clone https://github.com/Tomatio13/mcp-server-tavily.git
  1. 打开 Claude Desktop 配置文件。
On MacOS: `~/Library/Application\ Support/Claude/claude_desktop_config.json` On Windows: `C:\Users\[username]\AppData\Roaming\Claude\claude_desktop_config.json`
  1. 编辑配置文件如下:
"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" } } }
  1. 重新启动 Claude Desktop。

用法

在 Claude Desktop 中,当您询问“请搜索某些内容”时,您将收到搜索结果。

搜索示例:

Please search in detail for today's events in Kamakura

响应示例:

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.

日志存储位置

日志存储在以下位置:

对于 Windows:

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

使用游标执行

  1. 创建一个 shell 脚本(例如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. 配置 Cursor 的 MCP 服务器设置如下:
Name: tavily-search Type: command Command: /path/to/your/script.sh
  1. 保存设置。
  2. 保存设置后,您可以要求 Cursor 的 Composer-Agent“搜索某些内容”,它将返回搜索结果。

使用 Docker Compose 在本地环境中运行

目的

对于无法使用 Claude Desktop 的 Windows/MacOS 以外的操作系统,本节介绍如何使用 Docker compose 在本地环境中设置和运行 MCP 服务器和客户端。

步骤

  1. 安装 Docker。
  2. 下载存储库。
git clone https://github.com/Tomatio13/mcp-server-tavily.git
  1. 运行 Docker compose。
docker compose up -d
  1. 执行客户端。
docker exec mcp_server uv --directory /usr/src/app/mcp-server-tavily/src run client.py
  1. 执行结果
  2. 在搜索可用工具后(如下所示),将向 Tavily 发出查询并返回响应:
2024-12-01 11:21:56,930 - tavily-search-server - INFO - Starting Tavily search server 2024-12-01 11:21:56,932 - tavily-search-server - INFO - Server initialized, starting main loop 2024-12-01 11:21:56,936 - mcp.server - INFO - Processing request of type ListToolsRequest 2024-12-01 11:21:56,936 - tavily-search-server - INFO - Listing available tools 利用可能なツール: nextCursor=None tools=[Tool(name='search', description='Search the web using Tavily API', inputSchema={'type': 'object', 'properties': {'query': {'type': 'string', 'description': 'Search query'}, 'search_depth': {'type': 'string', 'description': 'Search depth (basic or advanced)', 'enum': ['basic', 'advanced']}}, 'required': ['query']})] 2024-12-01 11:21:56,937 - mcp.server - INFO - Processing request of type CallToolRequest 2024-12-01 11:21:56,937 - tavily-search-server - INFO - TOOL_CALL_DEBUG: Tool called - name: search, arguments: {'query': '今日の東京タワーのイベントを教えて下さい'} 2024-12-01 11:21:56,937 - tavily-search-server - INFO - Executing search with query: '今日の東京タワーのイベントを教えて下さい' 2024-12-01 11:22:00,243 - httpx - INFO - HTTP Request: POST https://api.tavily.com/search "HTTP/1.1 200 OK" 2024-12-01 11:22:00,243 - tavily-search-server - INFO - Search successful - Answer generated 2024-12-01 11:22:00,243 - tavily-search-server - INFO - Search successful - Results available ツール実行結果: content=[TextContent(type='text', text='AI Answer:\n今日の東京タワーのイベントは以下の通りです:\n1. Candlelight: エド・シーランとコールドプレイのヒットメドレー - 12月01日\n2. チームラボプラネッツ TOKYO - 12月01日から1月21日\n\n他にもイベントがある可能性がありますので、公式ウェブサイト等で最新情報をご確認ください。\n\n\n\nSearch Results:\n\n1. 東京タワー (東京): 現在のイベントとチケット | Fever\nURL: https://feverup.com/ja/tokyo/venue/tokyo-tower\nSummary: Summary not found\n\n\n2. 東京タワー(東京都)の施設で開催するイベント一覧|ウォーカープラス\nURL: https://www.walkerplus.com/spot/ar0313s03867/e_list.html\nSummary: Summary not found\n\n\n3. 東京タワー - Tokyo Tower\nURL: https://www.tokyotower.co.jp/event/\nSummary: Summary not found\n')] isError=False
-
security - not tested
A
license - permissive license
-
quality - not tested

local-only server

The server can only run on the client's local machine because it depends on local resources.

Tools

Tavily AI 搜索 API

  1. 成分
    1. 工具
    2. 通过 Smithery 安装
    3. 安装
  2. 用法
    1. 日志存储位置
      1. 使用游标执行
        1. 使用 Docker Compose 在本地环境中运行
          1. 目的
          2. 步骤

        Related MCP Servers

        • A
          security
          A
          license
          A
          quality
          Facilitates integration of Brave Search functionalities with AI assistants through the Model Context Protocol, enabling web and local searches using the Brave Search API.
          Last updated -
          2
          4
          Python
          MIT License
        • A
          security
          A
          license
          A
          quality
          This server enables AI systems to integrate with Tavily's search and data extraction tools, providing real-time web information access and domain-specific searches.
          Last updated -
          2
          8,040
          437
          JavaScript
          MIT License
          • Apple
          • Linux
        • A
          security
          F
          license
          A
          quality
          An MCP protocol server that enables web search functionality using the Tavily API, allowing AI assistants to perform internet searches in real-time.
          Last updated -
          4
          2
          Python
        • -
          security
          A
          license
          -
          quality
          Provides AI-powered web search capabilities using Tavily's search API, enabling LLMs to perform sophisticated web searches, get direct answers to questions, and search recent news articles.
          Last updated -
          53
          Python
          MIT License
          • Linux
          • Apple

        View all related MCP servers

        MCP directory API

        We provide all the information about MCP servers via our MCP API.

        curl -X GET 'https://glama.ai/api/mcp/v1/servers/Tomatio13/mcp-server-tavily'

        If you have feedback or need assistance with the MCP directory API, please join our Discord server