mcp-tavily-搜索
⚠️ 通知
此存储库不再维护。
该工具的功能现已在mcp-omnisearch中提供,它将多个 MCP 工具组合在一个统一的包中。
请改用mcp-omnisearch 。
一个模型上下文协议 (MCP) 服务器,用于集成 Tavily 的搜索 API 与 LLM。该服务器提供智能网页搜索功能,并针对高质量、真实的搜索结果进行了优化,包括为 RAG 应用程序生成上下文和直接问答。
特征
- 🔍 通过 Tavily API 实现高级网页搜索功能
- 🤖 AI 生成的搜索结果摘要
- 🎯 域名过滤,获得更高质量的结果
- 📊 可配置的搜索深度和参数
- 🧠 RAG 应用程序的上下文生成
- ❓ 直接问答功能
- 💾 支持 TTL 的响应缓存
- 📝 多种响应格式(文本、JSON、markdown)
- 🔄 针对法学硕士 (LLM) 优化的结构化结果格式
- 🏗️ 基于模型上下文协议
配置
此服务器需要通过您的 MCP 客户端进行配置。以下是不同环境的示例:
克莱恩配置
将其添加到您的 Cline MCP 设置中:
带有 WSL 配置的 Claude 桌面
对于 WSL 环境,将其添加到您的 Claude Desktop 配置中:
环境变量
服务器需要以下环境变量:
TAVILY_API_KEY
:您的 Tavily API 密钥(必需)
API
该服务器实现了三个具有可配置参数的 MCP 工具:
tavily_search
使用 Tavily Search API 搜索网络,针对高质量、真实的结果进行了优化。
参数:
query
(字符串,必需):搜索查询search_depth
(字符串,可选):"basic"(更快)或 "advanced"(更全面)。默认为 "basic"topic
(字符串,可选):"general" 或 "news"。默认为 "general"days
(数字,可选):返回搜索的天数(仅限新闻主题)。默认为 3time_range
(字符串,可选):结果的时间范围('day'、'week'、'month'、'year' 或 'd'、'w'、'm'、'y')max_results
(number,可选):最大结果数。默认为 5include_answer
(布尔值,可选):包含 AI 生成的摘要。默认为 trueinclude_images
(布尔值,可选):包含相关图片。默认为 falseinclude_image_descriptions
(布尔值,可选):包含图片描述。默认为 falseinclude_raw_content
(布尔值,可选):包含原始 HTML 内容。默认为 falseinclude_domains
(string[],可选):要包含的受信任域列表exclude_domains
(string[],可选):要排除的域列表response_format
(字符串,可选):'text'、'json' 或 'markdown'。默认为 'text'cache_ttl
(number,可选):缓存生存时间(秒)。默认为 3600force_refresh
(boolean, 可选): 强制刷新结果,忽略缓存。默认为 false
tavily_get_search_context
使用 Tavily 搜索为 RAG 应用程序生成上下文。
参数:
query
(字符串,必需):用于上下文生成的搜索查询max_tokens
(数字,可选):生成上下文的最大长度。默认为 2000search_depth
(字符串,可选):“basic” 或 “advanced”。默认为 “advanced”topic
(字符串,可选):"general" 或 "news"。默认为 "general"- 其他参数与tavily_search相同
tavily_qna_search
使用 Tavily 搜索直接获得问题的答案。
参数:
query
(字符串,必需):要回答的问题include_sources
(布尔值,可选):包含来源引用。默认为 truesearch_depth
(字符串,可选):“basic” 或 “advanced”。默认为 “advanced”topic
(字符串,可选):"general" 或 "news"。默认为 "general"- 其他参数与tavily_search相同
域名过滤
服务器通过两个可选参数支持灵活的域名过滤:
include_domains
:要包含在搜索结果中的受信任域的数组exclude_domains
:从搜索结果中排除的域数组
这允许您:
- 针对学术或技术搜索的特定可信来源
- 排除可能不可靠或不相关的来源
- 根据您的特定需求定制来源
- 未指定过滤时访问所有可用源
域过滤示例:
发展
设置
- 克隆存储库
- 安装依赖项:
- 构建项目:
- 以开发模式运行:
出版
该项目使用变更集进行版本管理。要发布:
- 创建变更集:
- 对包进行版本控制:
- 发布到 npm:
贡献
欢迎贡献代码!欢迎提交 Pull 请求。
执照
MIT 许可证 - 有关详细信息,请参阅LICENSE文件。
致谢
- 基于模型上下文协议
- 由Tavily Search API提供支持
Related MCP Servers
- AsecurityAlicenseAqualityAn MCP server implementation that integrates the Tavily Search API, providing optimized search capabilities for LLMs.Last updated -1TypeScriptMIT License
- -securityAlicense-qualityEnables integration with DuckDuckGo search capabilities for LLMs, supporting comprehensive web search, regional filtering, result types, and safe browsing with caching and customizable search parameters.Last updated -262TypeScriptMIT License
- AsecurityAlicenseAqualityEnables efficient web search integration with Jina.ai's Search API, offering clean, LLM-optimized content retrieval with support for various content types and configurable caching.Last updated -1223JavaScriptMIT License
- -securityFlicense-qualityEnables LLMs to perform sophisticated web searches through proxy servers using Tavily's API, supporting comprehensive web searches, direct question answering, and recent news article retrieval with AI-extracted content.Last updated -1Python
Appeared in Searches
- Local Health Risk and Safety Guidance for COVID-19, Flu, RSV, and Other Illnesses in the US
- Clearbit tools for company data enrichment, prospecting, and website visitors analysis
- A server for discovering and supporting local restaurants, shops, and services
- Resources or tools for conducting deep research
- Information about disinformation