MCP GitHub Repository Server
MCP GitHub 存储库服务器
一个 MCP(模型上下文协议)服务器,提供对 GitHub 仓库内容的访问。该服务器允许 AI 助手浏览和读取指定 GitHub 仓库中的文件。
演示

Related MCP server: GitHub MCP Server
特征
资源
通过 URI 访问 GitHub 存储库中的任何文件
列出存储库内容并导航目录
支持特定分支的文件访问
文件内容以纯文本形式提供
资源 URI
基本 URL 格式:
https://api.github.com/repos/{owner}/{repo}/contents/{path}支持文件和目录
文件以
text/plainMIME 类型提供目录采用
application/x-directoryMIME 类型
配置
服务器需要以下环境变量:
GITHUB_PERSONAL_ACCESS_TOKEN=your_github_token
GITHUB_OWNER=repository_owner
GITHUB_REPO=repository_name
GITHUB_BRANCH=branch_name # Optional发展
安装依赖项:
npm install构建服务器:
npm run build对于使用自动重建的开发:
npm run watch安装
要与 Claude Desktop 一起使用,请添加服务器配置:
配置位置
MacOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"mcp-server-github-repo": {
"command": "/path/to/mcp-server-github-repo/build/index.js"
}
}
}API 实现
该服务器实现了三个主要的 MCP 端点:
ListResources列出存储库中的文件和目录ReadResource检索特定文件的内容
验证
服务器使用 GitHub 个人访问令牌进行身份验证。请确保您的令牌具有访问存储库内容的适当权限。
错误处理
服务器包括以下错误处理:
缺少环境变量
GitHub API 错误
无效路径(例如,尝试将目录读取为文件)
身份验证失败
调试
由于 MCP 服务器通过 stdio 进行通信,调试起来可能比较困难。请使用 MCP Inspector 进行调试:
npm run inspector这将提供一个 URL 来访问浏览器中的调试工具。
安全说明
确保您的 GitHub 个人访问令牌安全
考虑使用具有最低所需权限的令牌
访问大型存储库时请注意存储库大小限制
执照
麻省理工学院
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityFmaintenanceA 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.34083MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables AI assistants like Claude to interact with GitHub repositories, issues, and pull requests.18MIT
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables AI assistants to perform GitHub operations including repository management, file operations, issue tracking, and pull request creation.2
- FlicenseNot gradedqualityNot gradedmaintenanceModel Context Protocol server that enables interaction with GitHub repositories, issues, pull requests, and search functionality through natural language.1
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
An MCP server that gives your AI access to the source code and docs of all public github repos
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/loglmhq/mcp-server-github-repo'
If you have feedback or need assistance with the MCP directory API, please join our Discord server