Labsco
rakeshmenon logo

PackageLens MCP

β˜… 1

from rakeshmenon

Lets your coding agent (such as Claude, Cursor, Copilot, Gemini or Codex) search package registries across multiple ecosystems (npm, PyPI, RubyGems, Crates.io, Packagist, Hex) and fetch package context (README, downloads, GitHub info, usage snippets)

πŸ”₯πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedFreeQuick setup
PackageLens MCP Logo

PackageLens MCP

npm version CI npm downloads TypeScript Node MCP Tests Coverage Lint License

packagelens-mcp lets your coding agent (such as Claude, Cursor, Copilot, Gemini or Codex) search package registries across multiple ecosystems (npm, PyPI, RubyGems, Crates.io, Packagist, Hex) and fetch package context (README, downloads, GitHub info, usage snippets). It features smart ecosystem auto-detection, so your AI can find packages without needing to specify which ecosystem to search. It acts as a Model‑Context‑Protocol (MCP) server, giving your AI assistant a structured way to discover libraries and integrate them quickly.

Supported Ecosystems

PackageLens MCP supports 6 package ecosystems with varying feature availability:

EcosystemSearchREADMEVersionsDependenciesDownloads
npmβœ…βœ…βœ…βœ…βœ…
RubyGems (Ruby)βœ…βœ…βœ…βœ…βœ…
Crates.io (Rust)βœ…βœ…βœ…βœ…βœ…
Packagist (PHP)βœ…βœ…βœ…βœ…βœ…
Hex (Elixir)βœ…βœ…βœ…βœ…βœ…
PyPI (Python)βœ…βœ…βœ…βœ…βŒ*

* PyPI does not provide an official downloads API

Key features

  • 🌟 Smart ecosystem auto-detection - Ask "Find HTTP clients" without specifying npm, PyPI, etc.
  • πŸ” Multi-ecosystem support: npm, PyPI, RubyGems, Crates.io, Packagist, Hex
  • πŸ“¦ Structured package search with optional ranking weights
  • πŸ“„ Direct README fetch (optionally truncated)
  • πŸ“Š Enriched package info (downloads + GitHub details)
  • πŸ”– Version listing and dependency analysis
  • πŸ’‘ Usage snippet extraction from README
  • πŸ”Œ Stdio MCP transport, ready for MCP‑compatible clients

Disclaimers

packagelens-mcp performs network requests to package registries (npm, PyPI, RubyGems, Crates.io, Packagist, Hex) and GitHub when tools are used. Avoid sharing secrets in prompts; set GITHUB_TOKEN only if you want higher GitHub rate limits.

Tools

PackageLens MCP provides 8 tools with automatic ecosystem detection. For full JSON schemas, see the Tool reference.

The main tool you'll use for finding packages. It automatically detects which package ecosystem to search based on your project or query.

Detection Strategy:

  1. Query keywords - Detects language mentions (Python, Rust, JavaScript, etc.)
  2. Codebase analysis - Checks current directory for package files (package.json β†’ npm, Cargo.toml β†’ Crates.io, etc.)
  3. User clarification - If still unclear, asks for specification

Args: query, ecosystem?, packageName?, size?

Important: Once an ecosystem is detected, the response includes a directive to use ecosystem="..." parameter in ALL follow-up searches to maintain consistency. Do NOT search other ecosystems unless explicitly requested.

Examples:

// In a TypeScript project with package.json
{ query: "HTTP clients" }
// β†’ Auto-detects npm, searches npm only

// Follow-up query (maintaining consistency)
{ query: "async libraries", ecosystem: "npm" }
// β†’ Continues searching npm

// Explicit ecosystem
{ query: "web frameworks", ecosystem: "pypi" }
// β†’ Searches PyPI regardless of project type

// With language context
{ query: "Find Rust async runtime libraries" }
// β†’ Detects "Rust", searches Crates.io

Other Smart Tools

All smart tools support an optional ecosystem parameter for explicit specification.

Package Information:

  • smart_package_info - Get detailed package info

    • Args: packageName, ecosystem?, context?, includeReadme?
    • Example: "Tell me about react" β†’ detects npm
  • smart_get_readme - Fetch package README

    • Args: packageName, ecosystem?, context?, version?, truncateAt?
    • Example: "Get README for django" β†’ detects PyPI
  • smart_get_usage_snippet - Extract code examples from README

    • Args: packageName, ecosystem?, context?, version?
    • Example: "Show me how to use axios" β†’ detects npm

Versions & Dependencies:

  • smart_get_versions - List package versions

    • Args: packageName, context?, limit?, since?
    • Example: "Show versions of tokio" β†’ detects Crates.io
  • smart_get_dependencies - Get package dependencies

    • Args: packageName, context?, version?
    • Example: "What does express depend on?" β†’ detects npm

Downloads:

  • smart_get_downloads - Get download statistics
    • Args: packageName, context?, period?
    • Example: "How many downloads does flask have?" β†’ detects PyPI

Comparison:

  • compare_packages - Compare packages across ecosystems
    • Args: items[] with {ecosystem, name} objects
    • Example: Compare axios (npm), requests (PyPI), httparty (RubyGems)