tavily-search-mcp-server
Tavily 搜索 MCP 服务器
集成 Tavily Search API 的 MCP 服务器实现,为 LLM 提供优化的搜索功能。
特征
**网络搜索:**执行针对 LLM 优化的网络搜索,并控制搜索深度、主题和时间范围。
**内容提取:**从搜索结果中提取最相关的内容,优化质量和大小。
**可选功能:**包括图像、图像描述、LLM 生成的简短答案和原始 HTML 内容。
**域名过滤:**在搜索结果中包含或排除特定域名。
Related MCP server: metasearch-mcp
工具
tavily_search
使用 Tavily Search API 执行网络搜索。
输入:
query(字符串,必需):搜索查询。search_depth(字符串,可选):“basic”或“advanced”(默认值:“basic”)。topic(字符串,可选):“一般”或“新闻”(默认:“一般”)。days(数字,可选):新闻搜索的天数(默认值:3)。time_range(字符串,可选):时间范围过滤器(“day”、“week”、“month”、“year”或“d”、“w”、“m”、“y”)。max_results(数字,可选):最大结果数(默认值:5)。include_images(布尔值,可选):包含相关图像(默认值:false)。include_image_descriptions(布尔值,可选):包含图像描述(默认值:false)。include_answer(布尔值,可选):包含一个简短的 LLM 生成的答案(默认值:false)。include_raw_content(布尔值,可选):包含原始 HTML 内容(默认值:false)。include_domains(string[],可选):要包含的域。exclude_domains(string[],可选):要排除的域。
设置指南🚀
1. 先决条件
您的计算机上安装了Claude Desktop 。
Tavily API 密钥:a. 注册Tavily API 帐户。b. 选择一个计划(提供免费套餐)。c. 从 Tavily 仪表板生成您的 API 密钥。
2.安装
将此存储库克隆到您的计算机上的某个位置:
git clone https://github.com/apappascs/tavily-search-mcp-server.git安装依赖项并构建项目:
cd tavily-search-mcp-servernpm installnpm run build
3. 与 Claude Desktop 集成
打开您的 Claude Desktop 配置文件:
# On Mac: ~/Library/Application\ Support/Claude/claude_desktop_config.json # On Windows: %APPDATA%\Claude\claude_desktop_config.json根据您是否要使用
npm或docker运行服务器,将以下内容之一添加到配置中的mcpServers对象:选项 A:使用 NPM(stdio 传输)
{ "mcpServers": { "tavily-search-server": { "command": "node", "args": [ "/Users/<username>/<FULL_PATH...>/tavily-search-mcp-server/dist/index.js" ], "env": { "TAVILY_API_KEY": "your_api_key_here" } } } }选项 B:使用 NPM(SSE 传输)
{ "mcpServers": { "tavily-search-server": { "command": "node", "args": [ "/Users/<username>/<FULL_PATH...>/tavily-search-mcp-server/dist/sse.js" ], "env": { "TAVILY_API_KEY": "your_api_key_here" }, "port": 3001 } } }选项 C:使用 Docker
{ "mcpServers": { "tavily-search-server": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "TAVILY_API_KEY", "-v", "/Users/<username>/<FULL_PATH...>/tavily-search-mcp-server:/app", "tavily-search-mcp-server" ], "env": { "TAVILY_API_KEY": "your_api_key_here" } } } }重要步骤:
将
/Users/<username>/<FULL_PATH...>/tavily-search-mcp-server替换为您克隆存储库的实际完整路径。在
env部分添加你的 Tavily API 密钥。将 API 密钥之类的机密信息保存为环境变量总是更好的选择。确保在路径中使用正斜杠(
/),即使在 Windows 上也是如此。如果您正在使用 docker,请确保首先使用
docker build -t tavily-search-mcp-server:latest .
重新启动 Claude Desktop 以使更改生效。
通过 Smithery 安装
要通过Smithery自动安装 Tavily Search for Claude Desktop:
npx -y @smithery/cli install @apappascs/tavily-search-mcp-server --client claude环境设置(用于 npm)
将
.env.example复制到.env:cp .env.example .env使用您的实际 Tavily API 密钥更新
.env文件:TAVILY_API_KEY=your_api_key_here注意:切勿将实际的 API 密钥提交到版本控制。出于安全原因,git 会忽略
.env文件。
使用 NPM 运行
使用 Node.js 启动服务器:
node dist/index.js对于 sse 传输:
node dist/sse.js使用 Docker 运行
构建 Docker 镜像(如果还没有):
docker build -t tavily-search-mcp-server:latest .使用以下命令运行 Docker 容器:
对于 stdio 传输:
docker run -it --rm -e TAVILY_API_KEY="your_api_key_here" tavily-search-mcp-server:latest对于 sse 传输:
docker run -it --rm -p 3001:3001 -e TAVILY_API_KEY="your_api_key_here" -e TRANSPORT="sse" tavily-search-mcp-server:latest您还可以直接利用 shell 的环境变量,这是一种更安全的做法:
docker run -it --rm -p 3001:3001 -e TAVILY_API_KEY=$TAVILY_API_KEY -e TRANSPORT="sse" tavily-search-mcp-server:latest**注意:**第二条命令演示了推荐使用
-e TAVILY_API_KEY=$TAVILY_API_KEY的方法,将TAVILY_API_KEY环境变量的值传递到 Docker 容器中。这样可以使您的 API 密钥不出现在命令历史记录中,通常比在命令中硬编码密钥更受欢迎。使用 docker compose
跑步:
docker compose up -d要停止服务器:
docker compose down
执照
此 MCP 服务器采用 MIT 许可证。这意味着您可以自由使用、修改和分发该软件,但须遵守 MIT 许可证的条款和条件。更多详情,请参阅项目仓库中的 LICENSE 文件。
Available Tools
1 tooltavily_searchA
Performs a web search using the Tavily Search API, optimized for LLMs. Use this for broad information gathering, recent events, or when you need diverse web sources. Supports search depth, topic selection, time range filtering, and domain inclusion/exclusion.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | The search query. | |
| search_depth | No | The depth of the search. It can be "basic" or "advanced". | basic |
| topic | No | The category of the search. Currently: only "general" and "news" are supported. | general |
| days | No | The number of days back from the current date to include in the search results (for news topic). | |
| time_range | No | The time range back from the current date to include in the search results. Accepted values include "day","week","month","year" or "d","w","m","y". | |
| max_results | No | The maximum number of search results to return. | |
| include_images | No | Include a list of query-related images in the response. | |
| include_image_descriptions | No | When include_images is set to True, this option adds descriptive text for each image. | |
| include_answer | No | Include a short answer to original query, generated by an LLM based on Tavily's search results. | |
| include_raw_content | No | Include the cleaned and parsed HTML content of each search result. | |
| include_domains | No | A list of domains to specifically include in the search results. | |
| exclude_domains | No | A list of domains to specifically exclude from the search results. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the tool is 'optimized for LLMs' and supports various features like search depth and filtering, which adds useful context. However, it doesn't cover important behavioral aspects such as rate limits, authentication needs, error handling, or what the output looks like (especially since there's no output schema).
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is appropriately sized and front-loaded: the first sentence states the core purpose, followed by usage guidelines and key features. Every sentence earns its place by adding value without redundancy, making it efficient and well-structured.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity (12 parameters, no annotations, no output schema), the description is somewhat complete but has gaps. It covers purpose and usage well, but lacks details on output format, error cases, or operational constraints like rate limits. For a tool with rich input schema but no output schema, more behavioral context would be beneficial.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description mentions that the tool 'supports search depth, topic selection, time range filtering, and domain inclusion/exclusion,' which aligns with some parameters in the schema. However, with 100% schema description coverage, the schema already documents all 12 parameters thoroughly. The description adds minimal value beyond what the schema provides, meeting the baseline for high coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool 'performs a web search using the Tavily Search API, optimized for LLMs,' which specifies the verb (performs web search), resource (Tavily Search API), and target audience (LLMs). It distinguishes itself by mentioning optimization for LLMs, though without sibling tools, full differentiation cannot be assessed.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context for when to use the tool: 'for broad information gathering, recent events, or when you need diverse web sources.' This gives explicit guidance on appropriate use cases. However, it lacks exclusions or alternatives, which would be needed for a perfect score.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
1 tool update
v1.0.0- First observed
tavily_search
TDQS
Scored across 1 tool
With only one tool, there is no possibility of ambiguity or overlap between tools. The single tool 'tavily_search' has a clear, distinct purpose focused on web search functionality.
A single tool inherently has perfect naming consistency, as there are no other tools to compare it against. The name 'tavily_search' follows a clear and descriptive pattern.
One tool is too few for a server with a broad purpose like web search, as it lacks complementary operations such as filtering results, managing search history, or handling different search types. This minimal scope limits agent workflows and feels incomplete.
The tool surface is severely incomplete for a web search domain; it only provides a basic search function without supporting operations like refining searches, saving results, or accessing search metadata. This creates significant gaps that will hinder agent effectiveness.
Maintenance
Related MCP Connectors
An MCP server that gives your AI access to the source code and docs of all public github repos
Driflyte MCP server which lets AI assistants query topic-specific knowledge from web and GitHub.
Related MCP Servers
- FlicenseCqualityDmaintenanceAn MCP protocol server that enables web search functionality using the Tavily API, allowing AI assistants to perform internet searches in real-time.44-
- AlicenseNot gradedqualityDmaintenanceMCP server for using various search tools like Tavily API. Planning to support various search tools (i.e. wiki search, searxng, etc)3MIT
- FlicenseNot gradedqualityDmaintenanceAn MCP server that enables web search and document retrieval capabilities through Tavily API and LangConnect vector database, supporting AI agents in gathering information for comprehensive report generation.23-
- FlicenseBqualityDmaintenanceMCP server using Tavily API for web search, enabling web search queries via stdio transport.5-