返回 MCP 目录
public公开dns本地运行

npm-search-mcp-server

一个通过MCP协议提供npm包搜索功能的服务器

article

README

🚀 npm 搜索 MCP 服务器

这是一个基于模型上下文协议 (Model Context Protocol) 的服务器,允许你通过调用 npm search 命令来搜索 npm 包,为开发者提供便捷的包搜索服务。

smithery badge

🚀 快速开始

本服务器可帮助你轻松搜索 npm 包,下面为你介绍它的相关信息。

✨ 主要特性

  • 提供 search_npm_packages 工具,可用于搜索 npm 包。
  • 支持多种安装方式,如使用 Smithery、NPM 或 uv。
  • 可配置为 Claude.app 和 Zed 使用。

📦 安装指南

使用 Smithery 进行安装

通过 Smithery 自动为 Claude Desktop 安装 npm 搜索:

npx -y @smithery/cli install npm-search-mcp-server --client claude

使用 NPM(推荐)

你可以通过 npm 安装 npm-search-mcp-server

npm install -g npm-search-mcp-server

安装完成后,使用以下命令运行它:

npm-search-mcp-server

使用 uv

当使用 uv 时,无需特定安装,使用 uvx 直接运行 npm-search-mcp-server

📚 详细文档

可用工具

  • search_npm_packages - 搜索 npm 包。
    • 必要参数:
      • query (字符串):搜索查询。

Claude 截图

配置

配置为 Claude.app 使用

添加到你的 Claude 设置中:

使用 npm 安装 ```json "mcpServers": { "npm-search": { "command": "npx", "args": ["-y", "npm-search-mcp-server"] } } ```
使用 uvx ```json "mcpServers": { "npm-search": { "command": "uvx", "args": ["npm-search-mcp-server"] } } ```

配置为 Zed 使用

添加到你的 Zed settings.json 中:

使用 npm 安装 ```json "context_servers": { "npm-search-mcp-server": { "command": "npx", "args": ["-y", "npm-search-mcp-server"] } }, ```
使用 uvx ```json "context_servers": [ "npm-search-mcp-server": { "command": "uvx", "args": ["npm-search-mcp-server"] } ], ```

💻 使用示例

基础用法

搜索 npm 包:

{
  "name": "search_npm_packages",
  "arguments": {
    "query": "express"
  }
}

响应:

{
  "results": [
    {
      "name": "express",
      "description": "Fast, unopinionated, minimalist web framework",
      "version": "4.17.1",
      "author": "TJ Holowaychuk",
      "license": "MIT"
    }
  ]
}

🔧 技术细节

此工具要求以下权限:

  • 读取网络内容 - 用于连接 npm 注册表并搜索包信息。
help

运行方式说明

cloud

托管运行

托管运行通常表示这个 MCP Server 由服务方环境承载,用户一般按页面提供的连接方式或授权流程接入,不需要在本地长期启动一个 MCP 进程

  1. 打开服务方连接页
  2. 完成授权或复制端点
  3. 在 MCP 客户端中连接
terminal

本地运行 / 其它方式

本地运行通常需要用户在自己的电脑或服务器上安装依赖,把 server_config 复制到 MCP 客户端,并按 env_schema 补齐环境变量、密钥或其它配置

  1. 复制 server_config
  2. 安装所需依赖
  3. 补齐环境变量后重启客户端