The GitHub API Integration Server provides a convenient interface for interacting with GitHub repositories. It simplifies the process of managing repositories, files, branches, and commits through a structured API.
bash
git clone https://github.com/fills/mcp-github-server.git
cd mcp-github-server
bash
npm install
.env
file in the root directory and add the following variables:PORT=3000
GITHUB_TOKEN=your_github_token_here
repo
, user
)..env
file.bash
npm run dev
bash
npm start
GET /
- Check server status.GET /api/repos/:username
- Get a list of user repositories.GET /api/repos/:username/:repo
- Get details of a specific repository.POST /api/repos
- Create a new repository.json
{
"name": "repo-name",
"description": "description",
"private": false
}
GET /api/repos/:username/:repo/contents/:path
- Get the contents of a file in a repository.POST /api/repos/:username/:repo/contents/:path
- Create a new file in a repository.json
{
"content": "file content",
"message": "commit message"
}
GET /api/repos/:username/:repo/branches
- Get a list of branches in a repository.POST /api/repos/:username/:repo/branches
- Create a new branch in a repository.json
{
"name": "branch-name",
"sha": "commit-sha"
}
GET /api/repos/:username/:repo/commits
- Get a list of commits in a repository.sha
, path
, author
, since
, until
, per_page
, page
.POST /api/repos/:username/:repo/commits
- Create a new commit.json
{
"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"
}
}
No description, website, or topics provided.