Labsco
rakeshmenon logo

NPMLens MCP

from rakeshmenon

NPMLens MCP lets your coding agent (such as Claude, Cursor, Copilot, Gemini or Codex) search the npm registry and fetch package context (README, downloads, GitHub info, usage snippets). It acts as a Model‑Context‑Protocol (MCP) server, giving your AI assistant a structured way to discover libraries and integrate them quickly.

🔥🔥🔥✓ VerifiedFreeQuick setup
NPMLens MCP Logo

NPMLens MCP

npm downloads

npmlens-mcp lets your coding agent (such as Claude, Cursor, Copilot, Gemini or Codex) search the npm registry and fetch package context (README, downloads, GitHub info, usage snippets). It acts as a Model‑Context‑Protocol (MCP) server, giving your AI assistant a structured way to discover libraries and integrate them quickly.

Key features

  • Structured npm search with optional ranking weights.
  • Direct README fetch (optionally truncated).
  • Enriched package info (downloads + GitHub details).
  • Usage snippet extraction from README.
  • Stdio MCP transport, ready for MCP‑compatible clients.

Disclaimers

npmlens-mcp performs network requests to npm and GitHub when tools are used. Avoid sharing secrets in prompts; set GITHUB_TOKEN only if you want higher GitHub rate limits.

Tools

Below are the tools exposed by NPMLens MCP. For full JSON schemas, see the Tool reference.

Core Search & Information

  • search_npm

    • Search the npm registry with optional ranking weights.
    • Args: query (string, required), size (1..250), from (offset), weights (object with quality, popularity, maintenance).
    • Returns: { total, results[] } where each result includes name, version, description, links, score, etc.
  • search_by_keywords

    • Search npm packages by specific keywords/tags with AND/OR operators.
    • Args: keywords (array of strings, required), operator (AND | OR, default AND), size (1..250).
    • Returns: Same as search_npm.
    • Example: Find packages with "react" AND "hooks" AND "typescript".
  • get_readme

    • Fetch README markdown for a package (optionally by version).
    • Args: name (string, required), version (string), truncateAt (number).
    • Returns: JSON metadata (name, version, repository, homepage) and the README as text content.
  • get_package_info

    • Enriched package info combining registry metadata, npm downloads, and GitHub details.
    • Args: name (string, required), version (string), includeReadme (boolean).
    • Returns: name, version, repository, homepage, github{ fullName, url, stars, forks, license }, downloadsLastWeek, and optional readme.
  • get_usage_snippet

    • Extract a likely usage snippet from a package README.
    • Args: name (string, required), version (string).
    • Returns: { snippet: { language, code, heading } }.

Version & Dependency Analysis

  • get_package_versions

    • List all available versions of a package with publish dates and dist tags.
    • Args: name (string, required), limit (number), since (string - ISO date or relative like "6 months").
    • Returns: { name, versions[] } where each version includes version, date, tags[].
    • Example: "Show me all React versions from the last year".
  • get_package_dependencies

    • Get the dependency tree for a package.
    • Args: name (string, required), version (string), depth (1-3, default 1), includeDevDependencies (boolean).
    • Returns: { name, version, dependencies[], devDependencies[] } with name and version range for each dependency.
    • Example: "What dependencies does express have?".

Metrics & Comparison

  • get_downloads

    • Fetch npm downloads for the last day/week/month.
    • Args: name (string, required), period (day | week | month, default week).
    • Returns: { downloads, start, end, package }.
  • compare_packages

    • Compare multiple npm packages side-by-side.
    • Args: packages (array of 1-10 package names, required).
    • Returns: Array of comparison data with name, version, description, downloads, stars, forks, license, repository, homepage, and optional error.
    • Fetches all packages in parallel for performance.
    • Example: "Compare react-query, swr, and apollo-client".