Skip to content

Commit 784ecf0

Browse files
Merge remote-tracking branch 'origin/main' into tmp2601
2 parents 5d2bc01 + 1654d32 commit 784ecf0

52 files changed

Lines changed: 2488 additions & 681 deletions

Some content is hidden

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

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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:cd2fb3559df6e13bc93b7f0734a4eabe1d21e7b64eec211ed90784f00a17a56a AS build
1111
ARG VERSION="dev"
1212

1313
# Set the working directory

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -717,8 +717,8 @@ The following sets of tools are available:
717717
- **list_dependabot_alerts** - List dependabot alerts
718718
- **Required OAuth Scopes**: `security_events`
719719
- **Accepted OAuth Scopes**: `repo`, `security_events`
720+
- `after`: Cursor for pagination. Use the cursor from the previous response. (string, optional)
720721
- `owner`: The owner of the repository. (string, required)
721-
- `page`: Page number for pagination (min 1) (number, optional)
722722
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
723723
- `repo`: The name of the repository. (string, required)
724724
- `severity`: Filter dependabot alerts by severity (string, optional)
@@ -755,7 +755,7 @@ The following sets of tools are available:
755755

756756
- **get_discussion_comments** - Get discussion comments
757757
- **Required OAuth Scopes**: `repo`
758-
- `after`: Cursor for pagination. Use the endCursor from the previous page's PageInfo for GraphQL APIs. (string, optional)
758+
- `after`: Cursor for pagination. Use the cursor from the previous response. (string, optional)
759759
- `discussionNumber`: Discussion Number (number, required)
760760
- `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)
761761
- `owner`: Repository owner (string, required)
@@ -769,7 +769,7 @@ The following sets of tools are available:
769769

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

827827
<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>
828828

829-
- **add_issue_comment** - Add comment to issue
829+
- **add_issue_comment** - Add comment to issue or pull request
830830
- **Required OAuth Scopes**: `repo`
831831
- `body`: Comment content (string, required)
832832
- `issue_number`: Issue number to comment on (number, required)
@@ -854,7 +854,7 @@ The following sets of tools are available:
854854
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
855855
- `repo`: The name of the repository (string, required)
856856

857-
- **issue_write** - Create or update issue
857+
- **issue_write** - Create or update issue/pull request
858858
- **Required OAuth Scopes**: `repo`
859859
- `assignees`: Usernames to assign to this issue (string[], optional)
860860
- `body`: Issue body content (string, optional)
@@ -881,7 +881,7 @@ The following sets of tools are available:
881881

882882
- **list_issues** - List issues
883883
- **Required OAuth Scopes**: `repo`
884-
- `after`: Cursor for pagination. Use the endCursor from the previous page's PageInfo for GraphQL APIs. (string, optional)
884+
- `after`: Cursor for pagination. Use the cursor from the previous response. (string, optional)
885885
- `direction`: Order direction. If provided, the 'orderBy' also needs to be provided. (string, optional)
886886
- `labels`: Filter by labels (string[], optional)
887887
- `orderBy`: Order issues by field. If provided, the 'direction' also needs to be provided. (string, optional)

docs/feature-flags.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ runtime behavior (such as output formatting) won't appear here.
5151
- **MCP App UI**: `ui://github-mcp-server/get-me`
5252
- No parameters required
5353

54-
- **issue_write** - Create or update issue
54+
- **issue_write** - Create or update issue/pull request
5555
- **Required OAuth Scopes**: `repo`
5656
- **MCP App UI**: `ui://github-mcp-server/issue-write`
5757
- `assignees`: Usernames to assign to this issue (string[], optional)
@@ -75,7 +75,7 @@ runtime behavior (such as output formatting) won't appear here.
7575

7676
### `remote_mcp_issue_fields`
7777

78-
- **issue_write** - Create or update issue
78+
- **issue_write** - Create or update issue/pull request
7979
- **Required OAuth Scopes**: `repo`
8080
- `assignees`: Usernames to assign to this issue (string[], optional)
8181
- `body`: Issue body content (string, optional)
@@ -104,7 +104,7 @@ runtime behavior (such as output formatting) won't appear here.
104104

105105
- **list_issues** - List issues
106106
- **Required OAuth Scopes**: `repo`
107-
- `after`: Cursor for pagination. Use the endCursor from the previous page's PageInfo for GraphQL APIs. (string, optional)
107+
- `after`: Cursor for pagination. Use the cursor from the previous response. (string, optional)
108108
- `direction`: Order direction. If provided, the 'orderBy' also needs to be provided. (string, optional)
109109
- `field_filters`: Filter by custom issue field values. Each entry takes a field_name and a value; the server looks up the field and coerces the value to its type (single-select option name, text, number, or YYYY-MM-DD date). (object[], optional)
110110
- `labels`: Filter by labels (string[], optional)
@@ -200,6 +200,7 @@ runtime behavior (such as output formatting) won't appear here.
200200

201201
- **update_issue_type** - Update Issue Type
202202
- **Required OAuth Scopes**: `repo`
203+
- `confidence`: How confident you are in this choice. Use 'high' for clear signal or explicit user request, 'medium' for reasonable inference with some ambiguity, 'low' for best guess with limited signal. (string, optional)
203204
- `is_suggestion`: If true, this issue type change is sent to the API as a suggestion (suggest:true) rather than an applied value. Whether the type is applied or recorded as a proposal is determined by the API. (boolean, optional)
204205
- `issue_number`: The issue number to update (number, required)
205206
- `issue_type`: The issue type to set (string, required)

docs/insiders-features.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ The list below is generated from the Go source. It covers tool **inventory and s
4545
- **MCP App UI**: `ui://github-mcp-server/get-me`
4646
- No parameters required
4747

48-
- **issue_write** - Create or update issue
48+
- **issue_write** - Create or update issue/pull request
4949
- **Required OAuth Scopes**: `repo`
5050
- **MCP App UI**: `ui://github-mcp-server/issue-write`
5151
- `assignees`: Usernames to assign to this issue (string[], optional)
@@ -69,7 +69,7 @@ The list below is generated from the Go source. It covers tool **inventory and s
6969

7070
### `remote_mcp_issue_fields`
7171

72-
- **issue_write** - Create or update issue
72+
- **issue_write** - Create or update issue/pull request
7373
- **Required OAuth Scopes**: `repo`
7474
- `assignees`: Usernames to assign to this issue (string[], optional)
7575
- `body`: Issue body content (string, optional)
@@ -98,7 +98,7 @@ The list below is generated from the Go source. It covers tool **inventory and s
9898

9999
- **list_issues** - List issues
100100
- **Required OAuth Scopes**: `repo`
101-
- `after`: Cursor for pagination. Use the endCursor from the previous page's PageInfo for GraphQL APIs. (string, optional)
101+
- `after`: Cursor for pagination. Use the cursor from the previous response. (string, optional)
102102
- `direction`: Order direction. If provided, the 'orderBy' also needs to be provided. (string, optional)
103103
- `field_filters`: Filter by custom issue field values. Each entry takes a field_name and a value; the server looks up the field and coerces the value to its type (single-select option name, text, number, or YYYY-MM-DD date). (object[], optional)
104104
- `labels`: Filter by labels (string[], optional)

pkg/errors/error.go

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ package errors
22

33
import (
44
"context"
5+
stderrors "errors"
56
"fmt"
67
"net/http"
8+
"time"
79

810
"github.com/github/github-mcp-server/pkg/utils"
911
"github.com/google/go-github/v87/github"
@@ -159,6 +161,35 @@ func NewGitHubAPIErrorResponse(ctx context.Context, message string, resp *github
159161
if ctx != nil {
160162
_, _ = addGitHubAPIErrorToContext(ctx, apiErr) // Explicitly ignore error for graceful handling
161163
}
164+
165+
var rateLimitErr *github.RateLimitError
166+
if stderrors.As(err, &rateLimitErr) {
167+
resetTime := rateLimitErr.Rate.Reset.Time
168+
if !resetTime.IsZero() {
169+
retryIn := time.Until(resetTime).Round(time.Second)
170+
if retryIn > 0 {
171+
return utils.NewToolResultError(fmt.Sprintf(
172+
"%s: GitHub API rate limit exceeded. Retry after %v.", message, retryIn))
173+
}
174+
}
175+
return utils.NewToolResultError(fmt.Sprintf(
176+
"%s: GitHub API rate limit exceeded. Wait before retrying.", message))
177+
}
178+
179+
var abuseErr *github.AbuseRateLimitError
180+
if stderrors.As(err, &abuseErr) {
181+
if abuseErr.RetryAfter != nil {
182+
retryAfter := abuseErr.RetryAfter.Round(time.Second)
183+
if retryAfter > 0 {
184+
return utils.NewToolResultError(fmt.Sprintf(
185+
"%s: GitHub secondary rate limit exceeded. Retry after %v.",
186+
message, retryAfter))
187+
}
188+
}
189+
return utils.NewToolResultError(fmt.Sprintf(
190+
"%s: GitHub secondary rate limit exceeded. Wait before retrying.", message))
191+
}
192+
162193
return utils.NewToolResultErrorFromErr(message, err)
163194
}
164195

0 commit comments

Comments
 (0)