Skip to content

Commit cb26fe4

Browse files
Merge branch 'main' into koesie10/get-code-quality-finding
2 parents 32caa71 + 667bd3e commit cb26fe4

82 files changed

Lines changed: 9557 additions & 1221 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/actions/build-ui/action.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ runs:
1212
pkg/github/ui_dist/get-me.html
1313
pkg/github/ui_dist/issue-write.html
1414
pkg/github/ui_dist/pr-write.html
15-
key: ui-dist-v1-${{ hashFiles('ui/package-lock.json', 'ui/package.json', 'ui/index.html', 'ui/tsconfig*.json', 'ui/vite.config.ts', 'ui/src/**', 'ui/scripts/**') }}
15+
pkg/github/ui_dist/pr-edit.html
16+
key: ui-dist-v2-${{ hashFiles('ui/package-lock.json', 'ui/package.json', 'ui/index.html', 'ui/tsconfig*.json', 'ui/vite.config.ts', 'ui/src/**', 'ui/scripts/**') }}
1617
enableCrossOsArchive: true
1718

1819
- name: Set up Node.js

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:26-alpine@sha256:7c6af15abe4e3de859690e7db171d0d711bf37d27528eddfe625b2fe89e097f8 AS ui-build
1+
FROM node:26-alpine@sha256:3ad34ca6292aec4a91d8ddeb9229e29d9c2f689efd0dd242860889ac71842eba AS ui-build
22
WORKDIR /app
33
COPY ui/package*.json ./ui/
44
RUN cd ui && npm ci
@@ -7,7 +7,7 @@ COPY ui/ ./ui/
77
RUN mkdir -p ./pkg/github/ui_dist && \
88
cd ui && npm run build
99

10-
FROM golang:1.25.10-alpine@sha256:8d22e29d960bc50cd025d93d5b7c7d220b1ee9aa7a239b3c8f55a57e987e8d45 AS build
10+
FROM golang:1.25.11-alpine@sha256:8d95af53d0d58e1759ddb4028285d9b1239067e4fbf4f544618cad0f60fbc354 AS build
1111
ARG VERSION="dev"
1212

1313
# Set the working directory
@@ -30,7 +30,7 @@ RUN --mount=type=cache,target=/go/pkg/mod \
3030
-o /bin/github-mcp-server ./cmd/github-mcp-server
3131

3232
# Make a stage to run the app
33-
FROM gcr.io/distroless/base-debian12@sha256:58695f439f772a00009c8f6be4c183f824c1f556d74b313c30900f167e4772f8
33+
FROM gcr.io/distroless/base-debian12@sha256:e7e678c88c59e70e105a46549bb3fbfb3d732ee3b4afd3a19fdab2e15afaa6b3
3434

3535
# Add required MCP server annotation
3636
LABEL io.modelcontextprotocol.server.name="io.github.github/github-mcp-server"

README.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Built for developers who want to connect their AI tools to GitHub context and ca
1818

1919
## Remote GitHub MCP Server
2020

21-
[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install_Server-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=github&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2F%22%7D) [![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install_Server-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=github&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2F%22%7D&quality=insiders)
21+
[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install_Server-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=github&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2F%22%7D) [![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install_Server-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=github&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2F%22%7D&quality=insiders) [![Install in Visual Studio](https://img.shields.io/badge/Visual_Studio-Install_Server-C16FDE?style=flat-square&logo=visualstudio&logoColor=white)](https://aka.ms/vs/mcp-install?%7B%22name%22%3A%22github%22%2C%22gallery%22%3Atrue%2C%22url%22%3A%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2F%22%7D)
2222

2323
The remote GitHub MCP Server is hosted by GitHub and provides the easiest method for getting up and running. If your MCP host does not support remote MCP servers, don't worry! You can use the [local version of the GitHub MCP Server](https://github.com/github/github-mcp-server?tab=readme-ov-file#local-github-mcp-server) instead.
2424

@@ -176,7 +176,7 @@ GitHub Enterprise Server does not support remote server hosting. Please refer to
176176

177177
## Local GitHub MCP Server
178178

179-
[![Install with Docker in VS Code](https://img.shields.io/badge/VS_Code-Install_Server-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=github&inputs=%5B%7B%22id%22%3A%22github_token%22%2C%22type%22%3A%22promptString%22%2C%22description%22%3A%22GitHub%20Personal%20Access%20Token%22%2C%22password%22%3Atrue%7D%5D&config=%7B%22command%22%3A%22docker%22%2C%22args%22%3A%5B%22run%22%2C%22-i%22%2C%22--rm%22%2C%22-e%22%2C%22GITHUB_PERSONAL_ACCESS_TOKEN%22%2C%22ghcr.io%2Fgithub%2Fgithub-mcp-server%22%5D%2C%22env%22%3A%7B%22GITHUB_PERSONAL_ACCESS_TOKEN%22%3A%22%24%7Binput%3Agithub_token%7D%22%7D%7D) [![Install with Docker in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install_Server-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=github&inputs=%5B%7B%22id%22%3A%22github_token%22%2C%22type%22%3A%22promptString%22%2C%22description%22%3A%22GitHub%20Personal%20Access%20Token%22%2C%22password%22%3Atrue%7D%5D&config=%7B%22command%22%3A%22docker%22%2C%22args%22%3A%5B%22run%22%2C%22-i%22%2C%22--rm%22%2C%22-e%22%2C%22GITHUB_PERSONAL_ACCESS_TOKEN%22%2C%22ghcr.io%2Fgithub%2Fgithub-mcp-server%22%5D%2C%22env%22%3A%7B%22GITHUB_PERSONAL_ACCESS_TOKEN%22%3A%22%24%7Binput%3Agithub_token%7D%22%7D%7D&quality=insiders)
179+
[![Install with Docker in VS Code](https://img.shields.io/badge/VS_Code-Install_Server-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=github&inputs=%5B%7B%22id%22%3A%22github_token%22%2C%22type%22%3A%22promptString%22%2C%22description%22%3A%22GitHub%20Personal%20Access%20Token%22%2C%22password%22%3Atrue%7D%5D&config=%7B%22command%22%3A%22docker%22%2C%22args%22%3A%5B%22run%22%2C%22-i%22%2C%22--rm%22%2C%22-e%22%2C%22GITHUB_PERSONAL_ACCESS_TOKEN%22%2C%22ghcr.io%2Fgithub%2Fgithub-mcp-server%22%5D%2C%22env%22%3A%7B%22GITHUB_PERSONAL_ACCESS_TOKEN%22%3A%22%24%7Binput%3Agithub_token%7D%22%7D%7D) [![Install with Docker in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install_Server-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=github&inputs=%5B%7B%22id%22%3A%22github_token%22%2C%22type%22%3A%22promptString%22%2C%22description%22%3A%22GitHub%20Personal%20Access%20Token%22%2C%22password%22%3Atrue%7D%5D&config=%7B%22command%22%3A%22docker%22%2C%22args%22%3A%5B%22run%22%2C%22-i%22%2C%22--rm%22%2C%22-e%22%2C%22GITHUB_PERSONAL_ACCESS_TOKEN%22%2C%22ghcr.io%2Fgithub%2Fgithub-mcp-server%22%5D%2C%22env%22%3A%7B%22GITHUB_PERSONAL_ACCESS_TOKEN%22%3A%22%24%7Binput%3Agithub_token%7D%22%7D%7D&quality=insiders) [![Install with Docker in Visual Studio](https://img.shields.io/badge/Visual_Studio-Install_Server-C16FDE?style=flat-square&logo=visualstudio&logoColor=white)](https://aka.ms/vs/mcp-install?%7B%22name%22%3A%22github%22%2C%22command%22%3A%22docker%22%2C%22args%22%3A%5B%22run%22%2C%22-i%22%2C%22--rm%22%2C%22-e%22%2C%22GITHUB_PERSONAL_ACCESS_TOKEN%22%2C%22ghcr.io%2Fgithub%2Fgithub-mcp-server%22%5D%7D)
180180

181181
### Prerequisites
182182

@@ -730,8 +730,8 @@ The following sets of tools are available:
730730
- **list_dependabot_alerts** - List dependabot alerts
731731
- **Required OAuth Scopes**: `security_events`
732732
- **Accepted OAuth Scopes**: `repo`, `security_events`
733+
- `after`: Cursor for pagination. Use the cursor from the previous response. (string, optional)
733734
- `owner`: The owner of the repository. (string, required)
734-
- `page`: Page number for pagination (min 1) (number, optional)
735735
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
736736
- `repo`: The name of the repository. (string, required)
737737
- `severity`: Filter dependabot alerts by severity (string, optional)
@@ -768,7 +768,7 @@ The following sets of tools are available:
768768

769769
- **get_discussion_comments** - Get discussion comments
770770
- **Required OAuth Scopes**: `repo`
771-
- `after`: Cursor for pagination. Use the endCursor from the previous page's PageInfo for GraphQL APIs. (string, optional)
771+
- `after`: Cursor for pagination. Use the cursor from the previous response. (string, optional)
772772
- `discussionNumber`: Discussion Number (number, required)
773773
- `includeReplies`: When true, each top-level comment will include its replies nested within it (up to 100 replies per comment, which is the GitHub API maximum). Defaults to false. (boolean, optional)
774774
- `owner`: Repository owner (string, required)
@@ -782,7 +782,7 @@ The following sets of tools are available:
782782

783783
- **list_discussions** - List discussions
784784
- **Required OAuth Scopes**: `repo`
785-
- `after`: Cursor for pagination. Use the endCursor from the previous page's PageInfo for GraphQL APIs. (string, optional)
785+
- `after`: Cursor for pagination. Use the cursor from the previous response. (string, optional)
786786
- `category`: Optional filter by discussion category ID. If provided, only discussions with this category are listed. (string, optional)
787787
- `direction`: Order direction. (string, optional)
788788
- `orderBy`: Order discussions by field. If provided, the 'direction' also needs to be provided. (string, optional)
@@ -839,7 +839,7 @@ The following sets of tools are available:
839839

840840
<summary><picture><source media="(prefers-color-scheme: dark)" srcset="pkg/octicons/icons/issue-opened-dark.png"><source media="(prefers-color-scheme: light)" srcset="pkg/octicons/icons/issue-opened-light.png"><img src="pkg/octicons/icons/issue-opened-light.png" width="20" height="20" alt="issue-opened"></picture> Issues</summary>
841841

842-
- **add_issue_comment** - Add comment to issue
842+
- **add_issue_comment** - Add comment to issue or pull request
843843
- **Required OAuth Scopes**: `repo`
844844
- `body`: Comment content (string, required)
845845
- `issue_number`: Issue number to comment on (number, required)
@@ -867,7 +867,7 @@ The following sets of tools are available:
867867
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
868868
- `repo`: The name of the repository (string, required)
869869

870-
- **issue_write** - Create or update issue
870+
- **issue_write** - Create or update issue/pull request
871871
- **Required OAuth Scopes**: `repo`
872872
- `assignees`: Usernames to assign to this issue (string[], optional)
873873
- `body`: Issue body content (string, optional)
@@ -894,7 +894,7 @@ The following sets of tools are available:
894894

895895
- **list_issues** - List issues
896896
- **Required OAuth Scopes**: `repo`
897-
- `after`: Cursor for pagination. Use the endCursor from the previous page's PageInfo for GraphQL APIs. (string, optional)
897+
- `after`: Cursor for pagination. Use the cursor from the previous response. (string, optional)
898898
- `direction`: Order direction. If provided, the 'orderBy' also needs to be provided. (string, optional)
899899
- `labels`: Filter by labels (string[], optional)
900900
- `orderBy`: Order issues by field. If provided, the 'direction' also needs to be provided. (string, optional)
@@ -1103,6 +1103,7 @@ The following sets of tools are available:
11031103
- `maintainer_can_modify`: Allow maintainer edits (boolean, optional)
11041104
- `owner`: Repository owner (string, required)
11051105
- `repo`: Repository name (string, required)
1106+
- `reviewers`: GitHub usernames or ORG/team-slug team reviewers to request reviews from (string[], optional)
11061107
- `title`: PR title (string, required)
11071108

11081109
- **list_pull_requests** - List pull requests
@@ -1135,10 +1136,11 @@ The following sets of tools are available:
11351136
2. get_diff - Get the diff of a pull request.
11361137
3. get_status - Get combined commit status of a head commit in a pull request.
11371138
4. get_files - Get the list of files changed in a pull request. Use with pagination parameters to control the number of results returned.
1138-
5. get_review_comments - Get review threads on a pull request. Each thread contains logically grouped review comments made on the same code location during pull request reviews. Returns threads with metadata (isResolved, isOutdated, isCollapsed) and their associated comments. Use cursor-based pagination (perPage, after) to control results.
1139-
6. get_reviews - Get the reviews on a pull request. When asked for review comments, use get_review_comments method. Use with pagination parameters to control the number of results returned.
1140-
7. get_comments - Get comments on a pull request. Use this if user doesn't specifically want review comments. Use with pagination parameters to control the number of results returned.
1141-
8. get_check_runs - Get check runs for the head commit of a pull request. Check runs are the individual CI/CD jobs and checks that run on the PR.
1139+
5. get_commits - Get the list of commits on a pull request. Use with pagination parameters to control the number of results returned.
1140+
6. get_review_comments - Get review threads on a pull request. Each thread contains logically grouped review comments made on the same code location during pull request reviews. Returns threads with metadata (isResolved, isOutdated, isCollapsed) and their associated comments. Use cursor-based pagination (perPage, after) to control results.
1141+
7. get_reviews - Get the reviews on a pull request. When asked for review comments, use get_review_comments method. Use with pagination parameters to control the number of results returned.
1142+
8. get_comments - Get comments on a pull request. Use this if user doesn't specifically want review comments. Use with pagination parameters to control the number of results returned.
1143+
9. get_check_runs - Get check runs for the head commit of a pull request. Check runs are the individual CI/CD jobs and checks that run on the PR.
11421144
(string, required)
11431145
- `owner`: Repository owner (string, required)
11441146
- `page`: Page number for pagination (min 1) (number, optional)
@@ -1216,7 +1218,7 @@ The following sets of tools are available:
12161218
- `description`: Repository description (string, optional)
12171219
- `name`: Repository name (string, required)
12181220
- `organization`: Organization to create the repository in (omit to create in your personal account) (string, optional)
1219-
- `private`: Whether repo should be private (boolean, optional)
1221+
- `private`: Whether the repository should be private. Defaults to true (private) when omitted. (boolean, optional)
12201222

12211223
- **delete_file** - Delete file
12221224
- **Required OAuth Scopes**: `repo`

cmd/github-mcp-server/generate_docs.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,8 @@ func writeToolDoc(buf *strings.Builder, tool inventory.ServerTool) {
257257
}
258258
sort.Strings(paramNames)
259259

260+
conditional := inventory.ConditionalSchemaPropertyDescriptions()
261+
260262
for i, propName := range paramNames {
261263
prop := schema.Properties[propName]
262264
required := slices.Contains(schema.Required, propName)
@@ -282,7 +284,11 @@ func writeToolDoc(buf *strings.Builder, tool inventory.ServerTool) {
282284
// Indent any continuation lines in the description to maintain markdown formatting
283285
description := indentMultilineDescription(prop.Description, " ")
284286

285-
fmt.Fprintf(buf, " - `%s`: %s (%s, %s)", propName, description, typeStr, requiredStr)
287+
if cond, isConditional := conditional[propName]; isConditional {
288+
fmt.Fprintf(buf, " - `%s`: %s (%s, %s, conditional — %s)", propName, description, typeStr, requiredStr, cond)
289+
} else {
290+
fmt.Fprintf(buf, " - `%s`: %s (%s, %s)", propName, description, typeStr, requiredStr)
291+
}
286292
if i < len(paramNames)-1 {
287293
buf.WriteString("\n")
288294
}

cmd/github-mcp-server/main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ var (
138138
Version: version,
139139
Host: viper.GetString("host"),
140140
Port: viper.GetInt("port"),
141+
ListenHost: viper.GetString("listen-host"),
141142
BaseURL: viper.GetString("base-url"),
142143
ResourcePath: viper.GetString("base-path"),
143144
ExportTranslations: viper.GetBool("export-translations"),
@@ -184,6 +185,7 @@ func init() {
184185

185186
// HTTP-specific flags
186187
httpCmd.Flags().Int("port", 8082, "HTTP server port")
188+
httpCmd.Flags().String("listen-host", "", "Host the HTTP server binds to (e.g. 127.0.0.1). Empty binds to all interfaces.")
187189
httpCmd.Flags().String("base-url", "", "Base URL where this server is publicly accessible (for OAuth resource metadata)")
188190
httpCmd.Flags().String("base-path", "", "Externally visible base path for the HTTP server (for OAuth resource metadata)")
189191
httpCmd.Flags().Bool("scope-challenge", false, "Enable OAuth scope challenge responses")
@@ -204,6 +206,7 @@ func init() {
204206
_ = viper.BindPFlag("insiders", rootCmd.PersistentFlags().Lookup("insiders"))
205207
_ = viper.BindPFlag("repo-access-cache-ttl", rootCmd.PersistentFlags().Lookup("repo-access-cache-ttl"))
206208
_ = viper.BindPFlag("port", httpCmd.Flags().Lookup("port"))
209+
_ = viper.BindPFlag("listen-host", httpCmd.Flags().Lookup("listen-host"))
207210
_ = viper.BindPFlag("base-url", httpCmd.Flags().Lookup("base-url"))
208211
_ = viper.BindPFlag("base-path", httpCmd.Flags().Lookup("base-path"))
209212
_ = viper.BindPFlag("scope-challenge", httpCmd.Flags().Lookup("scope-challenge"))

0 commit comments

Comments
 (0)