Get the FREE Ultimate OpenClaw Setup Guide →

github-repo

Model Context Protocol server for Github Repo // Reading Github Repo

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio ryan0204-github-repo-mcp npx -y github-repo-mcp \
  --env GITHUB_TOKEN="Your_GitHub_Token_if_needed"

How to use

GitHub Repo MCP lets your AI assistant browse public GitHub repositories, navigate directories, and display file contents using a simple standard I/O protocol. It exposes three primary tools: getRepoAllDirectories, which lists the root contents of a repository; getRepoDirectories, which lists the items within a specific directory path; and getRepoFile, which fetches and displays the contents of a given file. This enables chat-based exploration of codebases, quick checks of file contents, and directory-wide navigation without leaving the chat interface. The server can be run via npx, Smithery, or integrated into your IDE via an mcp.json configuration, and it supports optional GitHub authentication to increase API rate limits when needed. When using authentication, set GITHUB_TOKEN to a personal access token to avoid low unauthenticated rate limits.

How to install

Prerequisites:

  • Node.js 18+ installed on your system
  • npm or yarn (comes with Node.js)
  • Optional: a GitHub Personal Access Token for higher API rate limits

Install and run via NPX (simplest):

  1. Ensure Node.js and npm/yarn are installed.
  2. Run:
npx -y github-repo-mcp

Install via Smithery (for Claude Desktop or managed deployments):

  1. Ensure Node.js installed.
  2. Run:
npx -y @smithery/cli install @Ryan0204/github-repo-mcp --client claude

Alternative: configure in your IDE's mcp.json (example):

{
  "mcpServers": {
    "github-repo-mcp": {
      "command": "npx",
      "args": ["-y", "github-repo-mcp"],
      "enabled": true
    }
  }
}

Optional GitHub token setup (for higher rate limits):

  1. Create a token at https://github.com/settings/tokens
  2. Add it to your mcp.json as an environment variable:
{
  "mcpServers": {
    "github-repo-mcp": {
      "command": "npx",
      "args": ["-y", "github-repo-mcp"],
      "env": {
        "GITHUB_TOKEN": "Your_Github_Token"
      },
      "enabled": true
    }
  }
}

Additional notes

Tips and common considerations:

  • GITHUB_TOKEN is optional but recommended for higher API rate limits; unauthenticated requests are rate-limited.
  • The server interacts with public repositories by default; private repos require a token with appropriate permissions.
  • If you encounter command-not-found errors, ensure the MCP server package is installed globally or available in the execution environment (via npx or your IDE's integration).
  • The three main tools (getRepoAllDirectories, getRepoDirectories, getRepoFile) support standard parameters as described in the feature section of the README; use repoUrl (e.g., https://github.com/owner/repo) and paths like src or README.md to fetch data.
  • When using Windows with WSL or similar environments, you may need to adjust the command paths to point to the correct npx binary in your Windows/Linux interop setup.

Related MCP Servers

Sponsor this space

Reach thousands of developers