|
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,60 @@ 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. `search_code` |
| 107 | + - Search for code across GitHub repositories |
| 108 | + - Inputs: |
| 109 | + - `q` (string): Search query using GitHub code search syntax |
| 110 | + - `sort` (optional string): Sort field ('indexed' only) |
| 111 | + - `order` (optional string): Sort order ('asc' or 'desc') |
| 112 | + - `per_page` (optional number): Results per page (max 100) |
| 113 | + - `page` (optional number): Page number |
| 114 | + - Returns: Code search results with repository context |
| 115 | + |
| 116 | +11. `search_issues` |
| 117 | + - Search for issues and pull requests |
| 118 | + - Inputs: |
| 119 | + - `q` (string): Search query using GitHub issues search syntax |
| 120 | + - `sort` (optional string): Sort field (comments, reactions, created, etc.) |
| 121 | + - `order` (optional string): Sort order ('asc' or 'desc') |
| 122 | + - `per_page` (optional number): Results per page (max 100) |
| 123 | + - `page` (optional number): Page number |
| 124 | + - Returns: Issue and pull request search results |
| 125 | + |
| 126 | +12. `search_users` |
| 127 | + - Search for GitHub users |
| 128 | + - Inputs: |
| 129 | + - `q` (string): Search query using GitHub users search syntax |
| 130 | + - `sort` (optional string): Sort field (followers, repositories, joined) |
| 131 | + - `order` (optional string): Sort order ('asc' or 'desc') |
| 132 | + - `per_page` (optional number): Results per page (max 100) |
| 133 | + - `page` (optional number): Page number |
| 134 | + - Returns: User search results |
| 135 | + |
| 136 | +## Search Query Syntax |
| 137 | + |
| 138 | +### Code Search |
| 139 | +- `language:javascript`: Search by programming language |
| 140 | +- `repo:owner/name`: Search in specific repository |
| 141 | +- `path:app/src`: Search in specific path |
| 142 | +- `extension:js`: Search by file extension |
| 143 | +- Example: `q: "import express" language:typescript path:src/` |
| 144 | + |
| 145 | +### Issues Search |
| 146 | +- `is:issue` or `is:pr`: Filter by type |
| 147 | +- `is:open` or `is:closed`: Filter by state |
| 148 | +- `label:bug`: Search by label |
| 149 | +- `author:username`: Search by author |
| 150 | +- Example: `q: "memory leak" is:issue is:open label:bug` |
| 151 | + |
| 152 | +### Users Search |
| 153 | +- `type:user` or `type:org`: Filter by account type |
| 154 | +- `followers:>1000`: Filter by followers |
| 155 | +- `location:London`: Search by location |
| 156 | +- Example: `q: "fullstack developer" location:London followers:>100` |
| 157 | + |
| 158 | +For detailed search syntax, see [GitHub's searching documentation](https://docs.github.com/en/search-github/searching-on-github). |
| 159 | + |
105 | 160 | ## Setup
|
106 | 161 |
|
107 | 162 | ### Personal Access Token
|
|
0 commit comments