GitHub趋势数据API服务

一个提供GitHub热门仓库和开发者数据的MCP服务器,支持按编程语言、时间周期和口语语言过滤,返回格式化的JSON响应。

  • by hetaoBackend
  • Python
  • 本地部署
  • 62 星标
  • 更新于
在 GitHub 查看 hetaoBackend/mcp-github-trending

使用说明

mcp-github趋势mcp服务器

MCP服务器,通过简单的API接口提供对GitHub趋势库和开发人员数据的访问。

特性

  • 访问GitHub趋势存储库和开发人员数据
  • 按编程语言筛选
  • 按时间段筛选(每日、每周、每月)
  • 按口语筛选
  • 返回格式良好的JSON响应

工具

服务器实现了以下工具:

get_github_trepending_repositories

使用以下参数从GitHub获取趋势存储库:

  • language (可选):用于过滤存储库的编程语言(例如“python”、“javascript”)
  • since (可选):按(“每日”、“每周”、“每月”)筛选存储库的时间段。默认为“每日”
  • spoken_language (可选):按以下方式过滤存储库的口语

示例响应:

[
  {
    "name": "repository-name",
    "fullname": "owner/repository-name",
    "url": "https://github.com/owner/repository-name",
    "description": "Repository description",
    "language": "Python",
    "stars": 1000,
    "forks": 100,
    "current_period_stars": 50
  }
]

get_github_trepending_developers

使用以下参数从GitHub获取趋势开发人员:

  • language (可选):用于过滤的编程语言(例如“python”、“javascript”)
  • since (可选):过滤的时间段(“每日”、“每周”、“每月”)。默认为“每日”

示例响应:

[
  {
    "username": "developer",
    "name": "Developer Name",
    "url": "https://github.com/developer",
    "avatar": "https://avatars.githubusercontent.com/u/123456",
    "repo": {
      "name": "repository-name",
      "description": "Repository description",
      "url": "https://github.com/developer/repository-name"
    }
  }
]

安装

先决条件

  • Python 3.12

安装步骤

安装软件包:

pip install mcp-github-trending

Claude桌面配置

在MacOS上:

~/Library/Application\ Support/Claude/claude_desktop_config.json

在Windows上:

%APPDATA%/Claude/claude_desktop_config.json
Development/Unpublished Servers Configuration
{
  "mcpServers": {
    "mcp-github-trending": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/mcp-github-trending",
        "run",
        "mcp-github-trending"
      ]
    }
  }
}
Published Servers Configuration
{
  "mcpServers": {
    "mcp-github-trending": {
      "command": "uvx",
      "args": [
        "mcp-github-trending"
      ]
    }
  }
}

发展

建筑与出版

  1. 同步依赖关系并更新锁文件:
uv sync
  1. 构建包分发:
uv build
  1. 发布到PyPI:
uv publish

注意:通过环境变量或命令标志设置PyPI凭据:

  • 令牌: --token 或 UV_PUBLISH_TOKEN
  • 用户名/密码: --username/UV_PUBLISH_USERNAME 和 --password/UV_PUBLISH_PASSWORD

调试

为了获得最佳的调试体验,请使用 MCP检查员.

通过以下方式启动MCP检查器 npm:

npx @modelcontextprotocol/inspector uv --directory /path/to/mcp-github-trending run mcp-github-trending

检查器将显示一个URL,您可以在浏览器中访问该URL以开始调试。

许可证

此项目根据MIT许可证获得许可-请参阅 许可证 文件以获取详细信息。