Back to MCP directory
publicPublicdnsLocal runtime

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

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client