|
1 | 1 | # GitHub MCP Server
|
2 | 2 |
|
3 |
| -MCP Server for the GitHub API, enabling file operations, repository management, and more. |
| 3 | +MCP Server for the GitHub API, enabling file operations, repository management, search functionality, and more. |
4 | 4 |
|
5 | 5 | ### Features
|
6 | 6 |
|
7 | 7 | - **Automatic Branch Creation**: When creating/updating files or pushing changes, branches are automatically created if they don't exist
|
8 | 8 | - **Comprehensive Error Handling**: Clear error messages for common issues
|
9 | 9 | - **Git History Preservation**: Operations maintain proper Git history without force pushing
|
10 | 10 | - **Batch Operations**: Support for both single-file and multi-file operations
|
| 11 | +- **Advanced Search**: Support for searching code, issues/PRs, and users |
11 | 12 |
|
12 | 13 |
|
13 | 14 | ## Tools
|
@@ -102,6 +103,97 @@ MCP Server for the GitHub API, enabling file operations, repository management,
|
102 | 103 | - `from_branch` (optional string): Source branch (defaults to repo default)
|
103 | 104 | - Returns: Created branch reference
|
104 | 105 |
|
| 106 | +10. `list_issues` |
| 107 | + - List and filter repository issues |
| 108 | + - Inputs: |
| 109 | + - `owner` (string): Repository owner |
| 110 | + - `repo` (string): Repository name |
| 111 | + - `state` (optional string): Filter by state ('open', 'closed', 'all') |
| 112 | + - `labels` (optional string[]): Filter by labels |
| 113 | + - `sort` (optional string): Sort by ('created', 'updated', 'comments') |
| 114 | + - `direction` (optional string): Sort direction ('asc', 'desc') |
| 115 | + - `since` (optional string): Filter by date (ISO 8601 timestamp) |
| 116 | + - `page` (optional number): Page number |
| 117 | + - `per_page` (optional number): Results per page |
| 118 | + - Returns: Array of issue details |
| 119 | + |
| 120 | +11. `update_issue` |
| 121 | + - Update an existing issue |
| 122 | + - Inputs: |
| 123 | + - `owner` (string): Repository owner |
| 124 | + - `repo` (string): Repository name |
| 125 | + - `issue_number` (number): Issue number to update |
| 126 | + - `title` (optional string): New title |
| 127 | + - `body` (optional string): New description |
| 128 | + - `state` (optional string): New state ('open' or 'closed') |
| 129 | + - `labels` (optional string[]): New labels |
| 130 | + - `assignees` (optional string[]): New assignees |
| 131 | + - `milestone` (optional number): New milestone number |
| 132 | + - Returns: Updated issue details |
| 133 | + |
| 134 | +12. `add_issue_comment` |
| 135 | + - Add a comment to an issue |
| 136 | + - Inputs: |
| 137 | + - `owner` (string): Repository owner |
| 138 | + - `repo` (string): Repository name |
| 139 | + - `issue_number` (number): Issue number to comment on |
| 140 | + - `body` (string): Comment text |
| 141 | + - Returns: Created comment details |
| 142 | + |
| 143 | +13. `search_code` |
| 144 | + - Search for code across GitHub repositories |
| 145 | + - Inputs: |
| 146 | + - `q` (string): Search query using GitHub code search syntax |
| 147 | + - `sort` (optional string): Sort field ('indexed' only) |
| 148 | + - `order` (optional string): Sort order ('asc' or 'desc') |
| 149 | + - `per_page` (optional number): Results per page (max 100) |
| 150 | + - `page` (optional number): Page number |
| 151 | + - Returns: Code search results with repository context |
| 152 | + |
| 153 | +14. `search_issues` |
| 154 | + - Search for issues and pull requests |
| 155 | + - Inputs: |
| 156 | + - `q` (string): Search query using GitHub issues search syntax |
| 157 | + - `sort` (optional string): Sort field (comments, reactions, created, etc.) |
| 158 | + - `order` (optional string): Sort order ('asc' or 'desc') |
| 159 | + - `per_page` (optional number): Results per page (max 100) |
| 160 | + - `page` (optional number): Page number |
| 161 | + - Returns: Issue and pull request search results |
| 162 | + |
| 163 | +15. `search_users` |
| 164 | + - Search for GitHub users |
| 165 | + - Inputs: |
| 166 | + - `q` (string): Search query using GitHub users search syntax |
| 167 | + - `sort` (optional string): Sort field (followers, repositories, joined) |
| 168 | + - `order` (optional string): Sort order ('asc' or 'desc') |
| 169 | + - `per_page` (optional number): Results per page (max 100) |
| 170 | + - `page` (optional number): Page number |
| 171 | + - Returns: User search results |
| 172 | + |
| 173 | +## Search Query Syntax |
| 174 | + |
| 175 | +### Code Search |
| 176 | +- `language:javascript`: Search by programming language |
| 177 | +- `repo:owner/name`: Search in specific repository |
| 178 | +- `path:app/src`: Search in specific path |
| 179 | +- `extension:js`: Search by file extension |
| 180 | +- Example: `q: "import express" language:typescript path:src/` |
| 181 | + |
| 182 | +### Issues Search |
| 183 | +- `is:issue` or `is:pr`: Filter by type |
| 184 | +- `is:open` or `is:closed`: Filter by state |
| 185 | +- `label:bug`: Search by label |
| 186 | +- `author:username`: Search by author |
| 187 | +- Example: `q: "memory leak" is:issue is:open label:bug` |
| 188 | + |
| 189 | +### Users Search |
| 190 | +- `type:user` or `type:org`: Filter by account type |
| 191 | +- `followers:>1000`: Filter by followers |
| 192 | +- `location:London`: Search by location |
| 193 | +- Example: `q: "fullstack developer" location:London followers:>100` |
| 194 | + |
| 195 | +For detailed search syntax, see [GitHub's searching documentation](https://docs.github.com/en/search-github/searching-on-github). |
| 196 | + |
105 | 197 | ## Setup
|
106 | 198 |
|
107 | 199 | ### Personal Access Token
|
|
0 commit comments