Skip to main content

Tavily MCP Server 简化版

🚀 Tavily搜索MCP服务 - 为AI智能体提供网络搜索能力的简化实现

📖 简介

Tavily MCP Server简化版是一个基于FastMCP构建的轻量级搜索服务,集成了Tavily AI搜索引擎,为AI智能体提供网络搜索功能。该项目是原Tavily MCP Server的精简版本,保留了核心功能,移除了不必要的复杂性。

✨ 核心功能

  • 🔍 网络搜索 - 使用Tavily AI引擎进行网络搜索
  • 🎯 域名过滤 - 支持包含/排除特定域名
  • 🔐 API密钥验证 - 安全的API访问控制
  • 📝 日志记录 - 基本操作日志
  • 💡 简化实现 - 提供两种服务器实现方式:MCP服务器和简化版服务器

🚀 快速开始

环境配置

  1. 创建 .env 文件并配置必要的环境变量:
# Tavily API密钥 (必需)
TAVILY_API_KEY=your_tavily_api_key_here

# MCP API密钥 (必需)
MCP_API_KEY=your_mcp_api_key_here
  1. 安装依赖:
pip install -r requirements.txt

启动服务

方式1:使用MCP服务器

python -m tavily_mcp_server.server

方式2:使用简化版服务器

python fixed_server.py

🔧 使用方法

测试搜索功能

项目提供了一个测试脚本 final_test.py,可以用来测试搜索功能:

python final_test.py

该脚本会构建一个搜索请求,发送到服务器,并显示搜索结果。

手动构建请求

你也可以手动构建JSON-RPC请求并发送到服务器:

{
  "jsonrpc": "2.0",
  "method": "search",
  "params": {
    "query": "你的搜索关键词",
    "max_results": 5,
    "search_depth": "basic",
    "include_domains": [],
    "exclude_domains": []
  },
  "id": 1
}

🛠️ 项目结构

  • tavily_mcp_server/ - MCP服务器实现
    • server.py - 主服务器代码
  • fixed_server.py - 简化版服务器实现
  • final_test.py - 测试脚本
  • studio_config.json - 各平台MCP配置
  • .env - 环境变量配置

🔐 安全性

  • 服务器需要有效的API密钥验证
  • 环境变量中需要配置Tavily API密钥和MCP API密钥

📄 许可证

本项目采用 MIT 许可证。详见 LICENSE 文件。

🔗 相关链接


为AI智能体提供简单高效的搜索能力! 🚀

Metadata

Release files for tavily-mcp-server 1.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tavily-mcp-server 1.1.3
File Size Uploaded Provenance
tavily_mcp_server-1.1.3.tar.gz 9.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for tavily-mcp-server 1.1.3
File Interpreter ABI Platform
tavily_mcp_server-1.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 17.6 kB

Release files / tavily_mcp_server-1.1.3.tar.gz

Download URL tavily_mcp_server-1.1.3.tar.gz
Size 9.7 kB
Tags Source
SHA-256 checksum
How to use checksums
57644846bb18a4760684f00d9433ae0c61342d61119ca4dd1219c34297b58cd0
BLAKE2b-256 checksum
How to use checksums
71371a8a25243ef6ff6d4182ebaf38756ef450b0e4f7f573884118625122dd84
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.5

Release files / tavily_mcp_server-1.1.3-py3-none-any.whl

Download URL tavily_mcp_server-1.1.3-py3-none-any.whl
Size 7.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
57cef8187be2b2ce9e278d36f7e60caab9e20c71b1988a28fa066bbee57a0a45
BLAKE2b-256 checksum
How to use checksums
8664b22782d8150158cd7c4649a047f0a796e1372211bb53f03854650fc84289
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.5

Security for tavily-mcp-server 1.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page