Skip to main content
Glama

MCP Tavily

MCP塔维利

中文詳細

Tavily API 的模型上下文协议 (MCP) 服务器实现,提供高级搜索和内容提取功能。

特征

  • 多种搜索工具
    • search :具有可自定义选项的基本搜索功能
    • searchContext :上下文感知搜索,提高相关性
    • searchQNA :以问题和答案为重点的搜索
  • 内容提取:使用可配置选项从 URL 中提取内容
  • 丰富的配置选项:搜索深度、过滤和内容包含的广泛选项

与 MCP 一起使用

将 Tavily MCP 服务器添加到您的 MCP 配置中:

{ "mcpServers": { "tavily": { "command": "npx", "args": ["-y", "@mcptools/mcp-tavily"], "env": { "TAVILY_API_KEY": "your-api-key" } } } }

注意:请确保将your-api-key替换为你的实际 Tavily API 密钥。你也可以在运行服务器之前将其设置为环境变量TAVILY_API_KEY

API 参考

搜索工具

服务器提供了三种可以通过MCP调用的搜索工具:

1. 基本搜索
// Tool name: search { query: "artificial intelligence", options: { searchDepth: "advanced", topic: "news", maxResults: 10 } }
2. 上下文搜索
// Tool name: searchContext { query: "latest developments in AI", options: { topic: "news", timeRange: "week" } }
3. 问答搜索
// Tool name: searchQNA { query: "What is quantum computing?", options: { includeAnswer: true, maxResults: 5 } }

提取工具

// Tool name: extract { urls: ["https://example.com/article1", "https://example.com/article2"], options: { extractDepth: "advanced", includeImages: true } }

搜索选项

所有搜索工具都具有以下选项:

interface SearchOptions { searchDepth?: "basic" | "advanced"; // Search depth level topic?: "general" | "news" | "finance"; // Search topic category days?: number; // Number of days to search maxResults?: number; // Maximum number of results includeImages?: boolean; // Include images in results includeImageDescriptions?: boolean; // Include image descriptions includeAnswer?: boolean; // Include answer in results includeRawContent?: boolean; // Include raw content includeDomains?: string[]; // List of domains to include excludeDomains?: string[]; // List of domains to exclude maxTokens?: number; // Maximum number of tokens timeRange?: "year" | "month" | "week" | "day" | "y" | "m" | "w" | "d"; // Time range for search }

提取选项

interface ExtractOptions { extractDepth?: "basic" | "advanced"; // Extraction depth level includeImages?: boolean; // Include images in results }

响应格式

所有工具都以以下格式返回响应:

{ content: Array<{ type: "text", text: string }> }

对于搜索结果,每项包括:

  • 标题
  • 内容
  • 网址

对于提取的内容,每项包括:

  • 网址
  • 原始内容
  • 失败的 URL 列表(如果有)

错误处理

所有工具都包含适当的错误处理,如果出现问题,将会抛出描述性错误消息。

安装

通过 Smithery 安装

要通过Smithery自动为 Claude Desktop 安装 Tavily API 服务器:

npx -y @smithery/cli install @kshern/mcp-tavily --client claude

手动安装

npm install @mcptools/mcp-tavily

或者直接通过 npx 使用:

npx @mcptools/mcp-tavily

先决条件

  • Node.js 16 或更高版本
  • npm 或 yarn
  • Tavily API 密钥(从Tavily获取)

设置

  1. 克隆存储库
  2. 安装依赖项:
npm install
  1. 设置您的 Tavily API 密钥:
export TAVILY_API_KEY=your_api_key

建筑

npm run build

使用 MCP Inspector 进行调试

对于开发和调试,我们建议使用MCP Inspector ,它是 MCP 服务器的强大开发工具。

检查器提供了以下用户界面:

  • 测试工具调用
  • 查看服务器响应
  • 调试工具执行
  • 监控服务器状态

贡献

欢迎贡献代码!欢迎提交 Pull 请求。

  1. 分叉存储库
  2. 创建你的功能分支( git checkout -b feature/AmazingFeature
  3. 提交您的更改( git commit -m 'Add some AmazingFeature'
  4. 推送到分支( git push origin feature/AmazingFeature
  5. 打开拉取请求

执照

该项目已获得 MIT 许可。

支持

如有任何疑问或问题:

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

模型上下文协议服务器使用 Tavily API 实现高级搜索和内容提取,具有丰富的自定义和集成选项。

  1. 特征
    1. 与 MCP 一起使用
  2. API 参考
    1. 搜索工具
    2. 提取工具
    3. 搜索选项
    4. 提取选项
  3. 响应格式
    1. 错误处理
      1. 安装
        1. 通过 Smithery 安装
        2. 手动安装
        3. 先决条件
        4. 设置
        5. 建筑
      2. 使用 MCP Inspector 进行调试
        1. 贡献
          1. 执照
            1. 支持

              Related MCP Servers

              • A
                security
                A
                license
                A
                quality
                A Model Context Protocol (MCP) server that provides search and crawl functionality using Search1API.
                Last updated -
                5
                206
                111
                TypeScript
                MIT License
                • Apple
              • A
                security
                A
                license
                A
                quality
                A Model Context Protocol server that provides web content fetching and conversion capabilities.
                Last updated -
                4
                89
                2
                JavaScript
                MIT License
                • Apple
              • -
                security
                A
                license
                -
                quality
                "primitive" RAG-like web search model context protocol server that runs locally. ✨ no APIs ✨
                Last updated -
                43
                Python
                MIT License
                • Linux
                • Apple
              • -
                security
                A
                license
                -
                quality
                A Model Context Protocol server that enables web search, scraping, crawling, and content extraction through multiple engines including SearXNG, Firecrawl, and Tavily.
                Last updated -
                35
                11
                TypeScript
                MIT License

              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/kshern/mcp-tavily'

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