返回市场
npm搜索MCP服务器

npm搜索MCP服务器

作者:btwiuse15 星标更新:2025-05-16

项目介绍

MseeP.ai 安全评估徽章

npm-search MCP 服务器

smithery 徽章

这是一个允许您通过调用 npm search 命令来搜索 npm 包的 Model Context Protocol 服务器。

<a href="https://glama.ai/mcp/servers/yeb3luefvf"><img width="380" height="200" src="https://gips3.baidu.com/it/u=3267408599,1459200887&fm=3081&app=3081&f=PNG?w=760&h=400" alt="npm-search-mcp-server MCP 服务器" /></a>

可用工具

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

Claude 截图

安装

通过 Smithery 安装

要通过 Smithery 自动安装 npm-search 到 Claude Desktop:

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

配置

针对 Claude.app 的配置

在您的 Claude 设置中添加:

<details> <summary>使用 npm 安装</summary>
"mcpServers": {
  "npm-search": {
    "command": "npx",
    "args": ["-y", "npm-search-mcp-server"]
  }
}
</details> <details> <summary>使用 uvx</summary>
"mcpServers": {
  "npm-search": {
    "command": "uvx",
    "args": ["npm-search-mcp-server"]
  }
}
</details>

针对 Zed 的配置

在您的 Zed 设置 json 中添加:

<details> <summary>使用 npm 安装</summary>
"context_servers": {
  "npm-search-mcp-server": {
    "command": "npx",
    "args": ["-y", "npm-search-mcp-server"]
  }
},
</details> <details> <summary>使用 uvx</summary>
"context_servers": [
  "npm-search-mcp-server": {
    "command": "uvx",
    "args": ["npm-search-mcp-server"]
  }
],
</details>

示例交互

  1. 搜索 npm 包:
{
  "name": "search_npm_packages",
  "arguments": {
    "query": "express"
  }
}

响应:

{
  "results": [
    {
      "name": "express",
      "description": "快速、不带偏见、极简的 Web 框架",
      "version": "4.17.1",
      "author": "TJ Holowaychuk",
      "license": "MIT"
    },
    ...
  ]
}

调试

您可以使用 MCP 检查器来调试服务器。对于 uvx 安装:

npx @modelcontextprotocol/inspector npx -y npm-search-mcp-server

或者如果您已将包安装到特定目录或正在开发它:

cd path/to/servers/src/npm-search
npx @modelcontextprotocol/inspector uv run npm-search-mcp-server

对 Claude 的问题示例

  1. "在 npm 上搜索 express 包"
  2. "查找与 react 相关的包"
  3. "显示用于 Web 开发的 npm 包"

构建

Docker 构建:

cd src/npm-search
docker build -t mcp/npm-search .

贡献

我们鼓励贡献以帮助扩展和改进 npm-search-mcp-server。无论您想添加新的 npm 相关工具,增强现有功能,还是改进文档,您的意见都是宝贵的。

有关其他 MCP 服务器和实现模式的示例,请参阅: https://github.com/modelcontextprotocol/servers

欢迎提交拉取请求!请自由地提出新想法、修复错误或增强功能,使 npm-search-mcp-server 更加强大和有用。

许可证

npm-search-mcp-server 在 MIT 许可证下发布。这意味着您可以自由使用、修改和分发该软件,但须遵守 MIT 许可证中的条款和条件。更多详情,请参阅项目存储库中的 LICENSE 文件。