mcp -github-repo
MCP server for interacting with a github repo
claude mcp add --transport stdio loglmhq-mcp-server-github-repo node /path/to/mcp-server-github-repo/build/index.js \ --env GITHUB_REPO="repository_name" \ --env GITHUB_OWNER="repository_owner" \ --env GITHUB_BRANCH="branch_name (optional)" \ --env GITHUB_PERSONAL_ACCESS_TOKEN="your_github_token"
How to use
This MCP server exposes access to a GitHub repository's contents through MCP endpoints. It lets you list the repository’s files and directories and read individual files from a specified owner/repo, with optional branch support. The server authenticates to GitHub using a Personal Access Token and streams file contents as plain text, suitable for use by AI assistants that need to browse or read repository data. Use ListResources to explore the repository structure and ReadResource to fetch the contents of a particular file. If you specify a branch via GITHUB_BRANCH, the server will serve contents from that branch when available.
How to install
Prerequisites:
- Node.js (and npm) installed
- Access to the GitHub repository you want to serve
Install and build:
- npm install
- npm run build
Optional for development with auto-rebuild: 3) npm run watch
Run (example):
- Ensure environment variables are set (see mcp_config):
- GITHUB_PERSONAL_ACCESS_TOKEN=your_github_token
- GITHUB_OWNER=repository_owner
- GITHUB_REPO=repository_name
- GITHUB_BRANCH=branch_name (optional)
- Start the server: node /path/to/mcp-server-github-repo/build/index.js
If integrating with Claude Desktop, place the generated config in Claude's config.json as shown in the README example.
Additional notes
Environment variables are required for authentication and repository details. Ensure your GitHub token has access to the target repository. Be mindful of rate limits on GitHub's API, especially for large repositories or frequent requests. For debugging, you can use the MCP Inspector tool (npm run inspector) to get a debugging URL. Directories are served with application/x-directory and files as text/plain. If you encounter authentication failures, double-check token permissions and token scope. When using different branches, verify that the branch exists in the repository and that the token has access to that branch.
Related MCP Servers
zen
Selfhosted notes app. Single golang binary, notes stored as markdown within SQLite, full-text search, very low resource usage
MCP -Deepseek_R1
A Model Context Protocol (MCP) server implementation connecting Claude Desktop with DeepSeek's language models (R1/V3)
mcp-fhir
A Model Context Protocol implementation for FHIR
mcp
Inkdrop Model Context Protocol Server
mcp-appium-gestures
This is a Model Context Protocol (MCP) server providing resources and tools for Appium mobile gestures using Actions API..
dubco -npm
The (Unofficial) dubco-mcp-server enables AI assistants to manage Dub.co short links via the Model Context Protocol. It provides three MCP tools: create_link for generating new short URLs, update_link for modifying existing links, and delete_link for removing short links.