home / mcp / npm-search mcp server
Provides a server to search npm packages by running the npm search command through MCP with HTTP or stdio transport and health/session management.
Configuration
View docs{
"mcpServers": {
"btwiuse-npm-search-mcp-server": {
"command": "npm-search-mcp-server",
"args": [],
"env": {
"PORT": "3009"
}
}
}
}You can run the npm-search MCP Server to search npm packages by issuing the npm search command through the MCP interface. It supports multiple transport modes, logs its activity, and provides health and session management features to keep interactions reliable and observable.
You interact with the npm-search MCP Server through an MCP client by calling the search tool to query npm packages. Start the server using a local command or via uvx, then issue a tool call with the query you want. The server handles the command, streams results when you use a streaming transport, and returns a structured list of matching packages with their metadata.
Prerequisites you need before installation: Node.js and npm (for installing the npm package) or uvx (for running through the UV runtime). Ensure you have access to a shell with internet connectivity to install dependencies.
Install the MCP server package globally with npm:
npm install -g npm-search-mcp-serverRun the MCP server directly after installation:
npm-search-mcp-serverAlternatively, you can run the server through uvx without a separate installation step for the MCP server itself. This uses uvx to execute the npm-search-mcp-server binary directly.
uvx npm-search-mcp-serverTransport and port configuration: The server supports HTTP transport when a PORT environment variable is set. The default behavior is to expose HTTP endpoints for MCP operations, including the main MCP endpoint and a health check endpoint.
Environment variable you may configure when using HTTP transport:
PORT=3009If you run the server in Docker, you can expose HTTP transport by setting PORT. The server provides the following MCP-related endpoints when exposed over HTTP:
- POST /mcp for the main MCP calls and session initialization - GET /mcp for an SSE stream of responses (requires a session ID) - DELETE /mcp to terminate a session - GET /health to check service status and active sessions
Search for npm packages using the npm search command. Requires the query argument to specify what you are looking for.