Claude网络搜索服务

Claude网络搜索服务

一个MCP服务器,让你的Claude Cline以及Langchain实现网络搜索功能。

MCP2Tavily快速入门

前置要求

  • Python 3.11+
  • UV包管理器
  • Tavily API密钥

安装步骤

  1. 克隆仓库并进入目录
  2. 创建.env文件并添加Tavily API密钥:TAVILY_API_KEY=你的密钥
  3. 使用UV设置虚拟环境:
    • uv venv
    • source .venv/bin/activate(Windows: .venv\Scripts\activate
  4. 安装依赖:uv sync

使用方法

作为Claude扩展安装

fastmcp install mcp2tavily.py

开发模式使用MCP检查器

fastmcp dev mcp2tavily.py

然后访问:http://localhost:5173

Cline Continue Claude手动配置

在MCP JSON文件中添加:

"mcp2tavily": {
  "command": "uv",
  "args": [
    "run",
    "--with",
    "fastmcp",
    "--with",
    "python-dotenv",
    "--with",
    "tavily-python",
    "fastmcp",
    "run",
    "你的真实路径\\mcp2tavily.py"
  ],
  "env": {
    "TAVILY_API_KEY": "API密钥"
  }
}

可用工具

  • search_web(query: str): 使用Tavily API搜索网络
  • search_web_info(query: str): 同上,带中文描述