Skip to main content
Glama
Ryan0204

github-repo-mcp

by Ryan0204
README.md
# GitHub Repo MCP
[![Trust Score](https://archestra.ai/mcp-catalog/api/badge/quality/Ryan0204/github-repo-mcp)](https://archestra.ai/mcp-catalog/ryan0204__github-repo-mcp)

[![LightNow capabilities](https://lightnow.ai/badge/io.github.ryan0204/github-repo-mcp)](https://lightnow.ai/servers/io.github.ryan0204/github-repo-mcp)

<p class="center-text">
  <strong>GitHub Repo MCP is an open-source MCP server that lets your AI assistants browse GitHub repositories, explore directories, and view file contents.</strong>
</p>

<a href="https://glama.ai/mcp/servers/@Ryan0204/github-repo-mcp">
  <img width="380" height="200" src="https://glama.ai/mcp/servers/@Ryan0204/github-repo-mcp/badge" alt="github-repo-mcp MCP server" />
</a>

## Table of contents

<p class="center-text">
  <a href="#getting-started">Getting started</a> β€’
  <a href="#feature-overview">Feature overview</a>
</p>

## ✨ 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](https://smithery.ai/server/@Ryan0204/github-repo-mcp):

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

TDQS

D1.4/5.0

Scored across 3 tools

Disambiguation2/5

The tools have overlapping purposes with unclear boundaries: getRepoAllDirectories and getRepoDirectories appear to serve similar directory-related functions without descriptions to clarify their differences, while getRepoFile is distinct but the directory tools are ambiguous. This overlap will likely cause misselection between the two directory tools.

Naming Consistency4/5

The naming follows a consistent camelCase pattern (getRepoAllDirectories, getRepoDirectories, getRepoFile) with a clear verb_noun structure, though the lack of descriptions makes it harder to assess intent. There are no deviations in style, but the similarity in names for the directory tools slightly reduces clarity.

Tool Count2/5

With only 3 tools, this server feels thin for a GitHub repository domain, as it lacks essential operations like create, update, delete, or search. The limited scope suggests incomplete coverage, making it difficult for agents to perform comprehensive repository management tasks.

Completeness1/5

The tool surface is severely incomplete for a GitHub repository server: it only includes retrieval tools for directories and files, missing core CRUD operations (e.g., create repo, update files, delete items), search functionality, and lifecycle management. This will cause significant agent failures in handling typical repository workflows.

Maintenance

ActivityMaintained
ResponsivenessNo issues