SuperAPI AI Directory

github-repo-mcp

Browse GitHub repositories, explore directories and view file contents.

Open website

About this tool

GitHub Repo MCP is an open-source Model Context Protocol (MCP) server designed to enable AI assistants to browse GitHub repositories, explore directories, and view file contents. It is compatible with Cursor, Windsurf, Claude Desktop, and other MCP clients that support the stdio protocol.

Main Capabilities

The server provides three main tools:

  1. List repository root directory: Lists all files and directories in the root directory of a GitHub repository. The parameter is repoUrl (repository URL, for example "https://github.com/owner/repo")。
  2. List contents of a specified directory: Lists the contents of a specific directory in the repository. The parameters are repoUrl and path (directory path, for example "src").
  3. Get file contents: Retrieves and displays the contents of a specific file in the repository. The parameters are repoUrl and path (file path, for example "src/index.js").

Usage

Installation can be done through Smithery, NPX, or by configuring it directly in the IDE's mcp.json. For example, install automatically for Claude Desktop through Smithery. During configuration, you can use a GitHub token to increase the rate limit for accessing the GitHub API. Although the server works without authentication, unauthenticated requests have a lower rate limit (60 requests per hour). To increase the rate limit, you need to create a personal access token at https://github.com/settings/tokens and set it as an environment variable in mcp.json.

Usage examples:

  • Browse the repository root directory: Ask the AI assistant to "show the contents of the https://github.com/Ryan0204/github-repo-mcp repository".
  • Explore a specific directory: Ask "what files are in the src directory ofhttps://github.com/Ryan0204/github-repo-mcp ?"
  • View a file: Ask "show the README.md file of https://github.com/Ryan0204/github-repo-mcp ".

Applicable Scenarios

Suitable for development scenarios that require AI assistants to directly read and analyze GitHub repository contents, such as code review, project exploration, documentation lookup, and more.

Limitations

  • Rate limits: The GitHub API has strict limits when unauthenticated (60 requests per hour).
  • Private repositories: Unless a token with appropriate permissions is provided, only public repositories can be accessed.
  • Binary files: The server detects common binary file extensions and does not display their contents.
  • Large files: The GitHub API has limits on the size of files that can be retrieved.

Troubleshooting

Common issues include: rate limit exceeded (set a GitHub token), command not found (ensure the package is installed globally), connection errors (check network connection and GitHub API status). If you encounter problems, check the error output or create an issue in the GitHub repository.