Cover image
Try Now
2025-03-16

3 years

Works with Finder

1

Github Watches

0

Github Forks

1

Github Stars

MCP GitHub Server

Сервер для работы с GitHub API, предоставляющий удобный интерфейс для взаимодействия с репозиториями GitHub.

Установка

  1. Клонируйте репозиторий:
git clone https://github.com/fills/mcp-github-server.git
cd mcp-github-server
  1. Установите зависимости:
npm install
  1. Создайте файл .env в корне проекта и добавьте следующие переменные:
PORT=3000
GITHUB_TOKEN=your_github_token_here

Для получения GitHub токена:

  1. Перейдите в настройки вашего аккаунта GitHub
  2. Выберите "Developer settings" -> "Personal access tokens" -> "Tokens (classic)"
  3. Нажмите "Generate new token"
  4. Выберите необходимые разрешения (рекомендуется: repo, user)
  5. Скопируйте токен и вставьте его в файл .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"
  }
}

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Bora Yalcin
  • Evaluator for marketplace product descriptions, checks for relevancy and keyword stuffing.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Callycode Limited
  • A geek-themed horoscope generator blending Bitcoin prices, tech jargon, and astrological whimsy.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Khalid kalib
  • Write professional emails

  • Beniyam Berhanu
  • Therapist adept at identifying core issues and offering practical advice with images.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • OffchainLabs
  • 进行以太坊的实施

  • huahuayu
  • 统一的API网关,用于将多个Etherscan样区块链Explorer API与对AI助手的模型上下文协议(MCP)支持。

  • deemkeen
  • 用电源组合控制您的MBOT2:MQTT+MCP+LLM

    Reviews

    2 (1)
    Avatar
    user_cIcXKI6E
    2025-04-16

    As a dedicated user of mcp applications, I am thoroughly impressed with mcp-github-server by dev-leva1. This tool has seamlessly integrated with my GitHub workflow, streamlining server management like never before. The setup was straightforward, and the welcome information was clear. I highly recommend checking it out at https://github.com/dev-leva1/mcp-github-server for anyone looking to optimize their server tasks with ease.