# MCP GitHub 服务+
## 基本信息
- Slug: `phialsbasement-mcp-github-server-plus`
- Source: modelscope
- Publisher: @PhialsBasement/mcp-github-server-plus
- Categories: version-control / developer-tools / search
- Hosted: Yes
- License: Unknown
- Source URL: https://www.modelscope.cn/mcp/servers/@PhialsBasement/mcp-github-server-plus
## 简介
GitHub API 的 MCP 服务器，提供文件操作、仓库管理和高级搜索功能，具有自动分支创建和全面的错误处理功能。
## 安装提示

```bash
### NPX
```

## MCP Server 详情

# GitHub MCP Server Plus
![npm downloads](https://img.shields.io/npm/dt/improved-github-mcp)

MCP 服务器用于 GitHub API，支持文件操作、仓库管理、搜索功能等。

<a href="https://glama.ai/mcp/servers/qmvm4mx87p"><img width="380" height="200" src="https://glama.ai/mcp/servers/qmvm4mx87p/badge" alt="GitHub Server Plus MCP server" /></a>

### 功能

- **自动分支创建**：在创建/更新文件或推送更改时，如果分支不存在，则会自动创建
- **全面的错误处理**：针对常见问题提供清晰的错误信息
- **Git 历史记录保留**：操作过程中不会强制推送，从而保持正确的 Git 历史记录
- **批量操作**：支持单个文件和多个文件的操作，可以使用内容或文件路径
- **高级搜索**：支持代码、问题/PR 和用户的搜索

## 工具

1. `create_or_update_file`
   - Create or update a single file in a repository
   - Inputs:
     - `owner` (string): Repository owner (username or organization)
     - `repo` (string): Repository name
     - `path` (string): Path where to create/update the file
     - `content` (string): Content of the file
     - `message` (string): Commit message
     - `branch` (string): Branch to create/update the file in
     - `sha` (optional string): SHA of file being replaced (for updates)
   - Returns: File content and commit details

2. `push_files_content`
   - Push multiple files with direct content in a single commit
   - Inputs:
     - `owner` (string): Repository owner
     - `repo` (string): Repository name
     - `branch` (string): Branch to push to
     - `files` (array): Files to push, each with `path` and `content`
     - `message` (string): Commit message
   - Returns: Updated branch reference

3. `push_files_from_path`
   - Push multiple files from filesystem paths in a single commit
   - Inputs:
     - `owner` (string): Repository owner
     - `repo` (string): Repository name
     - `branch` (string): Branch to push to
     - `files` (array): Files to push, each with:
       - `path` (string): Target path in the repository
       - `filepath` (string): Source filesystem path to read from
     - `message` (string): Commit message
   - Returns: Updated branch reference

4. `search_repositories`
   - Search for GitHub repositories
   - Inputs:
     - `query` (string): Search query
     - `page` (optional number): Page number for pagination
     - `perPage` (optional number): Results per page (max 100)
   - Returns: Repository search results

5. `create_repository`
   - Create a new GitHub repository
   - Inputs:
     - `name` (string): Repository name
     - `description` (optional string): Repository description
     - `private` (optional boolean): Whether repo should be private
     - `autoInit` (optional boolean): Initialize with README
   - Returns: Created repository details

6. `get_file_contents`
   - Get contents of a file or directory
   - Inputs:
     - `owner` (string): Repository owner
     - `repo` (string): Repository name
     - `path` (string): Path to file/directory
     - `branch` (optional string): Branch to get contents from
   - Returns: File/directory contents

7. `create_issue`
   - Create a new issue
   - Inputs:
     - `owner` (string): Repository owner
     - `repo` (string): Repository name
     - `title` (string): Issue title
     - `body` (optional string): Issue description
     - `assignees` (optional string[]): Usernames to assign
     - `labels` (optional string[]): Labels to add
     - `milestone` (optional number): Milestone number
   - Returns: Created issue details

8. `create_pull_request`
   - Create a new pull request
   - Inputs:
     - `owner` (string): Repository owner
     - `repo` (string): Repository name
     - `title` (string): PR title
     - `body` (optional string): PR description
     - `head` (string): Branch containing changes
     - `base` (string): Branch to merge into
     - `draft` (optional boolean): Create as draft PR
     - `maintainer_can_modify` (optional boolean): Allow maintainer edits
   - Returns: Created pull request details

9. `fork_repository`
   - Fork a repository
   - Inputs:
     - `owner` (string): Repository owner
     - `repo` (string): Repository name
     - `organization` (optional string): Organization to fork to
   - Returns: Forked repository details

10. `create_branch`
    - Create a new branch
    - Inputs:
      - `owner` (string): Repository owner
      - `repo` (string): Repository name
      - `branch` (string): Name for new branch
      - `from_branch` (optional string): Source branch (defaults to repo default)
    - Returns: Created branch reference

11. `list_issues`
    - List and filter repository issues
    - Inputs:
      - `owner` (string): Repository owner
      - `repo` (string): Repository name
      - `state` (optional string): Filter by state ('open', 'closed', 'all')
      - `labels` (optional string[]): Filter by labels
      - `sort` (optional string): Sort by ('created', 'updated', 'comments')
      - `direction` (optional string): Sort direction ('asc', 'desc')
      - `since` (optional string): Filter by date (ISO 8601 timestamp)
      - `page` (optional number): Page number
      - `per_page` (optional number): Results per page
    - Returns: Array of issue details

12. `update_issue`
    - Update an existing issue
    - Inputs:
      - `owner` (string): Repository owner
      - `repo` (string): Repository name
      - `issue_number` (number): Issue number to update
      - `title` (optional string): New title
      - `body` (optional string): New description
      - `state` (optional string): New state ('open' or 'closed')
      - `labels` (optional string[]): New labels
      - `assignees` (optional string[]): New assignees
      - `milestone` (optional number): New milestone number
    - Returns: Updated issue details

13. `add_issue_comment`
    - Add a comment to an issue
    - Inputs:
      - `owner` (string): Repository owner
      - `repo` (string): Repository name
      - `issue_number` (number): Issue number to comment on
      - `body` (string): Comment text
    - Returns: Created comment details

14. `search_code`
    - Search for code across GitHub repositories
    - Inputs:
      - `q` (string): Search query using GitHub code search syntax
      - `sort` (opt…

