GitHub Repo MCP

GitHub Repo MCP

Browse and access GitHub repositories through any MCP-compatible client.

20
Stars
10
Forks
20
Watchers
1
Issues
GitHub Repo MCP enables AI assistants and clients to explore GitHub repositories by navigating directories and viewing file contents using the Model Context Protocol (MCP). It is compatible with popular MCP clients such as Cursor, Windsurf, and Claude Desktop via the stdio protocol. The server provides tools to list repository directories and fetch file content, allowing for streamlined repository browsing in AI-powered workflows. Installation is straightforward via NPX, Smithery, or direct configuration in MCP-capable IDEs.

Key Features

Compatible with multiple MCP clients including Cursor, Windsurf, and Claude Desktop
Browse contents of any public GitHub repository
Navigate repository directories and subdirectories
View content of code and text files directly
Supports installation via NPX, Smithery, or config files
Optional GitHub token support for higher API rate limits
Provides contextual tools: list directories, list files, fetch file content
Open-source and cross-platform
Easy setup with environment variable configuration
Integrates with AI models for contextual source retrieval

Use Cases

Assisting AI developers in retrieving context from GitHub repositories
Allowing AI writing tools to access live code or documentation
Powering code exploration features in IDEs or chat assistants
Enabling AI workflows that require real-time access to project files
Integrating source code browsing in AI copilots
Supporting technical documentation generation from actual repository contents
Facilitating code reviews and navigation via automated tools
Enhancing context awareness for AI-driven search and summarization
Automating repository exploration for onboarding or research
Improving AI model understanding by linking queries to actual code assets

README

GitHub Repo MCP

smithery badge

Table of contents

✨ 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

bash
npx github-repo-mcp

Windows NPX

bash
cmd /c npx -y github-repo-mcp

Windows NPX via .cursor/mcp.json

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)

bash
# Find the full path to npx first
which npx
json
{
  "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:

bash
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)

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:
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.

  • Parameters:
    • repoUrl: The URL of the GitHub repository (e.g., "https://github.com/owner/repo")

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! ☺️

Star History

Star History Chart

Repository Owner

Ryan0204
Ryan0204

User

Repository Details

Language JavaScript
Default Branch main
Size 42 KB
Contributors 3
License MIT License
MCP Verified Nov 12, 2025

Programming Languages

JavaScript
87.35%
Dockerfile
12.65%

Tags

Topics

github github-mcp github-mcp-server mcp mcp-github mcp-server

Join Our Newsletter

Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.

We respect your privacy. Unsubscribe at any time.

Related MCPs

Discover similar Model Context Protocol servers

  • Gitingest-MCP

    Gitingest-MCP

    An MCP server for extracting GitHub repository summaries, structure, and file content.

    Gitingest-MCP serves as a Model Context Protocol (MCP) server compatible with context-aware AI tools. It enables MCP clients such as Claude Desktop, Cline, Cursor, and others to quickly and efficiently extract key information from GitHub repositories, including summaries, the directory tree, and individual file contents. It supports installation via Smithery or manual configuration and is designed for seamless integration into the MCP client ecosystem. Documentation provides guidance on installation, configuration, and debugging.

    • 131
    • MCP
    • puravparab/Gitingest-MCP
  • GitHub MCP Server

    GitHub MCP Server

    Connect AI tools directly to GitHub for repository, issue, and workflow management via natural language.

    GitHub MCP Server enables AI tools such as agents, assistants, and chatbots to interact natively with the GitHub platform. It allows these tools to access repositories, analyze code, manage issues and pull requests, and automate workflows using the Model Context Protocol (MCP). The server supports integration with multiple hosts, including VS Code and other popular IDEs, and can operate both remotely and locally. Built for developers seeking to enhance AI-powered development workflows through seamless GitHub context access.

    • 24,418
    • MCP
    • github/github-mcp-server
  • GitHub Repos Manager MCP Server

    GitHub Repos Manager MCP Server

    Token-based, high-performance GitHub automation for MCP clients.

    GitHub Repos Manager MCP Server offers a comprehensive Model Context Protocol (MCP) server for managing GitHub repositories via direct API integration. It enables MCP clients such as Claude Desktop, Roo Code, and Cursor to automate GitHub workflows using just a personal access token, without the need for Docker. With 89 tools, users can handle repository management, issue tracking, collaboration, and advanced configuration with fine-grained control. The server is optimized for simplicity, security, and powerful automation through flexible tool management and granular access permissions.

    • 13
    • MCP
    • kurdin/github-repos-manager-mcp
  • mcp-git-ingest

    mcp-git-ingest

    MCP server for exploring GitHub repository structures and key files.

    mcp-git-ingest is a Model Context Protocol (MCP) server designed to programmatically read and visualize GitHub repository structures and retrieve important file contents. It leverages fastmcp for server functionality and gitpython for repository operations, ensuring robust error handling and cleanup. The tool offers commands to generate directory trees and fetch specified files, making it suitable for integrating repository context into AI workflows.

    • 286
    • MCP
    • adhikasp/mcp-git-ingest
  • Driflyte MCP Server

    Driflyte MCP Server

    Bridging AI assistants with deep, topic-aware knowledge from web and code sources.

    Driflyte MCP Server acts as a bridge between AI-powered assistants and diverse, topic-aware content sources by exposing a Model Context Protocol (MCP) server. It enables retrieval-augmented generation workflows by crawling, indexing, and serving topic-specific documents from web pages and GitHub repositories. The system is extensible, with planned support for additional knowledge sources, and is designed for easy integration with popular AI tools such as ChatGPT, Claude, and VS Code.

    • 9
    • MCP
    • serkan-ozal/driflyte-mcp-server
  • GistPad MCP

    GistPad MCP

    Manage and share personal knowledge and reusable prompts via GitHub Gists with MCP compatibility.

    GistPad MCP is an MCP server designed for managing, organizing, and sharing personal knowledge, daily notes, reusable prompts, and more through GitHub Gists. It integrates with clients like the GistPad VS Code extension and web apps, allowing users to interact with their gists using standardized MCP tools across MCP-enabled AI products. The project features comprehensive gist management, daily notes, collaboration, and prompt creation to streamline knowledge workflows with AI-enabled context. Seamless onboarding is supported via personal access tokens and simple configuration.

    • 168
    • MCP
    • lostintangent/gistpad-mcp
  • Didn't find tool you were looking for?

    Be as detailed as possible for better results