RG

ryan0204/github-repo-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

33 stars 15 forks 质量 84 趋势 19MIT

Github仓库的模型上下文协议服务器 // 阅读GitHub仓库

概览

GitHub Repo MCP 是一个开源的 MCP 服务器,允许你的 AI 助手浏览 GitHub 仓库、探索目录并查看文件内容。 - 💻 兼容 Cursor、Windsurf、Claude Desktop 及其他支持 stdio 协议的 MCP 客户端 - 🔎 浏览任意公共 GitHub 仓库内容 - 📂 浏览仓库目录和子目录 - 📝 查看代码和文本文件内容 - 📦 通过包管理器轻松安装 安装服务器需要在你的系统上完成以下条件:- Node.js 18+ - npm或纱线 你可以用 Smithery、NPX 或 IDE mcp.json设置安装并运行 GitHub Repo MCP: 通过 Smithery 自动安装 GitHub Repo MCP for Claude Desktop: 如果没有识别,可以等几秒或者点击几次刷新按钮。如果还是无法识别,确认输入了正确的命令。 GitHub Repo MCP 服务器在访问 GitHub API 时可以使用 GitHub 令牌以实现更高的速率限制。

概述(AI 翻译)

GitHub Repo MCP 是一个开源的 MCP 服务器,允许你的 AI 助手浏览 GitHub 仓库、探索目录并查看文件内容。

目录

入门 • 功能概述

✨ 主要特征

  • 💻 兼容光标、Windsurf、Claude Desktop 及其他支持 stdio 协议的 MCP 客户端
  • 🔎 浏览任何公共 GitHub 仓库的内容
  • 📂 浏览仓库目录和子目录
  • 📝 查看代码和文本文件的内容
  • 📦 通过包管理器轻松安装

开始

先决条件

安装服务器需要在你的系统上完成以下操作:

  • Node.js 18+
  • NPM或纱线

第一步。安装

你可以用 Smithery、NPX 或 IDE mcp.json设置安装并运行 GitHub Repo MCP:

MacOS

Windows NPX

Windows NPX 通过 .cursor/mcp.json

Windows NPX 通过 .cursor/mcp.json(如果路径未设置)

通过Smithery安装

通过 Smithery 自动安装 GitHub Repo MCP for Claude Desktop:

如果没有识别,可以等几秒或者点击几次刷新按钮。如果还是无法识别,确认输入了正确的命令。

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

GitHub Repo MCP

GitHub Repo MCP is an open-source MCP server that lets your AI assistants browse GitHub repositories, explore directories, and view file contents.

Table of contents

Getting started • Feature overview

✨ Key features

  • 💻 Compatible with Cursor, Windsurf, Claude Desktop, and other MCP clients supporting stdio protocol
  • 🔎 Browse the contents of any public GitHub repository
  • 📂 Navigate through repository directories and subdirectories
  • 📝 View the content of code and text files
  • 📦 Easy installation via package manager

Getting Started

Prerequisites

Installing the server requires the following on your system:

  • Node.js 18+
  • npm or yarn

Step 1. Installation

You can install and run GitHub Repo MCP using Smithery, NPX, or setting in mcp.json of your IDE:

MacOS

npx github-repo-mcp

Windows NPX

cmd /c npx -y github-repo-mcp

Windows NPX via .cursor/mcp.json

{
  "mcpServers": {
    "github-repo-mcp": {
      "command": "wsl",
      "args": [
        "bash",
        "-c",
        "cmd /c npx -y github-repo-mcp"
      ],
      "enabled": true
    }
  }
}

Windows NPX via .cursor/mcp.json (if path not set)

# Find the full path to npx first
which npx
{
  "mcpServers": {
    "github-repo-mcp": {
      "command": "wsl",
      "args": [
        "bash",
        "-c",
        "'/home/[username]/.nvm/versions/node/v20.18.0/bin/npx github-repo-mcp'"
      ],
      "enabled": true
    }
  }
}

Installing via Smithery

To install GitHub Repo MCP for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @Ryan0204/github-repo-mcp --client claude

Wait a few seconds or click on the refresh button a few times if it does not register. If it still won’t register, make sure you entered the right command.

Step 2. Configuration

The GitHub Repo MCP server can use a GitHub token for higher rate limits when accessing the GitHub API.

Environment Variables

Variable Required Default Description
GITHUB_TOKEN No None Your GitHub personal access token for higher rate limits

Setting Up a GitHub Token (Optional)

在 GitHub 查看完整 README

安装

npx github-repo-mcp
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "github-repo-mcp": { "command": "wsl", "args": [ "bash", "-c", "cmd /c npx -y github-repo-mcp" ], "enabled": true } } }