Skip to content

Commit d0899b9

Browse files
Merge branch 'main' into docs/fix-broken-tool-renaming-link
2 parents a8a5a7e + 76d68b4 commit d0899b9

Some content is hidden

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

41 files changed

+3699
-160
lines changed

.github/copilot-instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ go test ./pkg/github -run TestGetMe
9494

9595
- **go.mod / go.sum:** Go module dependencies (Go 1.24.0+)
9696
- **.golangci.yml:** Linter configuration (v2 format, ~15 linters enabled)
97-
- **Dockerfile:** Multi-stage build (golang:1.25.3-alpine → distroless)
97+
- **Dockerfile:** Multi-stage build (golang:1.25.8-alpine → distroless)
9898
- **server.json:** MCP server metadata for registry
9999
- **.goreleaser.yaml:** Release automation config
100100
- **.gitignore:** Excludes bin/, dist/, vendor/, *.DS_Store, github-mcp-server binary

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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:937c7eaaf6f3f2d38a1f8c4aeff326f0c56e4593ea152e9e8f74d976dde52f56
33+
FROM gcr.io/distroless/base-debian12@sha256:9dce90e688a57e59ce473ff7bc4c80bc8fe52d2303b4d99b44f297310bbd2210
3434

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

cmd/github-mcp-server/main.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,28 @@ var (
105105
Short: "Start HTTP server",
106106
Long: `Start an HTTP server that listens for MCP requests over HTTP.`,
107107
RunE: func(_ *cobra.Command, _ []string) error {
108+
// Parse toolsets (same approach as stdio — see comment there)
109+
var enabledToolsets []string
110+
if viper.IsSet("toolsets") {
111+
if err := viper.UnmarshalKey("toolsets", &enabledToolsets); err != nil {
112+
return fmt.Errorf("failed to unmarshal toolsets: %w", err)
113+
}
114+
}
115+
116+
var enabledTools []string
117+
if viper.IsSet("tools") {
118+
if err := viper.UnmarshalKey("tools", &enabledTools); err != nil {
119+
return fmt.Errorf("failed to unmarshal tools: %w", err)
120+
}
121+
}
122+
123+
var excludeTools []string
124+
if viper.IsSet("exclude_tools") {
125+
if err := viper.UnmarshalKey("exclude_tools", &excludeTools); err != nil {
126+
return fmt.Errorf("failed to unmarshal exclude-tools: %w", err)
127+
}
128+
}
129+
108130
ttl := viper.GetDuration("repo-access-cache-ttl")
109131
httpConfig := ghhttp.ServerConfig{
110132
Version: version,
@@ -119,6 +141,12 @@ var (
119141
LockdownMode: viper.GetBool("lockdown-mode"),
120142
RepoAccessCacheTTL: &ttl,
121143
ScopeChallenge: viper.GetBool("scope-challenge"),
144+
ReadOnly: viper.GetBool("read-only"),
145+
EnabledToolsets: enabledToolsets,
146+
EnabledTools: enabledTools,
147+
DynamicToolsets: viper.GetBool("dynamic_toolsets"),
148+
ExcludeTools: excludeTools,
149+
InsidersMode: viper.GetBool("insiders"),
122150
}
123151

124152
return ghhttp.RunHTTPServer(httpConfig)

go.mod

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/github/github-mcp-server
22

3-
go 1.24.0
3+
go 1.25.0
44

55
require (
66
github.com/go-chi/chi/v5 v5.2.5
@@ -10,7 +10,7 @@ require (
1010
github.com/josephburnett/jd/v2 v2.4.0
1111
github.com/lithammer/fuzzysearch v1.1.8
1212
github.com/microcosm-cc/bluemonday v1.0.27
13-
github.com/modelcontextprotocol/go-sdk v1.3.1-0.20260220105450-b17143f71798
13+
github.com/modelcontextprotocol/go-sdk v1.5.0
1414
github.com/muesli/cache2go v0.0.0-20221011235721-518229cd8021
1515
github.com/shurcooL/githubv4 v0.0.0-20240727222349-48295856cce7
1616
github.com/shurcooL/graphql v0.0.0-20230722043721-ed46e5a46466
@@ -36,7 +36,7 @@ require (
3636
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
3737
github.com/sagikazarmark/locafero v0.11.0 // indirect
3838
github.com/segmentio/asm v1.1.3 // indirect
39-
github.com/segmentio/encoding v0.5.3 // indirect
39+
github.com/segmentio/encoding v0.5.4 // indirect
4040
github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect
4141
github.com/spf13/afero v1.15.0 // indirect
4242
github.com/spf13/cast v1.10.0 // indirect
@@ -45,8 +45,8 @@ require (
4545
go.yaml.in/yaml/v3 v3.0.4 // indirect
4646
golang.org/x/exp v0.0.0-20250305212735-054e65f0b394 // indirect
4747
golang.org/x/net v0.38.0 // indirect
48-
golang.org/x/oauth2 v0.34.0 // indirect
49-
golang.org/x/sys v0.40.0 // indirect
48+
golang.org/x/oauth2 v0.35.0 // indirect
49+
golang.org/x/sys v0.41.0 // indirect
5050
golang.org/x/text v0.28.0 // indirect
5151
gopkg.in/yaml.v3 v3.0.1 // indirect
5252
)

go.sum

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+Gr
1515
github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ=
1616
github.com/go-viper/mapstructure/v2 v2.5.0 h1:vM5IJoUAy3d7zRSVtIwQgBj7BiWtMPfmPEgAXnvj1Ro=
1717
github.com/go-viper/mapstructure/v2 v2.5.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
18-
github.com/golang-jwt/jwt/v5 v5.3.0 h1:pv4AsKCKKZuqlgs5sUmn4x8UlGa0kEVt/puTpKx9vvo=
19-
github.com/golang-jwt/jwt/v5 v5.3.0/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE=
18+
github.com/golang-jwt/jwt/v5 v5.3.1 h1:kYf81DTWFe7t+1VvL7eS+jKFVWaUnK9cB1qbwn63YCY=
19+
github.com/golang-jwt/jwt/v5 v5.3.1/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE=
2020
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
2121
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
2222
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
@@ -44,8 +44,8 @@ github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0
4444
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
4545
github.com/microcosm-cc/bluemonday v1.0.27 h1:MpEUotklkwCSLeH+Qdx1VJgNqLlpY2KXwXFM08ygZfk=
4646
github.com/microcosm-cc/bluemonday v1.0.27/go.mod h1:jFi9vgW+H7c3V0lb6nR74Ib/DIB5OBs92Dimizgw2cA=
47-
github.com/modelcontextprotocol/go-sdk v1.3.1-0.20260220105450-b17143f71798 h1:ogb5ErmcnxZgfaTeVZnKEMrwdHDpJ3yln5EhCIPcTlY=
48-
github.com/modelcontextprotocol/go-sdk v1.3.1-0.20260220105450-b17143f71798/go.mod h1:Nxc2n+n/GdCebUaqCOhTetptS17SXXNu9IfNTaLDi1E=
47+
github.com/modelcontextprotocol/go-sdk v1.5.0 h1:CHU0FIX9kpueNkxuYtfYQn1Z0slhFzBZuq+x6IiblIU=
48+
github.com/modelcontextprotocol/go-sdk v1.5.0/go.mod h1:gggDIhoemhWs3BGkGwd1umzEXCEMMvAnhTrnbXJKKKA=
4949
github.com/muesli/cache2go v0.0.0-20221011235721-518229cd8021 h1:31Y+Yu373ymebRdJN1cWLLooHH8xAr0MhKTEJGV/87g=
5050
github.com/muesli/cache2go v0.0.0-20221011235721-518229cd8021/go.mod h1:WERUkUryfUWlrHnFSO/BEUZ+7Ns8aZy7iVOGewxKzcc=
5151
github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=
@@ -59,8 +59,8 @@ github.com/sagikazarmark/locafero v0.11.0 h1:1iurJgmM9G3PA/I+wWYIOw/5SyBtxapeHDc
5959
github.com/sagikazarmark/locafero v0.11.0/go.mod h1:nVIGvgyzw595SUSUE6tvCp3YYTeHs15MvlmU87WwIik=
6060
github.com/segmentio/asm v1.1.3 h1:WM03sfUOENvvKexOLp+pCqgb/WDjsi7EK8gIsICtzhc=
6161
github.com/segmentio/asm v1.1.3/go.mod h1:Ld3L4ZXGNcSLRg4JBsZ3//1+f/TjYl0Mzen/DQy1EJg=
62-
github.com/segmentio/encoding v0.5.3 h1:OjMgICtcSFuNvQCdwqMCv9Tg7lEOXGwm1J5RPQccx6w=
63-
github.com/segmentio/encoding v0.5.3/go.mod h1:HS1ZKa3kSN32ZHVZ7ZLPLXWvOVIiZtyJnO1gPH1sKt0=
62+
github.com/segmentio/encoding v0.5.4 h1:OW1VRern8Nw6ITAtwSZ7Idrl3MXCFwXHPgqESYfvNt0=
63+
github.com/segmentio/encoding v0.5.4/go.mod h1:HS1ZKa3kSN32ZHVZ7ZLPLXWvOVIiZtyJnO1gPH1sKt0=
6464
github.com/shurcooL/githubv4 v0.0.0-20240727222349-48295856cce7 h1:cYCy18SHPKRkvclm+pWm1Lk4YrREb4IOIb/YdFO0p2M=
6565
github.com/shurcooL/githubv4 v0.0.0-20240727222349-48295856cce7/go.mod h1:zqMwyHmnN/eDOZOdiTohqIUKUrTFX62PNlu7IJdu0q8=
6666
github.com/shurcooL/graphql v0.0.0-20230722043721-ed46e5a46466 h1:17JxqqJY66GmZVHkmAsGEkcIu0oCe3AM420QDgGwZx0=
@@ -101,8 +101,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug
101101
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
102102
golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8=
103103
golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
104-
golang.org/x/oauth2 v0.34.0 h1:hqK/t4AKgbqWkdkcAeI8XLmbK+4m4G5YeQRrmiotGlw=
105-
golang.org/x/oauth2 v0.34.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA=
104+
golang.org/x/oauth2 v0.35.0 h1:Mv2mzuHuZuY2+bkyWXIHMfhNdJAdwW3FuWeCPYN5GVQ=
105+
golang.org/x/oauth2 v0.35.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA=
106106
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
107107
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
108108
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -112,8 +112,8 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc
112112
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
113113
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
114114
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
115-
golang.org/x/sys v0.40.0 h1:DBZZqJ2Rkml6QMQsZywtnjnnGvHza6BTfYFWY9kjEWQ=
116-
golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
115+
golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k=
116+
golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
117117
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
118118
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
119119
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
@@ -128,8 +128,8 @@ golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGm
128128
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
129129
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
130130
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
131-
golang.org/x/tools v0.41.0 h1:a9b8iMweWG+S0OBnlU36rzLp20z1Rp10w+IY2czHTQc=
132-
golang.org/x/tools v0.41.0/go.mod h1:XSY6eDqxVNiYgezAVqqCeihT4j1U2CCsqvH3WhQpnlg=
131+
golang.org/x/tools v0.42.0 h1:uNgphsn75Tdz5Ji2q36v/nsFSfR/9BRFvqhGBaJGd5k=
132+
golang.org/x/tools v0.42.0/go.mod h1:Ma6lCIwGZvHK6XtgbswSoWroEkhugApmsXyrUmBhfr0=
133133
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
134134
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
135135
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
{
2+
"annotations": {
3+
"destructiveHint": false,
4+
"openWorldHint": true,
5+
"title": "Add Pull Request Review Comment"
6+
},
7+
"description": "Add a review comment to the current user's pending pull request review.",
8+
"inputSchema": {
9+
"properties": {
10+
"body": {
11+
"description": "The comment body",
12+
"type": "string"
13+
},
14+
"line": {
15+
"description": "The line number in the diff to comment on (optional)",
16+
"type": "number"
17+
},
18+
"owner": {
19+
"description": "Repository owner (username or organization)",
20+
"type": "string"
21+
},
22+
"path": {
23+
"description": "The relative path of the file to comment on",
24+
"type": "string"
25+
},
26+
"pullNumber": {
27+
"description": "The pull request number",
28+
"minimum": 1,
29+
"type": "number"
30+
},
31+
"repo": {
32+
"description": "Repository name",
33+
"type": "string"
34+
},
35+
"side": {
36+
"description": "The side of the diff to comment on (optional)",
37+
"enum": [
38+
"LEFT",
39+
"RIGHT"
40+
],
41+
"type": "string"
42+
},
43+
"startLine": {
44+
"description": "The start line of a multi-line comment (optional)",
45+
"type": "number"
46+
},
47+
"startSide": {
48+
"description": "The start side of a multi-line comment (optional)",
49+
"enum": [
50+
"LEFT",
51+
"RIGHT"
52+
],
53+
"type": "string"
54+
},
55+
"subjectType": {
56+
"description": "The subject type of the comment",
57+
"enum": [
58+
"FILE",
59+
"LINE"
60+
],
61+
"type": "string"
62+
}
63+
},
64+
"required": [
65+
"owner",
66+
"repo",
67+
"pullNumber",
68+
"path",
69+
"body",
70+
"subjectType"
71+
],
72+
"type": "object"
73+
},
74+
"name": "add_pull_request_review_comment"
75+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"annotations": {
3+
"destructiveHint": false,
4+
"openWorldHint": true,
5+
"title": "Add Sub-Issue"
6+
},
7+
"description": "Add a sub-issue to a parent issue.",
8+
"inputSchema": {
9+
"properties": {
10+
"issue_number": {
11+
"description": "The parent issue number",
12+
"minimum": 1,
13+
"type": "number"
14+
},
15+
"owner": {
16+
"description": "Repository owner (username or organization)",
17+
"type": "string"
18+
},
19+
"replace_parent": {
20+
"description": "If true, reparent the sub-issue if it already has a parent",
21+
"type": "boolean"
22+
},
23+
"repo": {
24+
"description": "Repository name",
25+
"type": "string"
26+
},
27+
"sub_issue_id": {
28+
"description": "The ID of the sub-issue to add. ID is not the same as issue number",
29+
"type": "number"
30+
}
31+
},
32+
"required": [
33+
"owner",
34+
"repo",
35+
"issue_number",
36+
"sub_issue_id"
37+
],
38+
"type": "object"
39+
},
40+
"name": "add_sub_issue"
41+
}

pkg/github/__toolsnaps__/create_issue.snap

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,18 @@
11
{
22
"annotations": {
3-
"title": "Open new issue",
4-
"readOnlyHint": false
3+
"destructiveHint": false,
4+
"openWorldHint": true,
5+
"title": "Create Issue"
56
},
6-
"description": "Create a new issue in a GitHub repository.",
7+
"description": "Create a new issue in a GitHub repository with a title and optional body.",
78
"inputSchema": {
89
"properties": {
9-
"assignees": {
10-
"description": "Usernames to assign to this issue",
11-
"items": {
12-
"type": "string"
13-
},
14-
"type": "array"
15-
},
1610
"body": {
17-
"description": "Issue body content",
11+
"description": "Issue body content (optional)",
1812
"type": "string"
1913
},
20-
"labels": {
21-
"description": "Labels to apply to this issue",
22-
"items": {
23-
"type": "string"
24-
},
25-
"type": "array"
26-
},
27-
"milestone": {
28-
"description": "Milestone number",
29-
"type": "number"
30-
},
3114
"owner": {
32-
"description": "Repository owner",
15+
"description": "Repository owner (username or organization)",
3316
"type": "string"
3417
},
3518
"repo": {
@@ -39,10 +22,6 @@
3922
"title": {
4023
"description": "Issue title",
4124
"type": "string"
42-
},
43-
"type": {
44-
"description": "Type of this issue",
45-
"type": "string"
4625
}
4726
},
4827
"required": [
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"annotations": {
3+
"destructiveHint": false,
4+
"openWorldHint": true,
5+
"title": "Create Pull Request Review"
6+
},
7+
"description": "Create a review on a pull request. If event is provided, the review is submitted immediately; otherwise a pending review is created.",
8+
"inputSchema": {
9+
"properties": {
10+
"body": {
11+
"description": "The review body text (optional)",
12+
"type": "string"
13+
},
14+
"commitID": {
15+
"description": "The SHA of the commit to review (optional, defaults to latest)",
16+
"type": "string"
17+
},
18+
"event": {
19+
"description": "The review action to perform. If omitted, creates a pending review.",
20+
"enum": [
21+
"APPROVE",
22+
"REQUEST_CHANGES",
23+
"COMMENT"
24+
],
25+
"type": "string"
26+
},
27+
"owner": {
28+
"description": "Repository owner (username or organization)",
29+
"type": "string"
30+
},
31+
"pullNumber": {
32+
"description": "The pull request number",
33+
"minimum": 1,
34+
"type": "number"
35+
},
36+
"repo": {
37+
"description": "Repository name",
38+
"type": "string"
39+
}
40+
},
41+
"required": [
42+
"owner",
43+
"repo",
44+
"pullNumber"
45+
],
46+
"type": "object"
47+
},
48+
"name": "create_pull_request_review"
49+
}

0 commit comments

Comments
 (0)