npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@imleonli/github-trending-mcp

v0.2.1

Published

GitHub Trending 页面内容提取工具,支持 MCP Server 和 WorkBuddy Skill

Downloads

107

Readme

GitHub Trending Extractor

中文版本 | English Version

A powerful tool for scraping GitHub Trending repositories with multiple filter options. Supports MCP Server and WorkBuddy Skill integration.

Features

  • Scrape GitHub Trending page data
  • Multiple filter options:
    • Time Range: daily, weekly, monthly
    • Programming Language: Python, JavaScript, TypeScript, Rust, Go, Java, etc.
    • Spoken Language: English, Chinese, Japanese, French, etc.
  • Complete repository information:
    • Repository name and URL
    • Description
    • Programming language
    • Star/Fork counts and URLs
    • Contributor list with avatars
    • Stars gained today
  • Full TypeScript support
  • MCP Server mode for AI assistants
  • WorkBuddy Skill configuration

Quick Start

One-Click Web Interface

We provide a beautiful web interface for manual testing:

Option 1: Use npm script

npm run server

Option 2: Use startup script (Windows)

start-server.bat

Option 3: Use startup script (Linux/Mac)

# Add execute permission (first time only)
chmod +x start-server.sh
# Run the script
./start-server.sh

Then open: http://localhost:34567

Interface features:

  • 🔍 Visual filter options (time range, programming language, spoken language)
  • 📦 Card view for repository display
  • 📄 JSON data viewer
  • 📊 Real-time statistics

Run MCP Server

npm run mcp-server

Installation

# Clone the repository
git clone https://github.com/ImLeonLi/GitHub-Trending-MCP.git
cd GitHub-Trending-MCP

# Install dependencies
npm install

# Build TypeScript
npm run build

Usage

As a Library

import { getTrending, getTrendingRepositories, getTrendingStatistics } from './src/index';

// Get today's trending (all languages)
const result = await getTrending();
console.log(result.repositories);

// Get weekly Python trending
const repos = await getTrendingRepositories({
  since: 'weekly',
  language: 'python'
});

// Get statistics
const stats = await getTrendingStatistics({
  since: 'monthly',
  language: 'typescript'
});

Filter Parameters

| Parameter | Type | Description | Example | |-----------|------|-------------|---------| | since | 'daily' \| 'weekly' \| 'monthly' | Time range | 'weekly' | | language | string | Programming language | 'python', 'rust' | | spokenLanguageCode | string | Spoken language code | 'en', 'zh' |

As MCP Server

  1. Build the project:
npm run build
  1. Configure your MCP client (e.g., Claude Desktop):

Edit claude_desktop_config.json:

{
  "mcpServers": {
    "github-trending": {
      "command": "node",
      "args": ["/path/to/github-trending/dist/mcp-server.js"],
      "description": "GitHub Trending repository scraper"
    }
  }
}
  1. Available MCP tools:
  • getTrendingRepositories - Get trending repository list
  • getTrendingMetadata - Get page metadata
  • getTrendingStatistics - Get statistics

As WorkBuddy Skill

Copy skill/SKILL.md to WorkBuddy's skills directory:

# User-level Skill
cp skill/SKILL.md ~/.codebuddy/skills/github-trending/

# Project-level Skill
cp skill/SKILL.md .codebuddy/skills/github-trending/

Data Structures

TrendingRepository

interface TrendingRepository {
  name: string;              // "owner/repo" format
  url: string;               // Repository URL
  description: string;       // Repository description
  language: string;          // Programming language
  stars: number;             // Star count (integer)
  starsUrl: string;          // Stars page URL
  forks: number;             // Fork count (integer)
  forksUrl: string;          // Forks page URL
  contributors: Contributor[]; // Contributor list
  starsToday: number;        // Stars gained today (integer)
  starsTodayText: string;    // Original text, e.g., "2,149 stars today"
}

interface Contributor {
  username: string;          // GitHub username
  url: string;               // GitHub profile URL
  avatar: string;            // Avatar URL
}

TrendingMetadata

interface TrendingMetadata {
  title: string;             // Page title
  description: string;       // Page description
  filterOptions: {
    since: string;           // Current time range
    language?: string;       // Current language filter
    spokenLanguageCode?: string; // Current spoken language filter
  };
}

Examples

Get Today's Python Trending

import { getTrendingRepositories } from './src/index';

const repos = await getTrendingRepositories({
  since: 'daily',
  language: 'python'
});

repos.forEach(repo => {
  console.log(`${repo.name}: ${repo.stars} stars, +${repo.starsToday} today`);
});

Get Weekly TypeScript Projects from Chinese Developers

const repos = await getTrendingRepositories({
  since: 'weekly',
  language: 'typescript',
  spokenLanguageCode: 'zh'
});

Get Statistics

import { getTrendingStatistics } from './src/index';

const stats = await getTrendingStatistics({ since: 'weekly' });
console.log(`Total repos: ${stats.total}`);
console.log(`Languages:`, stats.languages);
console.log(`Total stars: ${stats.totalStars}`);

Supported Languages

Programming Languages

  • python - Python
  • javascript - JavaScript
  • typescript - TypeScript
  • rust - Rust
  • go - Go
  • java - Java
  • c - C
  • c++ - C++
  • c# - C#
  • ruby - Ruby
  • php - PHP
  • swift - Swift
  • kotlin - Kotlin
  • ... and more

Spoken Languages

  • en - English
  • zh - Chinese
  • ja - Japanese
  • ko - Korean
  • fr - French
  • de - German
  • es - Spanish
  • ru - Russian

Project Structure

github-trending/
├── src/
│   ├── types.ts         # TypeScript type definitions
│   ├── scraper.ts       # Page scraping module
│   ├── parser.ts        # HTML parsing module
│   ├── index.ts         # Main entry, exports API
│   ├── mcp-server.ts    # MCP Server entry
│   └── server.ts        # Web test server
├── public/
│   └── index.html       # Web test interface
├── skill/
│   └── SKILL.md         # WorkBuddy Skill config
├── start-server.bat     # Windows startup script
├── start-server.sh      # Linux/Mac startup script
├── package.json         # Project configuration
├── tsconfig.json        # TypeScript configuration
├── README.md            # Chinese documentation
└── README_EN.md         # English documentation

Development

# Development mode
npm run dev

# Start web test server
npm run server

# Run MCP Server
npm run mcp-server

# Build
npm run build

Notes

  1. Anti-scraping: This tool sets reasonable User-Agent and headers, but frequent requests may be rate-limited by GitHub
  2. Data Updates: GitHub Trending data is updated periodically, not real-time
  3. Page Structure: Parser may need updates if GitHub page structure changes
  4. Network Issues: Users in China may need to configure a proxy to access GitHub

License

Apache 2.0

Contributing

Issues and Pull Requests are welcome!