@npm_xiyuan/mcp-github-trending 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,527 @@
1
+ English | [简体中文](./README_CN.md)
2
+
3
+ # GitHub Trending MCP Server
4
+
5
+ [![npm version](https://img.shields.io/npm/v/@npm_xiyuan/mcp-github-trending.svg)](https://www.npmjs.com/package/@npm_xiyuan/mcp-github-trending)
6
+ [![Node.js](https://img.shields.io/badge/Node.js-18+-green.svg)](https://nodejs.org)
7
+ [![MCP](https://img.shields.io/badge/MCP-1.0-orange.svg)](https://modelcontextprotocol.io)
8
+ [![License](https://img.shields.io/badge/license-MIT-blue.svg)](./nodejs/LICENSE)
9
+
10
+ A Model Context Protocol (MCP) server that provides AI applications (like Claude Code) with real-time access to GitHub trending repositories and developers data.
11
+
12
+ ## ✨ Core Features
13
+
14
+ - 🚀 **Real-time Data** - Fetch latest trending data directly from GitHub
15
+ - 🔍 **Smart Search** - Keyword fuzzy matching with language filtering
16
+ - 📊 **Detailed Stats** - Complete repository info including stars, forks, topics
17
+ - 👥 **Developer Tracking** - Track trending developers and their popular repos
18
+ - ⚡ **Lightweight & Fast** - Fast data scraping based on cheerio
19
+ - 🔧 **Zero Config** - Install and use immediately, no extra setup required
20
+ - 🤖 **AI Native** - Designed specifically for Claude Code and other AI tools
21
+
22
+ ## 🚀 Quick Start
23
+
24
+ ### System Requirements
25
+
26
+ - Node.js 18.0.0 or higher
27
+ - Network access to github.com
28
+
29
+ ### Installation
30
+
31
+ Install globally via npm:
32
+
33
+ ```bash
34
+ npm install -g @npm_xiyuan/mcp-github-trending
35
+ ```
36
+
37
+ Or run directly with npx (recommended):
38
+
39
+ ```bash
40
+ npx @npm_xiyuan/mcp-github-trending
41
+ ```
42
+
43
+ ## ⚙️ Claude Code Configuration
44
+
45
+ ### Configuration File Location
46
+
47
+ Depending on your Claude client, the configuration file location varies:
48
+
49
+ | Client | Configuration File Path |
50
+ |--------|------------------------|
51
+ | **Claude Desktop (macOS)** | `~/Library/Application Support/Claude/claude_desktop_config.json` |
52
+ | **Claude Desktop (Windows)** | `%APPDATA%\Claude\claude_desktop_config.json` |
53
+ | **Claude Code CLI** | `~/.claude/settings.json` |
54
+
55
+ ### Basic Configuration
56
+
57
+ Edit the configuration file and add the MCP server configuration:
58
+
59
+ ```json
60
+ {
61
+ "mcpServers": {
62
+ "github-trending": {
63
+ "command": "npx",
64
+ "args": ["-y", "@npm_xiyuan/mcp-github-trending"]
65
+ }
66
+ }
67
+ }
68
+ ```
69
+
70
+ ### Configuration Explanation
71
+
72
+ - **Server Name**: `github-trending` can be customized, used to identify this service in Claude
73
+ - **command**: Use `npx` to ensure always running the latest version
74
+ - **args**:
75
+ - `-y`: Auto-confirm installation to avoid interactive prompts
76
+ - Package name: `@npm_xiyuan/mcp-github-trending`
77
+
78
+ ### Verify Configuration
79
+
80
+ After restarting Claude client, verify the configuration is successful by:
81
+
82
+ 1. Ask Claude: `"Show me today's trending GitHub projects"`
83
+ 2. If configured successfully, Claude will automatically call MCP tools to fetch data
84
+
85
+ ## 📦 MCP Tools Capabilities
86
+
87
+ This service provides 9 MCP tools that can be directly called in Claude Code:
88
+
89
+ ### 1. get_trending_repos - Get Trending Repositories
90
+
91
+ **Description**: Fetch trending repositories from GitHub, with filters for time range and programming language.
92
+
93
+ **Parameters**:
94
+
95
+ | Parameter | Type | Required | Default | Description |
96
+ |-----------|------|----------|---------|-------------|
97
+ | `since` | string | No | `"weekly"` | Time range: `"daily"` (today), `"weekly"` (this week), `"monthly"` (this month) |
98
+ | `language` | string | No | - | Programming language filter, e.g., `"python"`, `"javascript"`, `"rust"` |
99
+ | `limit` | number | No | `10` | Number of results to return, recommended 1-25 |
100
+
101
+ **Response Data**:
102
+ ```json
103
+ [
104
+ {
105
+ "name": "owner/repo-name",
106
+ "url": "https://github.com/owner/repo-name",
107
+ "description": "Repository description",
108
+ "stars": "1,234 stars today"
109
+ }
110
+ ]
111
+ ```
112
+
113
+ **Use Cases**:
114
+ - Discover latest trending open-source projects
115
+ - Understand popularity trends for specific programming languages
116
+ - Study and research excellent codebases
117
+
118
+ ### 2. get_trending_developers - Get Trending Developers
119
+
120
+ **Description**: Fetch trending developers from GitHub along with their popular repositories.
121
+
122
+ **Parameters**:
123
+
124
+ | Parameter | Type | Required | Default | Description |
125
+ |-----------|------|----------|---------|-------------|
126
+ | `since` | string | No | `"weekly"` | Time range: `"daily"`, `"weekly"`, `"monthly"` |
127
+ | `language` | string | No | - | Programming language filter |
128
+ | `limit` | number | No | `10` | Number of results to return |
129
+
130
+ **Response Data**:
131
+ ```json
132
+ [
133
+ {
134
+ "name": "Developer Name",
135
+ "username": "github-username",
136
+ "url": "https://github.com/username",
137
+ "avatar": "Avatar URL",
138
+ "popularRepo": {
139
+ "name": "Popular Repository",
140
+ "description": "Repository description",
141
+ "url": "Repository URL"
142
+ }
143
+ }
144
+ ]
145
+ ```
146
+
147
+ **Use Cases**:
148
+ - Follow active excellent developers
149
+ - Discover technical experts in specific domains
150
+ - Find learning role models and potential collaborators
151
+
152
+ ### 3. search_trending - Search Trending Repositories
153
+
154
+ **Description**: Search trending repositories by keyword with fuzzy matching on names and descriptions.
155
+
156
+ **Parameters**:
157
+
158
+ | Parameter | Type | Required | Default | Description |
159
+ |-----------|------|----------|---------|-------------|
160
+ | `keyword` | string | **Yes** | - | Search keyword (case-insensitive) |
161
+ | `since` | string | No | `"weekly"` | Time range |
162
+ | `language` | string | No | - | Programming language filter |
163
+
164
+ **Response Data**: Same format as `get_trending_repos`
165
+
166
+ **Use Cases**:
167
+ - Quickly find trending projects for specific tech stacks
168
+ - Search for open-source solutions in specific domains
169
+ - Precisely locate projects of interest
170
+
171
+ ### 4. get_repo_details - Get Repository Details
172
+
173
+ **Description**: Get detailed statistics and metadata for a specific GitHub repository.
174
+
175
+ **Parameters**:
176
+
177
+ | Parameter | Type | Required | Default | Description |
178
+ |-----------|------|----------|---------|-------------|
179
+ | `owner` | string | **Yes** | - | Repository owner (username or organization) |
180
+ | `repo` | string | **Yes** | - | Repository name |
181
+
182
+ **Response Data**:
183
+ ```json
184
+ {
185
+ "name": "Repository name",
186
+ "fullName": "owner/repo",
187
+ "description": "Repository description",
188
+ "url": "https://github.com/owner/repo",
189
+ "stars": 12345,
190
+ "forks": 678,
191
+ "watchers": 890,
192
+ "language": "JavaScript",
193
+ "topics": ["react", "typescript", "ui"],
194
+ "createdAt": "2023-01-01",
195
+ "updatedAt": "2024-06-05",
196
+ "license": "MIT"
197
+ }
198
+ ```
199
+
200
+ **Use Cases**:
201
+ - Deep dive into specific project details
202
+ - Evaluate project activity and popularity
203
+ - Get project tech stack and topic tags
204
+
205
+ ### 5. analyze_repo - Comprehensive Repository Analysis
206
+
207
+ **Description**: Get a complete analysis report of a GitHub project in one call, including README, dependencies, directory structure, and recent commits. This is the most powerful and convenient analysis tool for quickly understanding unfamiliar projects.
208
+
209
+ **Parameters**:
210
+
211
+ | Parameter | Type | Required | Description |
212
+ |-----------|------|----------|-------------|
213
+ | `owner` | string | **Yes** | Repository owner (username or organization) |
214
+ | `repo` | string | **Yes** | Repository name |
215
+
216
+ **Response Data**:
217
+ ```json
218
+ {
219
+ "basic": {
220
+ "fullName": "owner/repo",
221
+ "stars": 12345,
222
+ "language": "TypeScript",
223
+ "topics": ["react", "typescript"]
224
+ },
225
+ "readme": {
226
+ "content": "# Project Title\n...",
227
+ "size": 5432
228
+ },
229
+ "structure": {
230
+ "rootFiles": ["package.json", "README.md"],
231
+ "directories": ["src", "test", "docs"]
232
+ },
233
+ "dependencies": {
234
+ "detected": true,
235
+ "packageManager": "npm/yarn/pnpm",
236
+ "file": "package.json",
237
+ "content": "{...}"
238
+ },
239
+ "recentActivity": {
240
+ "commits": [...],
241
+ "lastCommitDate": "2024-06-05"
242
+ }
243
+ }
244
+ ```
245
+
246
+ **Use Cases**:
247
+ - Quickly understand an unfamiliar project's purpose and tech stack
248
+ - Evaluate project activity and maintenance status
249
+ - Get complete technical background information about a project
250
+
251
+ ### 6. get_repo_readme - Get README
252
+
253
+ **Description**: Fetch the raw README.md content of a GitHub repository.
254
+
255
+ **Parameters**:
256
+
257
+ | Parameter | Type | Required | Description |
258
+ |-----------|------|----------|-------------|
259
+ | `owner` | string | **Yes** | Repository owner |
260
+ | `repo` | string | **Yes** | Repository name |
261
+
262
+ **Use Cases**:
263
+ - Read project documentation to understand usage
264
+ - Extract project introduction and feature descriptions
265
+
266
+ ### 7. get_repo_file - Get File Content
267
+
268
+ **Description**: Fetch the raw content of a specific file in a GitHub repository.
269
+
270
+ **Parameters**:
271
+
272
+ | Parameter | Type | Required | Description |
273
+ |-----------|------|----------|-------------|
274
+ | `owner` | string | **Yes** | Repository owner |
275
+ | `repo` | string | **Yes** | Repository name |
276
+ | `path` | string | **Yes** | File path, e.g., "package.json" |
277
+
278
+ **Use Cases**:
279
+ - View configuration files (package.json, requirements.txt)
280
+ - Read code files to understand implementation details
281
+
282
+ ### 8. get_repo_structure - Get Directory Structure
283
+
284
+ **Description**: Fetch the directory and file listing of a GitHub repository.
285
+
286
+ **Parameters**:
287
+
288
+ | Parameter | Type | Required | Default | Description |
289
+ |-----------|------|----------|---------|-------------|
290
+ | `owner` | string | **Yes** | - | Repository owner |
291
+ | `repo` | string | **Yes** | - | Repository name |
292
+ | `path` | string | No | `""` | Directory path (empty for root) |
293
+
294
+ **Use Cases**:
295
+ - Understand project file organization
296
+ - Browse files in specific directories
297
+
298
+ ### 9. get_repo_commits - Get Commit History
299
+
300
+ **Description**: Fetch recent commit records of a GitHub repository.
301
+
302
+ **Parameters**:
303
+
304
+ | Parameter | Type | Required | Default | Description |
305
+ |-----------|------|----------|---------|-------------|
306
+ | `owner` | string | **Yes** | - | Repository owner |
307
+ | `repo` | string | **Yes** | - | Repository name |
308
+ | `limit` | number | No | `10` | Number of commits to return |
309
+
310
+ **Use Cases**:
311
+ - Understand recent development activity
312
+ - Check project commit frequency and activity level
313
+
314
+ ## 💡 Usage Examples
315
+
316
+ ### Example 1: View Today's Trending Projects
317
+
318
+ Ask Claude Code:
319
+
320
+ ```
321
+ Show me top 10 trending GitHub projects today
322
+ ```
323
+
324
+ Claude will automatically call `get_trending_repos` tool to return today's top 10 trending projects.
325
+
326
+ ### Example 2: Search for Specific Tech Stack
327
+
328
+ ```
329
+ Find recent trending Rust projects
330
+ ```
331
+
332
+ Claude will use `language: "rust"` parameter to filter Rust-related trending projects.
333
+
334
+ ### Example 3: Keyword Search
335
+
336
+ ```
337
+ Search GitHub trending projects about AI agents
338
+ ```
339
+
340
+ Claude will call `search_trending` tool to search for projects containing "AI agent" keyword.
341
+
342
+ ### Example 4: Get Repository Details
343
+
344
+ ```
345
+ Show me detailed information about microsoft/vscode repository
346
+ ```
347
+
348
+ Claude will call `get_repo_details` to get complete information including stars, forks, tech stack, etc.
349
+
350
+ ### Example 5: Analyze a GitHub Project
351
+
352
+ ```
353
+ Help me analyze the project at https://github.com/microsoft/vscode
354
+ ```
355
+
356
+ Claude will call the `analyze_repo` tool to return a comprehensive analysis report including:
357
+ - Basic project information (stars, language, topic tags)
358
+ - README content
359
+ - Project structure (root files and main directories)
360
+ - Dependency management (package.json or other config files)
361
+ - Recent commit history
362
+
363
+ This is the most powerful and convenient way to quickly understand an unfamiliar project.
364
+
365
+ ### Example 6: View Trending Developers
366
+
367
+ ```
368
+ Show me this week's trending Python developers on GitHub
369
+ ```
370
+
371
+ Claude will call the `get_trending_developers` tool to return a list of the most active Python developers this week along with their popular repositories.
372
+
373
+ ### Example 7: Read Project README
374
+
375
+ ```
376
+ Help me read the README documentation for facebook/react
377
+ ```
378
+
379
+ Claude will call the `get_repo_readme` tool to fetch the complete README.md content of the React project, making it easy to understand the project's usage instructions and features.
380
+
381
+ ### Example 8: View Configuration Files
382
+
383
+ ```
384
+ Help me check the package.json file of the vercel/next.js project
385
+ ```
386
+
387
+ Claude will call the `get_repo_file` tool to fetch the package.json file content of the Next.js project, allowing you to understand the project's dependencies and script configurations.
388
+
389
+ ### Example 9: View Project Structure
390
+
391
+ ```
392
+ Help me see the root directory structure of the nodejs/node project
393
+ ```
394
+
395
+ Claude will call the `get_repo_structure` tool to return the root directory files and folders list of the Node.js project, helping you understand the project's organization architecture.
396
+
397
+ ### Example 10: View Commit History
398
+
399
+ ```
400
+ Help me check the last 5 commit records of the denoland/deno project
401
+ ```
402
+
403
+ Claude will call the `get_repo_commits` tool to return detailed information about the last 5 commits of the Deno project, including committer, commit time, and commit message.
404
+
405
+ ## 🎯 Best Practices
406
+
407
+ ### Performance Optimization Tips
408
+
409
+ 1. **Use Appropriate Time Ranges**:
410
+ - Use `weekly` for regular browsing
411
+ - Use `daily` for latest updates
412
+ - Use `monthly` for long-term trend analysis
413
+
414
+ 2. **Precise Language Filtering**:
415
+ - Specify programming language to significantly reduce irrelevant results
416
+ - Supported languages: `python`, `javascript`, `typescript`, `rust`, `go`, `java`, etc.
417
+
418
+ 3. **Control Result Count**:
419
+ - Default returns 10 results, adjustable as needed
420
+ - Recommend not exceeding 25 to avoid impacting response speed
421
+
422
+ ### Application Scenarios in Claude Code
423
+
424
+ - **Technology Selection**: Quickly understand the most popular tech solutions in a domain
425
+ - **Learning Resources**: Discover high-quality open-source projects for learning
426
+ - **Competitive Analysis**: Track open-source implementations of similar products
427
+ - **Tech Trends**: Observe popularity changes of emerging technologies and languages
428
+ - **Developer Relations**: Find excellent developers and potential collaborators
429
+
430
+ ## 🔧 Troubleshooting
431
+
432
+ ### Common Issues
433
+
434
+ **Q: Claude cannot recognize MCP tools?**
435
+
436
+ A: Please check:
437
+ 1. Configuration file path is correct
438
+ 2. JSON format is valid (use JSON validator)
439
+ 3. Claude client has been restarted
440
+ 4. Run `npx -y @npm_xiyuan/mcp-github-trending` to ensure package works
441
+
442
+ **Q: Empty or incomplete data returned?**
443
+
444
+ A: Possible reasons:
445
+ 1. GitHub trending page structure changed (wait for package update)
446
+ 2. Network connection issues (check github.com accessibility)
447
+ 3. Selected language or time range has no trending projects
448
+
449
+ **Q: How to update to the latest version?**
450
+
451
+ A: Using npx automatically uses the latest version. If globally installed, run:
452
+ ```bash
453
+ npm update -g @npm_xiyuan/mcp-github-trending
454
+ ```
455
+
456
+ ## 🛠️ Development Guide
457
+
458
+ ### Local Development
459
+
460
+ ```bash
461
+ # Clone the repository
462
+ git clone https://github.com/jiyi1990118/mcp-github-trending.git
463
+ cd mcp-github-trending
464
+
465
+ # Install dependencies
466
+ npm install
467
+
468
+ # Build the project
469
+ npm run build
470
+
471
+ # Test locally
472
+ npm start
473
+ ```
474
+
475
+ ### Directory Structure
476
+
477
+ ```
478
+ nodejs/
479
+ ├── src/
480
+ │ ├── index.ts # MCP server entry point
481
+ │ ├── tools.ts # Tool definitions
482
+ │ └── scraper.ts # GitHub data scraping logic
483
+ ├── package.json
484
+ └── tsconfig.json
485
+ ```
486
+
487
+ ### Tech Stack
488
+
489
+ - **MCP SDK**: `@modelcontextprotocol/sdk` - Model Context Protocol implementation
490
+ - **HTTP Client**: `node-fetch` - Make HTTP requests
491
+ - **HTML Parser**: `cheerio` - Lightweight server-side jQuery implementation
492
+ - **TypeScript**: Type-safe JavaScript superset
493
+
494
+ ### Contributing
495
+
496
+ Contributions are welcome! Please feel free to submit Issues and Pull Requests.
497
+
498
+ 1. Fork this repository
499
+ 2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
500
+ 3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
501
+ 4. Push to the branch (`git push origin feature/AmazingFeature`)
502
+ 5. Open a Pull Request
503
+
504
+ ## 📄 License
505
+
506
+ This project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details.
507
+
508
+ ## 🔗 Related Links
509
+
510
+ - [GitHub Repository](https://github.com/jiyi1990118/mcp-github-trending)
511
+ - [npm Package](https://www.npmjs.com/package/@npm_xiyuan/mcp-github-trending)
512
+ - [Model Context Protocol Documentation](https://modelcontextprotocol.io)
513
+ - [Claude Desktop Download](https://claude.ai/download)
514
+ - [GitHub Trending Page](https://github.com/trending)
515
+
516
+ ## 📮 Feedback & Support
517
+
518
+ For questions or suggestions, please contact us through:
519
+
520
+ - Submit GitHub Issues
521
+ - Create Pull Requests
522
+ - Leave comments on npm page
523
+
524
+ ---
525
+
526
+ **Note**: This project fetches data by scraping the GitHub Trending page, not through official API. GitHub page structure changes may affect functionality, please update to the latest version promptly.
527
+