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 🙏

© 2026 – Pkg Stats / Ryan Hefner

qingyan-search-mcp

v1.0.2

Published

Model Context Protocol (MCP) server that integrates Qingyan Search API capabilities.

Readme

清言搜索 MCP 服务器

这是一个基于 Model Context Protocol (MCP) 的服务器,集成了 清言搜索API 的搜索功能。

功能

工具

  • search - 使用清言搜索API执行搜索查询,支持对话上下文和自定义参数。

安装

要使用清言搜索 MCP 服务器执行搜索查询,您需要通过 npm 安装它,并在支持 MCP 协议的应用中配置它。

安装包

npm install -g qingyan-search-mcp

配置 Claude Desktop

  • 通过 +,(Mac)或 Ctrl+,(Windows)打开 Claude Desktop 设置(不要与 Claude 账号设置混淆)
  • 转到 开发者 侧边栏部分
  • 点击 编辑配置 并打开 claude_desktop_config.json 文件
  • 在配置文件的 mcpServers 字典中添加 qingyan-search 服务器
  • 重启应用
{
  "mcpServers": {
    "qingyan-search": {
      "command": "npx",
      "args": ["-y", "qingyan-search-mcp"],
      "env": {
        "QINGYAN_API_KEY": "YOUR_API_KEY",
        "QINGYAN_API_SECRET": "YOUR_API_SECRET",
        "QINGYAN_ASSISTANT_ID_SEARCH": "YOUR_ASSISTANT_ID"
      }
    }
  }
}

关于 Claude 中 MCP 配置的更多信息,请参考 这里

配置 VS Code

以下是在 VS Code 中手动配置的步骤:

通过按 Ctrl + Shift + P 并输入 Preferences: Open User Settings (JSON) 打开用户设置(JSON)文件。

{
  "mcp": {
    "inputs": [
      {
        "type": "promptString",
        "id": "apiKey",
        "description": "清言搜索 API Key",
        "password": true
      },
      {
        "type": "promptString",
        "id": "apiSecret",
        "description": "清言搜索 API Secret",
        "password": true
      },
      {
        "type": "promptString",
        "id": "assistantId",
        "description": "清言搜索助手 ID",
        "password": true
      }
    ],
    "servers": {
      "qingyan-search": {
        "command": "npx",
        "args": ["-y", "qingyan-search-mcp"],
        "env": {
          "QINGYAN_API_KEY": "${input:apiKey}",
          "QINGYAN_API_SECRET": "${input:apiSecret}",
          "QINGYAN_ASSISTANT_ID_SEARCH": "${input:assistantId}"
        }
      }
    }
  }
}

或者,您可以将其添加到工作区中的 .vscode/mcp.json 文件中,以便与他人共享配置:

{
  "inputs": [
    {
      "type": "promptString",
      "id": "apiKey",
      "description": "清言搜索 API Key",
      "password": true
    },
    {
      "type": "promptString",
      "id": "apiSecret",
      "description": "清言搜索 API Secret",
      "password": true
    },
    {
      "type": "promptString",
      "id": "assistantId",
      "description": "清言搜索助手 ID",
      "password": true
    }
  ],
  "servers": {
    "qingyan-search": {
      "command": "npx",
      "args": ["-y", "qingyan-search-mcp"],
      "env": {
        "QINGYAN_API_KEY": "${input:apiKey}",
        "QINGYAN_API_SECRET": "${input:apiSecret}",
        "QINGYAN_ASSISTANT_ID_SEARCH": "${input:assistantId}"
      }
    }
  }
}

配置 Cursor

  • 打开 Cursor 设置
  • 转到 MCP > MCP Servers
  • 点击 + Add new MCP Server
  • 输入以下内容:
    • 名称: "qingyan-search"(或您喜欢的名称)
    • 类型: "command"
    • 命令: env QINGYAN_API_KEY=YOUR_API_KEY QINGYAN_API_SECRET=YOUR_API_SECRET QINGYAN_ASSISTANT_ID_SEARCH=YOUR_ASSISTANT_ID npx -y qingyan-search-mcp

关于 Cursor 中 MCP 配置的更多信息,请参考 这里

配置 Windsurf

  • 打开 Windsurf: MCP Configuration Panel
  • 点击 Add custom server+
  • 或者直接打开 ~/.codeium/windsurf/mcp_config.json
  • 在配置文件的 mcpServers 字典中添加 qingyan-search 服务器
{
  "mcpServers": {
    "qingyan-search": {
      "command": "npx",
      "args": ["-y", "qingyan-search-mcp"],
      "env": {
        "QINGYAN_API_KEY": "YOUR_API_KEY",
        "QINGYAN_API_SECRET": "YOUR_API_SECRET",
        "QINGYAN_ASSISTANT_ID_SEARCH": "YOUR_ASSISTANT_ID"
      }
    }
  }
}

关于 Windsurf 中 MCP 配置的更多信息,请参考 这里

验证 MCP 集成

给您的智能体一个需要执行搜索的任务。例如:

使用搜索工具查找2025年最新的人工智能发展趋势,并以markdown列表形式返回结果。

[!TIP] 如果您的智能体抱怨无法打开URL或加载网页内容,请尝试添加"使用search工具"或"使用清言搜索工具"的提示。

开发

安装依赖:

npm install

构建服务器:

npm run build

开发模式(自动重新构建):

npm run watch

如果您想尝试开发版本,可以使用以下配置替代默认配置:

{
  "mcpServers": {
    "qingyan-search": {
      "command": "/path/to/qingyan-search-mcp/dist/index.js",
      "env": {
        "QINGYAN_API_KEY": "YOUR_API_KEY",
        "QINGYAN_API_SECRET": "YOUR_API_SECRET",
        "QINGYAN_ASSISTANT_ID_SEARCH": "YOUR_ASSISTANT_ID"
      }
    }
  }
}

[!NOTE] 不要忘记移除默认的清言搜索 MCP 服务器配置,以免造成混淆。

调试

由于 MCP 服务器通过 stdio 通信,调试可能具有挑战性。我们建议使用 MCP Inspector

npm run inspector

Inspector 将提供一个 URL,您可以在浏览器中访问调试工具。

工具参数

search 工具支持以下参数:

| 参数 | 类型 | 描述 | 是否必需 | |------|------|------|----------| | query | string | 搜索查询词 | 是 | | conversation_id | string | 对话ID(可选,用于维持对话上下文) | 否 | | file_list | array | 文件列表(可选,用于上传和搜索相关文件) | 否 | | meta_data | object | 元数据(可选,用于自定义搜索参数) | 否 |

环境变量

以下环境变量可用于配置服务器:

| 环境变量 | 描述 | 默认值 | |----------|------|--------| | QINGYAN_API_KEY | 清言搜索 API Key | | QINGYAN_API_SECRET | 清言搜索 API Secret | | QINGYAN_ASSISTANT_ID_SEARCH | 清言搜索助手 ID |

[!NOTE] 默认值仅供测试使用,生产环境请使用您自己的 API 凭证。