npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@mcptools/mcp-tavily

v1.0.0

Published

A Model Context Protocol (MCP) server implementation for Tavily API, providing advanced search and content extraction capabilities

Readme

MCP Tavily

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

功能特点

  • 多样化搜索工具:
    • search: 基础搜索功能,支持自定义选项
    • searchContext: 上下文感知搜索,提供更好的相关性
    • searchQNA: 问答式搜索
  • 内容提取: 支持从URL提取内容,可配置提取选项
  • 丰富的配置选项: 支持搜索深度、过滤和内容包含等多种配置

MCP配置使用

在你的MCP配置中添加Tavily服务器:

{
  "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. 基础搜索

// 工具名称: search
{
  query: "人工智能",
  options: {
    searchDepth: "advanced",
    topic: "news",
    maxResults: 10
  }
}

2. 上下文搜索

// 工具名称: searchContext
{
  query: "AI最新发展",
  options: {
    topic: "news",
    timeRange: "week"
  }
}

3. 问答搜索

// 工具名称: searchQNA
{
  query: "什么是量子计算?",
  options: {
    includeAnswer: true,
    maxResults: 5
  }
}

内容提取工具

// 工具名称: extract
{
  urls: ["https://example.com/article1", "https://example.com/article2"],
  options: {
    extractDepth: "advanced",
    includeImages: true
  }
}

搜索选项

所有搜索工具共享以下选项:

interface SearchOptions {
  searchDepth?: "basic" | "advanced";    // 搜索深度级别
  topic?: "general" | "news" | "finance"; // 搜索主题类别
  days?: number;                         // 搜索天数范围
  maxResults?: number;                   // 最大结果数量
  includeImages?: boolean;               // 是否包含图片
  includeImageDescriptions?: boolean;    // 是否包含图片描述
  includeAnswer?: boolean;               // 是否包含答案
  includeRawContent?: boolean;           // 是否包含原始内容
  includeDomains?: string[];            // 包含的域名列表
  excludeDomains?: string[];            // 排除的域名列表
  maxTokens?: number;                    // 最大token数量
  timeRange?: "year" | "month" | "week" | "day" | "y" | "m" | "w" | "d"; // 时间范围
}

提取选项

interface ExtractOptions {
  extractDepth?: "basic" | "advanced";   // 提取深度级别
  includeImages?: boolean;               // 是否包含图片
}

响应格式

所有工具返回的响应格式如下:

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

搜索结果包含:

  • 标题
  • 内容
  • URL

提取内容包含:

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

错误处理

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

许可证

本项目基于MIT许可证开源。

支持

如有任何问题:

安装

通过 Smithery 安装

通过 Smithery 自动安装 Tavily API Server for Claude Desktop:

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 服务器开发工具。

Inspector 提供了以下功能的用户界面:

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

贡献

欢迎提交贡献!请随时提交 Pull Request。

  1. Fork 仓库
  2. 创建特性分支 (git checkout -b feature/AmazingFeature)
  3. 提交更改 (git commit -m '添加某个特性')
  4. 推送到分支 (git push origin feature/AmazingFeature)
  5. 开启 Pull Request

License

MIT License。

支持

如有任何问题,请参考: