返回市场
MCP-GitHub趋势

MCP-GitHub趋势

作者:hetaoBackend37 星标更新:2025-04-01

项目介绍

mcp-github-trending MCP 服务器

一个通过简单API接口提供访问GitHub热门仓库和开发者数据的MCP服务器。

smithery 徽章

功能

  • 访问GitHub热门仓库和开发者数据
  • 按编程语言筛选
  • 按时间段筛选(每日、每周、每月)
  • 按口语语言筛选
  • 返回格式良好的JSON响应

工具

该服务器实现了以下工具:

get_github_trending_repositories

从GitHub获取热门仓库,参数如下:

  • language(可选):用于筛选仓库的编程语言(例如:"python","javascript")
  • since(可选):用于筛选仓库的时间段("daily","weekly","monthly")。默认为"daily"
  • 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_trending_developers

从GitHub获取热门开发者,参数如下:

  • language(可选):用于筛选的编程语言(例如:"python","javascript")
  • since(可选):用于筛选的时间段("daily","weekly","monthly")。默认为"daily"

示例响应:

[
  {
    "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 Desktop 配置

在MacOS上:

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

在Windows上:

%APPDATA%/Claude/claude_desktop_config.json
<details> <summary>开发/未发布服务器配置</summary>
{
  "mcpServers": {
    "mcp-github-trending": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/mcp-github-trending",
        "run",
        "mcp-github-trending"
      ]
    }
  }
}
</details> <details> <summary>已发布服务器配置</summary>
{
  "mcpServers": {
    "mcp-github-trending": {
      "command": "uvx",
      "args": [
        "mcp-github-trending"
      ]
    }
  }
}
</details>

开发

构建和发布

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

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

  • Token:--tokenUV_PUBLISH_TOKEN
  • 用户名/密码:--username/UV_PUBLISH_USERNAME--password/UV_PUBLISH_PASSWORD

调试

为了获得最佳调试体验,请使用MCP Inspector

通过npm启动MCP Inspector:

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

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

许可证

本项目根据MIT许可证授权 - 查看LICENSE文件以获取详细信息。 </中文翻译>