这是一个允许您通过调用 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 (字符串):搜索查询。
要通过 Smithery 自动安装 npm-search 到 Claude Desktop:
npx -y @smithery/cli install npm-search-mcp-server --client claude
或者,您可以通过 npm 安装 npm-search-mcp-server:
npm install -g npm-search-mcp-server
安装后,可以使用以下命令运行它:
npm-search-mcp-server
当使用 uv 时,不需要特定的安装步骤。我们将使用 uvx 直接运行 npm-search-mcp-server。
在您的 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 设置 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>
{
"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
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 文件。