Sponsored by Deepsite.site

GitHub Repo MCP

Created By
Ryan02048 months ago
Model Context Protocol server for Github Repo // Reading Github Repo
Content

GitHub Repo MCP

smithery badge

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

github-repo-mcp MCP server

Table of contents

Getting startedFeature 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

VariableRequiredDefaultDescription
GITHUB_TOKENNoNoneYour GitHub personal access token for higher rate limits

Setting Up a GitHub Token (Optional)

While the server works without authentication, GitHub API has rate limits that are much lower for unauthenticated requests. To increase your rate limit:

  1. Create a personal access token at https://github.com/settings/tokens
  2. Set the token as an environment variable in mcp.json:
{
  "mcpServers": {
    "github-repo-mcp": {
      "command": "...",
      "args": [
        ...
      ],
      "env": {
        "GITHUB_TOKEN": "Your_Github_Token"
      }
      "enabled": true,
    }
  }
}

Feature Overview

Repository Browsing Tools

The server provides three main tools for interacting with GitHub repositories:

1. getRepoAllDirectories

Lists all files and directories at the root of a GitHub repository.

2. getRepoDirectories

Lists contents of a specific directory in a GitHub repository.

  • Parameters:
    • repoUrl: The URL of the GitHub repository
    • path: The directory path to fetch (e.g., "src")

3. getRepoFile

Retrieves and displays the content of a specific file from a GitHub repository.

  • Parameters:
    • repoUrl: The URL of the GitHub repository
    • path: The file path to fetch (e.g., "src/index.js")

Usage Examples

Here are some examples of how to use these tools with an AI assistant:

  1. Browsing a repository root: Ask your AI assistant to "Show me the contents of the repository at https://github.com/Ryan0204/github-repo-mcp"

  2. Exploring a specific directory: Ask "What files are in the src directory of https://github.com/Ryan0204/github-repo-mcp?"

  3. Viewing a file: Ask "Show me the README.md file from https://github.com/Ryan0204/github-repo-mcp"

Limitations

  • Rate Limiting: Without authentication, GitHub API has strict rate limits (60 requests per hour)
  • Private Repositories: Can only access public repositories unless a token with appropriate permissions is provided
  • Binary Files: The server detects common binary file extensions and won't display their contents
  • Large Files: GitHub API has limitations on the size of files that can be retrieved

Troubleshooting

Here are some common issues and their solutions:

  • Rate limit exceeded: Set up a GitHub token as described in the Configuration section
  • Command not found: Ensure the package is installed globally
  • Connection errors: Check your internet connection and GitHub API status

If you encounter any issues, please check the output for error messages or create an issue in the GitHub repository.


Enjoy! ☺️

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
WindsurfThe new purpose-built IDE to harness magic
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Tavily Mcp
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Playwright McpPlaywright MCP server
Serper MCP ServerA Serper MCP Server
DeepChatYour AI Partner on Desktop
ChatWiseThe second fastest AI chatbot™
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
CursorThe AI Code Editor
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Amap Maps高德地图官方 MCP Server