NPMLens MCP

by rakeshmenon

Not rated
GitHub

Description

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…

About

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…

Details

Author
rakeshmenon
Categories
Search, Developer Tools

Setup

Install NPMLens MCP in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/rakeshmenon/npmlens-mcp

Follow the installation instructions in the repository README, then restart your MCP client.

npmlens-mcplets 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.

Changelog|Contributing|Troubleshooting|Tool reference

- 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.

npmlens-mcpperforms network requests to npm and GitHub when tools are used. Avoid sharing secrets in prompts; setGITHUB_TOKENonly if you want higher GitHub rate limits.

Add the following config to your MCP client:

{ "mcpServers": { "npmlens": { "command": "npx", "args": ["-y", "npmlens-mcp@latest"] } } }

[!NOTE] Usingnpmlens-mcp@latestensures your MCP client always runs the latest published version.

amp mcp add npmlens -- npx npmlens-mcp@latest
claude mcp add npmlens npx npmlens-mcp@latest
codex mcp add npmlens -- npx npmlens-mcp@latest

Start the dialog to add a new MCP server by running:

Configure the following fields and pressCTRL+Sto save:

- Server name:npmlens
- Server Type:Local
- Command:npx -y npmlens-mcp@latest

code --add-mcp '{"name":"npmlens","command":"npx","args":["-y","npmlens-mcp@latest"]}'

Go toCursor Settings->MCP->New MCP Server. Use the config provided above.

gemini mcp add npmlens npx npmlens-mcp@latest
gemini mcp add -s user npmlens npx npmlens-mcp@latest

Alternatively, follow the Gemini CLI MCP guide and use the standard config from above.

Go toSettings | Tools | AI Assistant | Model Context Protocol (MCP)->Add. Use the config provided above. Same for Junie underSettings | Tools | Junie | MCP Settings->Add.

Go toSettings | AI | Manage MCP Servers->+ Addand use the config provided above.

Enter one of the following prompts in your MCP client to check if everything works:

Find 5 React debounce hook libraries, include weekly downloads, and fetch the README for the top result.
Compare react-query, swr, and apollo-client. Show me their weekly downloads, GitHub stars, and licenses.
Show me all TypeScript versions released in the last 6 months with their publish dates.
What are the dependencies of express? Include dev dependencies.

Looking for JSON‑RPC examples, tool schemas, the local dev CLI, troubleshooting, or contributor setup?

- Seedocs/advanced.mdfor all technical details.
- SeeCONTRIBUTING.mdfor contributing guidelines.

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

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

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

- 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.

- 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 optionalreadme.

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

- 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 includesversion,date,tags[].
- Example: "Show me all React versions from the last year".

- 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?".

- Fetch npm downloads for the lastday/week/month.
- Args:name(string, required),period(day|week|month, defaultweek).
- Returns:{ downloads, start, end, package }.

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

Below are example queries you can use with your AI assistant to test all 9 NPMLens tools:

Find packages related to "typescript validation" and show me the top 5 results
Get detailed information about the lodash package
Tell me about the vite package including GitHub stats and download numbers
How many downloads does react have in the last week?
Show me download statistics for next for the last month
How do I use the commander package? Give me a code snippet.
List all versions of React from the last year
Show me the version history of TypeScript since 6 months ago
Show me the dependency tree for next with depth 2
Compare the packages axios, fetch, and node-fetch and help me decide which to use
Find packages with keywords "react" AND "hooks" AND "typescript"
Search for packages with keywords "cli" OR "terminal"

You can also ask your AI assistant to use multiple tools together:

Compare react-query, swr, and apollo-client, then show me usage examples for the most popular one
Search for typescript validation libraries, then show me the README and dependencies for the top result
Find the package "zod", show me its download stats, version history, and a usage example

NPMLens MCP isMIT licensed. Contributions are welcome! Please seeCONTRIBUTING.mdfor guidelines.

Found a bug or have a feature request? Open an issue onGitHub.

Made with ❤️ for the vibe coding community. Happy coding!

Search global news using natural language. Webz.io News Search API returns the most relevant articles and content, with filters for source, country, language, date, sentiment, and category.

Search Chromium source code using advanced Code Search syntax.

Local-first, full-text code search MCP server for AI coding agents. Indexes your codebase with trigram-based indexing for sub-100ms queries. Agents can search across 10k+ files, filter by language or symbol kind, and get structured JSON results — all offline, no API key required

Fast, accurate, local code search for agents. Indexes any local path or GitHub repo on demand in ~250ms and answers queries in ~1.5ms. Works on CPU, no API keys or external services.

Persistent code index using Tree-sitter for fast, precise code search. Replaces grep with ~50 token responses instead of 2000+.

Searching and access your AI coding sessions from Claude Code, Gemini CLI, opencode, and OpenAI Codex.

A platform-agnostic code analysis library with semantic search capabilities and MCP server support.

An intelligent codebase search engine that transforms local codebases into a natural language queryable knowledge base.

A local MCP server for AI coding agents. AST-aware indexing, semantic search, and automatic compression. Your agent stops re-reading your entire codebase every session.

A server for code indexing, searching, and analysis, enabling LLMs to interact with code repositories.

Fast semantic code search for AI agents — find symbols, references, and callers across any codebase. Pre-built index committed to git, instant queries via MCP.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.