pkg-peep

pkg-peep

Enables querying NPM package download statistics, metadata, and dependency information through natural language.

Category
访问服务器

README

pkg-peep 👀

A Model Context Protocol (MCP) server for NPM package intelligence. Get download statistics, package metadata, and dependency information for any NPM package.

How It Works

This MCP server exposes NPM registry APIs as tools that Q CLI and Claude can use:

  1. MCP Protocol: Server communicates with AI clients via Model Context Protocol
  2. Tool Registration: NPM API endpoints become callable tools
  3. No Authentication: Uses public NPM APIs (no API key required)
  4. JSON Responses: All package data returned as formatted JSON

pkg-peep MCP Architecture

%%{init: {'flowchart': {'curve': 'basis'}}}%%
graph LR
    A["💻<br/>Q CLI"] -.-> B["🔌<br/>MCP Server"]
    C["💻<br/>Claude Code"] -.-> B
    B <--> D["📦<br/>NPM Registry API"]
    B <--> E["📊<br/>NPM Downloads API"]
    
    style A fill:#6366f1,stroke:#000,stroke-width:3px,color:#fff
    style C fill:#ff9900,stroke:#000,stroke-width:3px,color:#000
    style B fill:#C11C84,stroke:#000,stroke-width:3px,color:#fff
    style D fill:#cb3837,stroke:#000,stroke-width:3px,color:#fff
    style E fill:#10b981,stroke:#000,stroke-width:3px,color:#000

When you ask Q CLI or Claude Code to "get download stats for react", it:

  1. Calls the get_npm_downloads tool
  2. Server makes API request to NPM Downloads API
  3. Returns formatted results to the AI client
  4. The agent presents the data to you in context

Features

  • 📊 Download Statistics - Weekly, monthly, daily, or custom date ranges
  • 📦 Package Metadata - Versions, dependencies, maintainers, license info
  • 🔍 Comprehensive Info - Repository links, keywords, creation dates
  • Fast & Reliable - Direct NPM registry API integration
  • 🔑 No API Key Required - Uses public NPM APIs

Tools

get_npm_downloads

Get download statistics for any NPM package.

Parameters:

  • package (required): NPM package name
  • period (optional): last-day, last-week, last-month
  • startDate (optional): Custom start date (YYYY-MM-DD)
  • endDate (optional): Custom end date (YYYY-MM-DD)

Example Response:

{
  "downloads": 50766634,
  "start": "2025-08-27",
  "end": "2025-09-02", 
  "package": "react"
}

get_npm_package_info

Get comprehensive package metadata.

Parameters:

  • package (required): NPM package name

Example Response:

{
  "name": "react",
  "description": "React is a JavaScript library for building user interfaces.",
  "latest": "19.1.1",
  "license": "MIT",
  "homepage": "https://react.dev/",
  "repository": {
    "url": "git+https://github.com/facebook/react.git",
    "type": "git"
  },
  "maintainers": [
    {"name": "fb", "email": "opensource+npm@fb.com"}
  ],
  "dependencies": {...},
  "created": "2011-10-26T17:46:21.942Z"
}

Installation

For Amazon Q CLI

  1. Clone or download this repository
  2. Install dependencies:
    npm install
    
  3. The MCP server is ready to use with Q CLI's MCP support

For Claude Desktop

Add to your Claude Desktop configuration:

{
  "mcpServers": {
    "pkg-peep": {
      "command": "node",
      "args": ["/path/to/pkg-peep/index.js"]
    }
  }
}

Using NPX (Recommended)

{
  "mcpServers": {
    "pkg-peep": {
      "command": "npx",
      "args": ["-y", "pkg-peep"]
    }
  }
}

Usage Examples

Get weekly downloads:

Get download stats for "react" package

Custom date range:

Get download stats for "lodash" from 2024-01-01 to 2024-12-31

Package information:

Get package info for "express"

Testing

Run the test suite to verify everything works:

npm test

The tests verify:

  • ✅ Tool registration (both download and package info tools)
  • ✅ Download stats for popular packages
  • ✅ Different time periods (daily, weekly, monthly)
  • ✅ Package metadata retrieval
  • ✅ Custom date ranges
  • ✅ Error handling for non-existent packages

📋 Example Prompts >> - Try these sample queries to test your MCP!

Development

# Install dependencies
npm install

# Run the server
node index.js

# Test with a simple request
echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/list"}' | node index.js

API Endpoints Used

  • NPM Downloads API: https://api.npmjs.org/downloads/
  • NPM Registry API: https://registry.npmjs.org/

License

MIT

Contributing

Issues and pull requests welcome! This MCP server uses the official Model Context Protocol SDK.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选