- Explore MCP Servers
- mcp-github-server
Mcp Github Server
What is Mcp Github Server
mcp-github-server is a server designed for interacting with the GitHub API, providing a user-friendly interface for managing GitHub repositories.
Use cases
Use cases include fetching user repositories, creating new repositories, managing file contents, creating branches, and committing changes to repositories.
How to use
To use mcp-github-server, clone the repository, install dependencies, create a .env file with your GitHub token, and run the server in development or production mode using npm commands.
Key features
Key features include API endpoints for managing repositories, files, branches, and commits, as well as a health check endpoint to verify server status.
Where to use
mcp-github-server can be used in software development environments, particularly for projects that require integration with GitHub for version control and collaboration.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Overview
What is Mcp Github Server
mcp-github-server is a server designed for interacting with the GitHub API, providing a user-friendly interface for managing GitHub repositories.
Use cases
Use cases include fetching user repositories, creating new repositories, managing file contents, creating branches, and committing changes to repositories.
How to use
To use mcp-github-server, clone the repository, install dependencies, create a .env file with your GitHub token, and run the server in development or production mode using npm commands.
Key features
Key features include API endpoints for managing repositories, files, branches, and commits, as well as a health check endpoint to verify server status.
Where to use
mcp-github-server can be used in software development environments, particularly for projects that require integration with GitHub for version control and collaboration.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Content
MCP GitHub Server
Сервер для работы с GitHub API, предоставляющий удобный интерфейс для взаимодействия с репозиториями GitHub.
Установка
- Клонируйте репозиторий:
git clone https://github.com/fills/mcp-github-server.git cd mcp-github-server
- Установите зависимости:
npm install
- Создайте файл
.envв корне проекта и добавьте следующие переменные:
PORT=3000 GITHUB_TOKEN=your_github_token_here
Для получения GitHub токена:
- Перейдите в настройки вашего аккаунта GitHub
- Выберите “Developer settings” -> “Personal access tokens” -> “Tokens (classic)”
- Нажмите “Generate new token”
- Выберите необходимые разрешения (рекомендуется: repo, user)
- Скопируйте токен и вставьте его в файл .env
Запуск
Для запуска в режиме разработки:
npm run dev
Для запуска в продакшн режиме:
npm start
API Endpoints
Базовый маршрут
GET /- Проверка работоспособности сервера
Репозитории
GET /api/repos/:username- Получение списка репозиториев пользователяGET /api/repos/:username/:repo- Получение информации о конкретном репозиторииPOST /api/repos- Создание нового репозитория- Тело запроса:
{ "name": "repo-name", "description": "description", "private": false }
- Тело запроса:
Файлы
GET /api/repos/:username/:repo/contents/:path- Получение содержимого файла из репозиторияPOST /api/repos/:username/:repo/contents/:path- Создание нового файла в репозитории- Тело запроса:
{ "content": "file content", "message": "commit message" }
- Тело запроса:
Ветки
GET /api/repos/:username/:repo/branches- Получение списка веток репозиторияPOST /api/repos/:username/:repo/branches- Создание новой ветки в репозитории- Тело запроса:
{ "name": "branch-name", "sha": "commit-sha" }
- Тело запроса:
Коммиты
GET /api/repos/:username/:repo/commits- Получение списка коммитов репозитория- Параметры запроса:
sha,path,author,since,until,per_page,page
- Параметры запроса:
POST /api/repos/:username/:repo/commits- Создание нового коммита- Тело запроса:
{ "message": "commit message", "branch": "branch-name", "changes": { "path/to/file1.txt": "content of file1", "path/to/file2.txt": "content of file2" } }
Примеры использования
Получение списка репозиториев пользователя
GET http://localhost:3000/api/repos/octocat
Создание нового репозитория
POST http://localhost:3000/api/repos Content-Type: application/json { "name": "test-repo", "description": "Тестовый репозиторий", "private": true }
Создание файла в репозитории
POST http://localhost:3000/api/repos/username/repo-name/contents/path/to/file.txt Content-Type: application/json { "content": "Содержимое файла", "message": "Добавлен новый файл" }
Создание новой ветки
POST http://localhost:3000/api/repos/username/repo-name/branches Content-Type: application/json { "name": "feature-branch", "sha": "optional-commit-sha" }
Создание коммита с несколькими файлами
POST http://localhost:3000/api/repos/username/repo-name/commits Content-Type: application/json { "message": "Добавлены новые файлы", "branch": "feature-branch", "changes": { "file1.txt": "Содержимое файла 1", "dir/file2.txt": "Содержимое файла 2" } }
Dev Tools Supporting MCP
The following are the main code editors that support the Model Context Protocol. Click the link to visit the official website for more information.










