npm-search MCP Server
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
A Model Context Protocol server that allows you to search for npm packages by calling the npm search command.
**Features:**
- Search npm packages using the npm search command
- Supports both stdio and HTTP (streamable-http) transport modes
- HTTP mode automatically enabled when PORT environment variable is set
- Structured logging with Pino
- Graceful shutdown handling
- Health check endpoint (/health)
- Session management for HTTP transport
Available Tools
- search_npm_packages - Search for npm packages.
- Required arguments:
- query (string): The search query.
Installation
Installing via Smithery
To install npm-search for Claude Desktop automatically via Smithery:
Using NPM (recommended)
Alternatively you can install npm-search-mcp-server via npm:
After installation, you can run it as a command using:
Using uv
When using uv no specific installation is needed. We will
use uvx to directly run *npm-search-mcp-server*.
Configuration
Configure for Claude.app
Add to your Claude settings:
Using npm installation
Using uvx
Configure for Zed
Add to your Zed settings.json:
Using npm installation
Using uvx
Example Interactions
1. Search for npm packages:
Response:
Debugging
You can use the MCP inspector to debug the server. For uvx installations:
Or if you've installed the package in a specific directory or are developing on it:
Examples of Questions for Claude
1. "Search for express package on npm"
2. "Find packages related to react"
3. "Show me npm packages for web development"
Docker
The server can be run in a Docker container with HTTP transport support:
The Docker image uses HTTP transport when the PORT environment variable is set. The server exposes:
- POST /mcp - Main MCP endpoint for tool calls and session initialization
- GET /mcp - SSE stream endpoint for streaming responses (requires session ID)
- DELETE /mcp - Session termination endpoint
- GET /health - Health check endpoint with service status and active session count
For Docker Compose integration:
Contributing
We encourage contributions to help expand and improve npm-search-mcp-server. Whether you want to add new npm-related tools, enhance existing functionality, or improve documentation, your input is valuable.
For examples of other MCP servers and implementation patterns, see:
https://github.com/modelcontextprotocol/servers