Skip to content

Commit 90cf458

Browse files
Merge branch 'main' into dependabot/github_actions/docker/login-action-4.0.0
2 parents 82065b4 + efcaead commit 90cf458

Some content is hidden

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

54 files changed

+4071
-138
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: Insiders Feedback
3+
about: Give feedback related to a GitHub MCP Server Insiders feature
4+
title: "Insiders Feedback: "
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
Version: Insiders
11+
12+
Feature:
13+
14+
Feedback:

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"

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,9 +1242,12 @@ The following sets of tools are available:
12421242
- `author`: Author username or email address to filter commits by (string, optional)
12431243
- `owner`: Repository owner (string, required)
12441244
- `page`: Page number for pagination (min 1) (number, optional)
1245+
- `path`: Only commits containing this file path will be returned (string, optional)
12451246
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
12461247
- `repo`: Repository name (string, required)
12471248
- `sha`: Commit SHA, branch or tag name to list commits of. If not provided, uses the default branch of the repository. If a commit SHA is provided, will list commits up to that SHA. (string, optional)
1249+
- `since`: Only commits after this date will be returned (ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ or YYYY-MM-DD) (string, optional)
1250+
- `until`: Only commits before this date will be returned (ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ or YYYY-MM-DD) (string, optional)
12481251

12491252
- **list_releases** - List releases
12501253
- **Required OAuth Scopes**: `repo`

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)

internal/ghmcp/server.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ import (
1818
"github.com/github/github-mcp-server/pkg/inventory"
1919
"github.com/github/github-mcp-server/pkg/lockdown"
2020
mcplog "github.com/github/github-mcp-server/pkg/log"
21+
"github.com/github/github-mcp-server/pkg/observability"
22+
"github.com/github/github-mcp-server/pkg/observability/metrics"
2123
"github.com/github/github-mcp-server/pkg/raw"
2224
"github.com/github/github-mcp-server/pkg/scopes"
2325
"github.com/github/github-mcp-server/pkg/translations"
@@ -116,6 +118,10 @@ func NewStdioMCPServer(ctx context.Context, cfg github.MCPServerConfig) (*mcp.Se
116118
featureChecker := createFeatureChecker(cfg.EnabledFeatures)
117119

118120
// Create dependencies for tool handlers
121+
obs, err := observability.NewExporters(cfg.Logger, metrics.NewNoopMetrics())
122+
if err != nil {
123+
return nil, fmt.Errorf("failed to create observability exporters: %w", err)
124+
}
119125
deps := github.NewBaseDeps(
120126
clients.rest,
121127
clients.gql,
@@ -128,6 +134,7 @@ func NewStdioMCPServer(ctx context.Context, cfg github.MCPServerConfig) (*mcp.Se
128134
},
129135
cfg.ContentWindowSize,
130136
featureChecker,
137+
obs,
131138
)
132139
// Build and register the tool/resource/prompt inventory
133140
inventoryBuilder := github.NewInventory(cfg.Translator).
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+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"annotations": {
3+
"destructiveHint": true,
4+
"openWorldHint": true,
5+
"title": "Delete Pending Pull Request Review"
6+
},
7+
"description": "Delete a pending pull request review.",
8+
"inputSchema": {
9+
"properties": {
10+
"owner": {
11+
"description": "Repository owner (username or organization)",
12+
"type": "string"
13+
},
14+
"pullNumber": {
15+
"description": "The pull request number",
16+
"minimum": 1,
17+
"type": "number"
18+
},
19+
"repo": {
20+
"description": "Repository name",
21+
"type": "string"
22+
}
23+
},
24+
"required": [
25+
"owner",
26+
"repo",
27+
"pullNumber"
28+
],
29+
"type": "object"
30+
},
31+
"name": "delete_pending_pull_request_review"
32+
}

0 commit comments

Comments
 (0)