Labsco
btwiuse logo

NPM Search

โ˜… 16

from btwiuse

Search for npm packages

๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeAdvanced setup

MseeP.ai Security Assessment Badge

npm-search MCP Server

smithery badge

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

npm-search-mcp-server MCP server

Available Tools

  • search_npm_packages - Search for npm packages.
    • Required arguments:
      • query (string): The search query.

Claude Screenshot

Example Interactions

  1. Search for npm packages:
{
  "name": "search_npm_packages",
  "arguments": {
    "query": "express"
  }
}

Response:

{
  "results": [
    {
      "name": "express",
      "description": "Fast, unopinionated, minimalist web framework",
      "version": "4.17.1",
      "author": "TJ Holowaychuk",
      "license": "MIT"
    },
    ...
  ]
}

Debugging

You can use the MCP inspector to debug the server. For uvx installations:

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

Or if you've installed the package in a specific directory or are developing on it:

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

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:

# Build the image
docker build -t mcp/npm-search .

# Run the container (default port 3009)
docker run -p 3009:3009 mcp/npm-search

# Run with custom port via environment variable
docker run -p 3009:3009 -e PORT=3009 mcp/npm-search

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:

services:
  npm-search-mcp:
    build: .
    ports:
      - "3009:3009"
    environment:
      PORT: 3009