A powerful tool for scraping GitHub Trending repositories with multiple filter options. Supports MCP Server and WorkBuddy Skill integration.
- 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
We provide a beautiful web interface for manual testing:
Option 1: Use npm script
npm run serverOption 2: Use startup script (Windows)
start-server.batOption 3: Use startup script (Linux/Mac)
# Add execute permission (first time only)
chmod +x start-server.sh
# Run the script
./start-server.shThen 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
npm run mcp-server# Clone the repository
git clone <repository-url>
cd github-trending
# Install dependencies
npm install
# Build TypeScript
npm run buildimport { 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'
});| Parameter | Type | Description | Example |
|---|---|---|---|
since |
'daily' | 'weekly' | 'monthly' |
Time range | 'weekly' |
language |
string |
Programming language | 'python', 'rust' |
spokenLanguageCode |
string |
Spoken language code | 'en', 'zh' |
- Build the project:
npm run build- 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"
}
}
}- Available MCP tools:
getTrendingRepositories- Get trending repository listgetTrendingMetadata- Get page metadatagetTrendingStatistics- Get statistics
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/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
}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
};
}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`);
});const repos = await getTrendingRepositories({
since: 'weekly',
language: 'typescript',
spokenLanguageCode: 'zh'
});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}`);python- Pythonjavascript- JavaScripttypescript- TypeScriptrust- Rustgo- Gojava- Javac- Cc++- C++c#- C#ruby- Rubyphp- PHPswift- Swiftkotlin- Kotlin- ... and more
en- Englishzh- Chineseja- Japaneseko- Koreanfr- Frenchde- Germanes- Spanishru- Russian
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 mode
npm run dev
# Start web test server
npm run server
# Run MCP Server
npm run mcp-server
# Build
npm run build- Anti-scraping: This tool sets reasonable User-Agent and headers, but frequent requests may be rate-limited by GitHub
- Data Updates: GitHub Trending data is updated periodically, not real-time
- Page Structure: Parser may need updates if GitHub page structure changes
- Network Issues: Users in China may need to configure a proxy to access GitHub
Apache 2.0
Issues and Pull Requests are welcome!