MCP GitHub Server
MCP GitHub Server
Расширяемый MCP HTTP-сервер для GitHub API с модульной архитектурой и автоматическим обнаружением инструментов.
Возможности
Сервер предоставляет 19 инструментов для работы с GitHub:
📁 Работа с файлами (4)
Инструмент | Описание |
| Чтение содержимого файлов из репозитория |
| Создание и обновление текстовых файлов |
| Создание и обновление бинарных файлов (base64) |
| Удаление файлов (автоматически получает SHA) |
📝 Коммиты (2)
Инструмент | Описание |
| Список последних коммитов |
| Статус проверок для коммита |
⚙️ Workflow (7)
Инструмент | Описание |
| Ошибка последней сборки |
| Логи конкретного запуска workflow |
| Полные логи всех jobs запуска |
| Запуски workflow по имени YAML-файла |
| Список запусков с run_id и статусами |
| run_id последнего запуска |
| Список всех шагов в запуске с их статусами |
🏗️ Сборка и отладка (6)
Инструмент | Описание |
| Мониторинг сборки |
| Авто-исправление ошибок сборки (Android/iOS) |
| Детальная ошибка Android сборки |
| Детальная ошибка iOS сборки |
| Логи конкретного шага по имени |
| Создание/обновление с авто-получением SHA |
Related MCP server: git-mcp
Установка
git clone https://github.com/LeonidYasin/mcp-server.git
cd mcp-server
pip install flask httpx python-dotenv flask-corsЗапуск
python -m mcp_server.serverСервер запускается на http://0.0.0.0:3001, эндпоинт MCP: POST /mcp.
Токен GitHub передаётся через заголовок Authorization: Bearer <token>.
Подключение к DeepSeek++
В настройках плагина DeepSeek++:
URL:
http://127.0.0.1:3001/mcpТип: HTTP
Заголовок:
Authorization: Bearer <ваш_github_token>
Структура проекта
mcp-server/
├── pyproject.toml
├── README.md
└── mcp_server/
├── __init__.py
├── server.py # Flask HTTP-сервер
├── core/
│ ├── __init__.py
│ ├── tool.py # Tool dataclass
│ └── registry.py # ToolRegistry с авто-обнаружением
└── tools/
├── __init__.py
└── github/
├── __init__.py # Экспорт инструментов
├── client.py # GitHub API HTTP-клиент
├── file_ops.py # get_file_contents, create_or_update_file, delete_file
├── file_sha_ops.py # create_or_update_file_with_sha
├── create_update_binary.py # create_or_update_binary_file
├── commits.py # list_commits, get_commit_status
├── workflows.py # workflow-инструменты (4 шт)
├── workflow_runs.py # list_workflow_runs, get_latest_run_id, get_workflow_run_steps, get_run_logs_by_step
├── build_logs.py # watch_build
├── build_logs_loader.py # auto_fix_build, get_android_build_error, get_ios_build_error
└── build_logs_tools.py # вспомогательные функции для сборкиКак добавить новый инструмент
Шаг 1: Создайте файл в mcp_server/tools/github/
Пример: mcp_server/tools/github/create_branch.py
"""MCP tool: create_branch - создаёт новую ветку."""
from mcp_server.core.registry import mcp_tool
from mcp_server.tools.github.client import GitHubClient
@mcp_tool(
name="create_branch",
description="Создаёт новую ветку в репозитории",
parameters={
"owner": {"type": "string", "description": "Владелец репозитория"},
"repo": {"type": "string", "description": "Имя репозитория"},
"branch": {"type": "string", "description": "Имя новой ветки"},
"from_branch": {"type": "string", "description": "Источник (по умолчанию main)"},
},
required=["owner", "repo", "branch"],
)
def create_branch(client: GitHubClient, owner: str, repo: str, branch: str, from_branch: str = "main") -> dict:
"""Создать новую ветку."""
# 1. Получаем SHA родительской ветки
ref_resp = client._request(
"GET", f"/repos/{owner}/{repo}/git/ref/heads/{from_branch}"
)
sha = ref_resp.json()["object"]["sha"]
# 2. Создаём ветку
client._request(
"POST",
f"/repos/{owner}/{repo}/git/refs",
json={"ref": f"refs/heads/{branch}", "sha": sha},
)
return {
"content": [{
"type": "text",
"text": f"✅ Ветка '{branch}' создана из '{from_branch}'"
}]
}Шаг 2: Экспортируйте инструмент
В mcp_server/tools/github/__init__.py добавьте строку:
from mcp_server.tools.github.create_branch import create_branchШаг 3: Перезапустите сервер
# Остановите Ctrl+C и снова запустите
python -m mcp_server.serverИнструмент автоматически появится в списке. Никакой другой настройки не требуется.
Как работает авто-обнаружение
ToolRegistry (в mcp_server/core/registry.py) при запуске:
Сканирует
mcp_server/tools/Находит все подпакеты (директории с
__init__.py)Импортирует их и ищет функции с декоратором
@mcp_toolРегистрирует найденные инструменты
Правила написания инструментов
Функция должна быть синхронной и принимать
client: GitHubClientпервым аргументомДекоратор
@mcp_toolзадаёт:name— имя инструмента (как будет вызываться)description— описание для AI-ассистентаparameters— словарь параметров в формате JSON Schemarequired— список обязательных параметров
Возвращать нужно
dictс ключомcontent— списком объектов{"type": "text", "text": "..."}Для запросов к GitHub API используйте
client._request(method, path, ...)
Шаблон для копирования
"""MCP tool: имя_инструмента - краткое описание."""
from mcp_server.core.registry import mcp_tool
from mcp_server.tools.github.client import GitHubClient
@mcp_tool(
name="имя_инструмента",
description="Что делает инструмент",
parameters={
"owner": {"type": "string", "description": "Владелец репозитория"},
"repo": {"type": "string", "description": "Имя репозитория"},
},
required=["owner", "repo"],
)
def имя_инструмента(client: GitHubClient, owner: str, repo: str) -> dict:
# Ваш код здесь
return {
"content": [{"type": "text", "text": "Результат работы"}]
}Требования к GitHub токену
Токен должен иметь следующие разрешения (scopes):
repo(илиContents: Read and write) — для работы с файламиActions: Read— для просмотра workflowMetadata: Read— для базовой информации (обычно по умолчанию)
Тестирование сервера через curl
# Проверка списка инструментов
curl -X POST http://127.0.0.1:3001/mcp \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <токен>" \
-d '{"jsonrpc":"2.0","id":"1","method":"tools/list","params":{}}'
# Чтение файла
curl -X POST http://127.0.0.1:3001/mcp \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <токен>" \
-d '{"jsonrpc":"2.0","id":"2","method":"tools/call","params":{"name":"get_file_contents","arguments":{"owner":"LeonidYasin","repo":"mcp-server","path":"README.md"}}}'Версионирование
v0.1.0 — stdio-транспорт, базовая модульная архитектура
v0.2.0 — Flask HTTP-транспорт, 10 инструментов, авто-обнаружение, инструкция для разработчиков
v0.3.0 — Добавлены 9 новых инструментов: всего 19, включая работу с workflow, сборкой и отладкой
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 Connectors
Create, deploy, and operate MCP servers directly from your GitHub repositories.
A MCP server built for developers enabling Git based project management with project and personal…
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
MCP server for siGit (sigit.si): browse repos, search code, manage PRs/issues, web search.
Related MCP Servers
- -licenseNot gradedqualityAmaintenanceMCP Server for the GitHub API, enabling file operations, repository management, search functionality, and more.117,29690,042MIT
- FlicenseNot gradedqualityDmaintenanceStandalone MCP server for GitHub that enables repository management, branch operations, pull request handling, and commit retrieval via tools listed in the README.1
- AlicenseBqualityDmaintenanceMCP (Model Context Protocol) server for GitHub API integration. This server provides comprehensive tools for interacting with GitHub repositories, issues, pull requests, branches, and code search through a unified interface.1514MIT
- FlicenseNot gradedqualityBmaintenanceA lightweight MCP server that exposes GitHub operations as tools over HTTP, enabling any MCP-compatible client to interact with GitHub repositories without a built-in connector.1
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/LeonidYasin/mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server