GitHub Trending MCP
Fetches trending repositories from GitHub and saves them as Markdown files. Supports proxy configuration.
GitHub Trending MCP
这是一个基于 FastMCP 框架的 GitHub 热门仓库获取工具,可以一次性获取 GitHub 当日的可选个数的热门仓库的详细信息,包括名称、链接、描述和 README 内容。 这样你就不用一篇一篇的翻README来总结博客了,可以节省AI 的 Tokens 。
功能特点
- 获取 GitHub 当日热门仓库列表
- 支持自定义获取仓库数量
- 支持代理配置(通过环境变量)
- 支持将结果保存为 Markdown 文件
- 自动处理同名文件,避免覆盖
安装方法
从仓库安装
# 使用pip从GitHub仓库安装
pip install git+https://github.com/RusianHu/GitHubDailyTrendingFetcher-mcp.git
从本地安装
# 克隆仓库
git clone https://github.com/RusianHu/GitHubDailyTrendingFetcher-mcp.git
cd GitHubDailyTrendingFetcher-mcp
# 安装到本地环境
pip install -e .
使用方法
作为命令行工具运行
安装后,可以直接在命令行中运行:
# 使用 Python 模块方式运行(推荐)
python -m github_trending_mcp
作为 MCP 服务集成到 Roo Code
-
打开 Roo Code 的 MCP 配置文件:
%APPDATA%\Code\User\globalStorage\rooveterinaryinc.roo-cline\settings\mcp_settings.json
-
添加 GitHub Trending MCP 服务配置:
{ "mcpServers": { // 其他服务配置... "github-trending-mcp": { "command": "python", "args": [ "-m", "github_trending_mcp" ], "alwaysAllow": [ "get_github_trending", "get_proxy_status" ], "disabled": false } } }
-
保存配置文件并重启 Roo Code
环境变量配置
可以通过以下环境变量配置代理:
PROXY_HOST
: 代理主机地址(默认为 "127.0.0.1")PROXY_PORT
: 代理端口(默认为 "10808")PROXY_PROTOCOL
: 代理协议(默认为 "socks5")
设置环境变量示例
Windows PowerShell:
$env:PROXY_HOST = "127.0.0.1"
$env:PROXY_PORT = "10808"
$env:PROXY_PROTOCOL = "socks5"
Windows CMD:
set PROXY_HOST=127.0.0.1
set PROXY_PORT=10808
set PROXY_PROTOCOL=socks5
Linux/macOS:
export PROXY_HOST=127.0.0.1
export PROXY_PORT=10808
export PROXY_PROTOCOL=socks5
在 Roo Code MCP 配置中使用环境变量
{
"mcpServers": {
"github-trending-mcp": {
"command": "python",
"args": [
"-m",
"github_trending_mcp"
],
"env": {
"PROXY_HOST": "127.0.0.1",
"PROXY_PORT": "10808",
"PROXY_PROTOCOL": "socks5"
},
"alwaysAllow": [
"get_github_trending",
"get_proxy_status"
],
"disabled": false
}
}
}
API 参考
工具:get_github_trending
获取 GitHub 当日热门仓库,包括名称、链接、描述和 README 内容。
参数:
repo_limit
: 要获取的仓库数量,默认为 5use_proxy
: 是否使用代理,默认为 Falsesave_to_file
: 是否保存结果到文件,默认为 True
返回:
- Markdown 格式的热门仓库信息
示例调用:
{
"repo_limit": 10,
"use_proxy": true,
"save_to_file": true
}
工具:get_proxy_status
获取当前代理配置状态。
参数: 无
返回:
- 包含代理配置信息的字典
输出示例
下面是一个输出示例:
## GitHub 今日热门仓库 Top 5
### 1. [username/repo-name](https://github.com/username/repo-name)
**About:** 仓库描述信息
**README:**
```markdown
README 内容...
```
### 2. [username2/repo-name2](https://github.com/username2/repo-name2)
**About:** 仓库描述信息
**README:**
```markdown
README 内容...
```
---
**总输出文本长度:** 12345
报告已保存到: C:\path\to\github_trending_2023-05-01.md
注意:实际输出中的代码块会正确显示,这里为了展示嵌套的代码块而做了特殊处理。
文件保存
结果将保存为 Markdown 文件,文件名格式为:
github_trending_YYYY-MM-DD.md
如果同名文件已存在,将自动添加序号:
github_trending_YYYY-MM-DD_1.md
github_trending_YYYY-MM-DD_2.md
- ...
注意事项
- 确保网络连接正常,或配置正确的代理
- GitHub 页面结构可能会变化,如果遇到解析错误,可能需要更新解析逻辑
- 请遵守 GitHub 的使用条款和爬虫政策
许可证
MIT © RusianHu
Related Servers
Gitee
Gitee API integration, repository, issue, and pull request management, and more.
GitLab
Integrates with the GitLab REST API to manage repositories, issues, and merge requests.
GitHub
Interact with GitHub APIs for automation and repository management.
SVN MCP Server
An MCP server for integrating with and managing Subversion (SVN) repositories, enabling AI agents to perform version control tasks.
PyGithub MCP Server
Interact with the GitHub API using PyGithub to manage repositories, issues, and pull requests.
GitHub Explorer MCP
Explore GitHub repositories, including file content, directory structure, and other metadata.
GitHub MCP Server
Integrate with GitHub APIs for automation and interaction.
GitHub Enterprise
Integrate with the GitHub Enterprise API to access repositories, issues, pull requests, and workflows.
Ares DevOps
Perform Git operations on Azure DevOps repositories using a Personal Access Token (PAT).
Obsidian GitHub MCP
Connects AI assistants to Obsidian vaults stored in GitHub repositories, enabling them to read, search, and analyze your notes and documentation.