Get the FREE Ultimate OpenClaw Setup Guide →

npmjs

MCP server from yiannis-spyridakis/npmjs-mcp-server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio yiannis-spyridakis-npmjs-mcp-server node dist/index.js

How to use

This MCP server provides structured npm package metadata for use by LLMs and AI-assisted tooling. It exposes a set of tools to fetch quick package summaries, full version histories, and download statistics, all formatted in a consistent JSON structure suitable for reasoning, planning, and data extraction. The server runs as a child process and communicates via the MCP protocol over stdin/stdout, allowing an orchestrator or agent to request package data and receive a predictable payload in response.

Available tools include: get_npm_package_summary (essential package details like latest version, description, license, homepage, and repository URL), get_npm_package_versions (all published versions with their publish dates), get_npm_package_downloads (download counts for a specified period or all default periods), and get_npm_package_details (comprehensive data including maintainers and keywords). Prompts such as get_summary_prompt and get_details_prompt help generate standardized requests for these tools. When integrated into an agent, you can query npmjs package data for use in documentation, risk assessments, or feature planning, then weave the results into your workflows or AI-generated responses.

How to install

Prerequisites:

  • Node.js (12.x or newer) and npm
  • Access to the project repository (git)

Installation steps:

  1. Clone the repository git clone https://github.com/yiannis-spyridakis/npmjs-mcp-server.git cd npmjs-mcp-server

  2. Install dependencies npm install

  3. Development run (with automatic restarts on file changes) npm run dev

  4. Build for production (compile TypeScript to JavaScript) npm run build

    Outputs to the dist/ directory

  5. Run in production npm start

    This will execute node dist/index.js as the MCP server process

Notes:

  • The repo uses ts-node and nodemon for development workflows. If you prefer a single-run workflow without watching for changes, you can use npm run watch.
  • Ensure any environment-specific configuration is set via environment variables if needed by your deployment environment.

Additional notes

Tips and considerations:

  • The server is designed to be consumed by MCP clients via stdin/stdout. Ensure the client properly handles the MCP response envelope and parses the data.content[0].text JSON payload.
  • If you plan to deploy in a container or cloud environment, consider wiring the process with a supervisor to automatically restart on failures.
  • Validate network access to npm registry APIs if you enable any additional features or caching beyond the provided tools.
  • If you introduce authentication or rate-limiting, document the required environment variables (e.g., API keys) in the env section for the server. Common issues include npm registry rate limits or network restrictions in restricted environments.

Related MCP Servers

Sponsor this space

Reach thousands of developers