Integrations
Provides access to GitHub repository contents, allowing browsing and reading files from specified repositories, navigating directories, and supporting branch-specific file access.
MCP GitHub Repository Server
An MCP (Model Context Protocol) server that provides access to GitHub repository contents. This server allows AI assistants to browse and read files from specified GitHub repositories.
Demo
Features
Resources
- Access any file in a GitHub repository via URI
- List repository contents and navigate directories
- Support for branch-specific file access
- File contents are served as plain text
Resource URIs
- Base URL format:
https://api.github.com/repos/{owner}/{repo}/contents/{path}
- Supports both files and directories
- Files are served with
text/plain
MIME type - Directories are served with
application/x-directory
MIME type
Configuration
The server requires the following environment variables:
Development
Install dependencies:
Build the server:
For development with auto-rebuild:
Installation
To use with Claude Desktop, add the server configuration:
Config Location
- MacOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%/Claude/claude_desktop_config.json
API Implementation
The server implements three main MCP endpoints:
ListResources
- Lists files and directories in the repositoryReadResource
- Retrieves contents of a specific file
Authentication
The server uses GitHub Personal Access Token for authentication. Make sure your token has appropriate permissions to access the repository contents.
Error Handling
The server includes error handling for:
- Missing environment variables
- GitHub API errors
- Invalid paths (e.g., trying to read a directory as a file)
- Authentication failures
Debugging
Since MCP servers communicate over stdio, debugging can be challenging. Use the MCP Inspector for debugging:
This will provide a URL to access debugging tools in your browser.
Security Notes
- Keep your GitHub Personal Access Token secure
- Consider using tokens with minimal required permissions
- Be aware of repository size limitations when accessing large repositories
License
MIT
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
A server that allows AI assistants to browse and read files from specified GitHub repositories, providing access to repository contents via the Model Context Protocol.
Related Resources
Related MCP Servers
- -securityAlicense-qualityA Model Context Protocol server that enables AI agents to retrieve and understand entire codebases at once, providing tools to analyze local workspaces or remote GitHub repositories.Last updated -9TypeScriptMIT License
- AsecurityFlicenseAqualityA Model Context Protocol server that enables AI models to interact with GitHub's API, allowing for repository creation and management with descriptions, topics, and website URLs through natural language commands.Last updated -1JavaScript
- -securityFlicense-qualityA Model Context Protocol server that enables AI assistants like Claude to interact with GitHub repositories, issues, and pull requests.Last updated -129Python
- -securityFlicense-qualityA Model Context Protocol server that enables AI assistants to perform GitHub operations including repository management, file operations, issue tracking, and pull request creation.Last updated -1TypeScript