8000 Merge branch 'main' into dependabot/go_modules/github.com/mark3labs/m… · github/github-mcp-server@590b509 · GitHub
[go: up one dir, main page]

Skip to content

Commit 590b509

Browse files
authored
Merge branch 'main' into dependabot/go_modules/github.com/mark3labs/mcp-go-0.32.0
2 parents bc418c5 + da6476d commit 590b509

File tree

62 files changed

+4471
-30
lines changed

Some content is hidden

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

62 files changed

+4471
-30
lines changed

README.md

Lines changed: 112 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Alternatively, to manually configure VS Code, choose the appropriate JSON block
4040
```json
4141
{
4242
"servers": {
43-
"github-remote": {
43+
"github": {
4444
"type": "http",
4545
"url": "https://api.githubcopilot.com/mcp/"
4646
}
@@ -54,7 +54,7 @@ Alternatively, to manually configure VS Code, choose the appropriate JSON block
5454
```json
5555
{
5656
"servers": {
57-
"github-remote": {
57+
"github": {
5858
"type": "http",
5959
"url": "https://api.githubcopilot.com/mcp/",
6060
"headers": {
@@ -89,7 +89,7 @@ For MCP Hosts that are [Remote MCP-compatible](docs/host-integration.md), choose
8989
```json
9090
{
9191
"mcpServers": {
92-
"github-remote": {
92+
"github": {
9393
"url": "https://api.githubcopilot.com/mcp/"
9494
}
9595
}
@@ -102,7 +102,7 @@ For MCP Hosts that are [Remote MCP-compatible](docs/host-integration.md), choose
102102
```json
103103
{
104104
"mcpServers": {
105-
"github-remote": {
105+
"github": {
106106
"url": "https://api.githubcopilot.com/mcp/",
107107
"authorization_token": "Bearer <your GitHub PAT>"
108108
}
@@ -265,6 +265,7 @@ The following sets of tools are available (all are on by default):
265265

266266
| Toolset | Description |
267267
| ----------------------- | ------------------------------------------------------------- |
268+
| `actions` | GitHub Actions workflows and CI/CD operations |
268269
| `context` | **Strongly recommended**: Tools that provide context about the current user and GitHub context you are operating in |
269270
| `code_security` | Code scanning alerts and security features |
270271
| `issues` | Issue-related tools (create, read, update, comment) |
@@ -283,12 +284,12 @@ To specify toolsets you want available to the LLM, you can pass an allow-list in
283284
1. **Using Command Line Argument**:
284285

285286
```bash
286-
github-mcp-server --toolsets repos,issues,pull_requests,code_security
287+
github-mcp-server --toolsets repos,issues,pull_requests,actions,code_security
287288
```
288289

289290
2. **Using Environment Variable**:
290291
```bash
291-
GITHUB_TOOLSETS="repos,issues,pull_requests,code_security" ./github-mcp-server
292+
GITHUB_TOOLSETS="repos,issues,pull_requests,actions,code_security" ./github-mcp-server
292293
```
293294

294295
The environment variable `GITHUB_TOOLSETS` takes precedence over the command line argument if both are provided.
@@ -300,7 +301,7 @@ When using Docker, you can pass the toolsets as environment variables:
300301
```bash
301302
docker run -i --rm \
302303
-e GITHUB_PERSONAL_ACCESS_TOKEN=<your-token> \
303-
-e GITHUB_TOOLSETS="repos,issues,pull_requests,code_security,experiments" \
304+
-e GITHUB_TOOLSETS="repos,issues,pull_requests,actions,code_security,experiments" \
304305
ghcr.io/github/github-mcp-server
305306
```
306307

@@ -769,6 +770,110 @@ export GITHUB_MCP_TOOL_ADD_ISSUE_COMMENT_DESCRIPTION="an alternative description
769770
- `page`: Page number (number, optional)
770771
- `perPage`: Results per page (number, optional)
771772

773+
### Actions
774+
775+
- **list_workflows** - List workflows in a repository
776+
777+
- `owner`: Repository owner (string, required)
778+
- `repo`: Repository name (string, required)
779+
- `page`: Page number (number, optional)
780+
- `perPage`: Results per page (number, optional)
781+
782+
- **list_workflow_runs** - List workflow runs for a specific workflow
783+
784+
- `owner`: Repository owner (string, required)
785+
- `repo`: Repository name (string, required)
786+
- `workflow_id`: Workflow ID or filename (string, required)
787+
- `branch`: Filter by branch name (string, optional)
788+
- `event`: Filter by event type (string, optional)
789+
- `status`: Filter by run status (string, optional)
790+
- `page`: Page number (number, optional)
791+
- `perPage`: Results per page (number, optional)
792+
793+
- **run_workflow** - Trigger a workflow via workflow_dispatch event
794+
795+
- `owner`: Repository owner (string, required)
796+
- `repo`: Repository name (string, required)
797+
- `workflow_id`: Workflow ID or filename (string, required)
798+
- `ref`: Git reference (branch, tag, or SHA) (string, required)
799+
- `inputs`: Input parameters for the workflow (object, optional)
800+
801+
- **get_workflow_run** - Get details of a specific workflow run
802+
803+
- `owner`: Repository owner (string, required)
804+
- `repo`: Repository name (string, required)
805+
- `run_id`: Workflow run ID (number, required)
806+
807+
- **get_workflow_run_logs** - Download logs for a workflow run
808+
809+
- `owner`: Repository owner (string, required)
810+
- `repo`: Repository name (string, required)
811+
- `run_id`: Workflow run ID (number, required)
812+
813+
- **list_workflow_jobs** - List jobs for a workflow run
814+
815+
- `owner`: Repository owner (string, required)
816+
- `repo`: Repository name (string, required)
817+
- `run_id`: Workflow run ID (number, required)
818+
- `filter`: Filter by job status (string, optional)
819+
- `page`: Page number (number, optional)
820+
- `perPage`: Results per page (number, optional)
821+
822+
- **get_job_logs** - Download logs for a specific workflow job or efficiently get all failed job logs for a workflow run
823+
824+
- `owner`: Repository owner (string, required)
825+
- `repo`: Repository name (string, required)
826+
- `job_id`: Job ID (number, required for single job logs)
827+
- `run_id`: Workflow run ID (number, required when using failed_only)
828+
- `failed_only`: When true, gets logs for all failed jobs in run_id (boolean, optional)
829+
- `return_content`: Returns actual log content instead of URLs (boolean, optional)
830+
831+
- **rerun_workflow_run** - Re-run an entire workflow
832+
833+
- `owner`: Repository owner (string, required)
834+
- `repo`: Repository name (string, required)
835+
- `run_id`: Workflow run ID (number, required)
836+
- `enable_debug_logging`: Enable debug logging for the re-run (boolean, optional)
837+
838+
- **rerun_failed_jobs** - Re-run only the failed jobs in a workflow run
839+
840+
- `owner`: Repository owner (string, required)
841+
- `repo`: Repository name (string, required)
842+
- `run_id`: Workflow run ID (number, required)
843+
- `enable_debug_logging`: Enable debug logging for the re-run (boolean, optional)
844+
845+
- **cancel_workflow_run** - Cancel a running workflow
846+
847+
- `owner`: Repository owner (string, required)
848+
- `repo`: Repository name (string, required)
849+
- `run_id`: Workflow run ID (number, required)
850+
851+
- **list_workflow_run_artifacts** - List artifacts from a workflow run
852+
853+
- `owner`: Repository owner (string, required)
854+
- `repo`: Repository name (string, required)
855+
- `run_id`: Workflow run ID (number, required)
856+
- `page`: Page number (number, optional)
857+
- `perPage`: Results per page (number, optional)
858+
859+
- **download_workflow_run_artifact** - Get download URL for a specific artifact
860+
861+
- `owner`: Repository owner (string, required)
862+
- `repo`: Repository name (string, required)
863+
- `artifact_id`: Artifact ID (number, required)
864+
865+
- **delete_workflow_run_logs** - Delete logs for a workflow run
866+
867+
- `owner`: Repository owner (string, required)
868+
- `repo`: Repository name (string, required)
869+
- `run_id`: Workflow run ID (number, required)
870+
871+
- **get_workflow_run_usage** - Get usage metrics for a workflow run
872+
873+
- `owner`: Repository owner (string, required)
874+
- `repo`: Repository name (string, required)
875+
- `run_id`: Workflow run ID (number, required)
876+
772877
### Code Scanning
773878

774879
- **get_code_scanning_alert** - Get a code scanning alert

cmd/mcpcurl/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ The `--stdio-server-cmd` flag is required for all commands and specifies the com
3131

3232
### Examples
3333

34-
List available tools in Anthropic's MCP server:
34+
List available tools in Github's MCP server:
3535

3636
```console
3737
% ./mcpcurl --stdio-server-cmd "docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN mcp/github" tools --help

e2e/e2e_test.go

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ package e2e_test
44

55
import (
66
"context"
7-
"encoding/base64"
87
"encoding/json"
98
"fmt"
109
"net/http"
@@ -508,17 +507,14 @@ func TestFileDeletion(t *testing.T) {
508507
require.NoError(t, err, "expected to call 'get_file_contents' tool successfully")
509508
require.False(t, resp.IsError, fmt.Sprintf("expected result not to be an error: %+v", resp))
510509

511-
textContent, ok = resp.Content[0].(mcp.TextContent)
512-
require.True(t, ok, "expected content to be of type TextContent")
510+
embeddedResource, ok := resp.Content[1].(mcp.EmbeddedResource)
511+
require.True(t, ok, "expected content to be of type EmbeddedResource")
513512

514-
var trimmedGetFileText struct {
515-
Content string `json:"content"`
516-
}
517-
err = json.Unmarshal([]byte(textContent.Text), &trimmedGetFileText)
518-
require.NoError(t, err, "expected to unmarshal text content successfully")
519-
b, err := base64.StdEncoding.DecodeString(trimmedGetFileText.Content)
520-
require.NoError(t, err, "expected to decode base64 content successfully")
521-
require.Equal(t, fmt.Sprintf("Created by e2e test %s", t.Name()), string(b), "expected file content to match")
513+
// raw api
514+
textResource, ok := embeddedResource.Resource.(mcp.TextResourceContents)
515+
require.True(t, ok, "expected embedded resource to be of type TextResourceContents")
516+
517+
require.Equal(t, fmt.Sprintf("Created by e2e test %s", t.Name()), textResource.Text, "expected file content to match")
522518

523519
// Delete the file
524520
deleteFileRequest := mcp.CallToolRequest{}
@@ -703,17 +699,14 @@ func TestDirectoryDeletion(t *testing.T) {
703699
require.NoError(t, err, "expected to call 'get_file_contents' tool successfully")
704700
require.False(t, resp.IsError, fmt.Sprintf("expected result not to be an error: %+v", resp))
705701

706-
textContent, ok = resp.Content[0].(mcp.TextContent)
707-
require.True(t, ok, "expected content to be of type TextContent")
702+
embeddedResource, ok := resp.Content[1].(mcp.EmbeddedResource)
703+
require.True(t, ok, "expected content to be of type EmbeddedResource")
708704

709-
var trimmedGetFileText struct {
710-
Content string `json:"content"`
711-
}
712-
err = json.Unmarshal([]byte(textContent.Text), &trimmedGetFileText)
713-
require.NoError(t, err, "expected to unmarshal text content successfully")
714-
b, err := base64.StdEncoding.DecodeString(trimmedGetFileText.Content)
715-
require.NoError(t, err, "expected to decode base64 content successfully")
716-
require.Equal(t, fmt.Sprintf("Created by e2e test %s", t.Name()), string(b), "expected file content to match")
705+
// raw api
706+
textResource, ok := embeddedResource.Resource.(mcp.TextResourceContents)
707+
require.True(t, ok, "expected embedded resource to be of type TextResourceContents")
708+
709+
require.Equal(t, fmt.Sprintf("Created by e2e test %s", t.Name()), textResource.Text, "expected file content to match")
717710

718711
// Delete the directory containing the file
719712
deleteFileRequest := mcp.CallToolRequest{}

internal/toolsnaps/toolsnaps.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func Test(toolName string, tool any) error {
6060
diff := toolNode.Diff(snapNode, jd.SET).Render()
6161
if diff != "" {
6262
// If there is a difference, we return an error with the diff
63-
return fmt.Errorf("tool schema for %s has changed unexpectedly:\n%s", toolName, diff)
63+
return fmt.Errorf("tool schema for %s has changed unexpectedly:\n%s\nrun with `UPDATE_TOOLSNAPS=true` if this is expected", toolName, diff)
6464
}
6565

6666
return nil

internal/toolsnaps/toolsnaps_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ func TestSnapshotDoesNotExistNotInCI(t *testing.T) {
4343

4444
func TestSnapshotDoesNotExistInCI(t *testing.T) {
4545
withIsolatedWorkingDir(t)
46+
// Ensure that UPDATE_TOOLSNAPS is not set for this test, which it might be if someone is running
47+
// UPDATE_TOOLSNAPS=true go test ./...
48+
t.Setenv("UPDATE_TOOLSNAPS", "false")
4649

4750
// Given we are running in CI
4851
t.Setenv("GITHUB_ACTIONS", "true")
@@ -74,6 +77,9 @@ func TestSnapshotExistsMatch(t *testing.T) {
7477

7578
func TestSnapshotExistsDiff(t *testing.T) {
7679
withIsolatedWorkingDir(t)
80+
// Ensure that UPDATE_TOOLSNAPS is not set for this test, which it might be if someone is running
81+
// UPDATE_TOOLSNAPS=true go test ./...
82+
t.Setenv("UPDATE_TOOLSNAPS", "false")
7783

7884
// Given a non-matching snapshot file exists
7985
require.NoError(t, os.MkdirAll("__toolsnaps__", 0700))
@@ -109,6 +115,9 @@ func TestUpdateToolsnaps(t *testing.T) {
109115

110116
func TestMalformedSnapshotJSON(t *testing.T) {
111117
withIsolatedWorkingDir(t)
118+
// Ensure that UPDATE_TOOLSNAPS is not set for this test, which it might be if someone is running
119+
// UPDATE_TOOLSNAPS=true go test ./...
120+
t.Setenv("UPDATE_TOOLSNAPS", "false")
112121

113122
// Given a malformed snapshot file exists
114123
require.NoError(t, os.MkdirAll("__toolsnaps__", 0700))
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"annotations": {
3+
"title": "Add comment to issue",
4+
"readOnlyHint": false
5+
},
6+
"description": "Add a comment to a specific issue in a GitHub repository.",
7+
"inputSchema": {
8+
"properties": {
9+
"body": {
10+
"description": "Comment content",
11+
"type": "string"
12+
},
13+
"issue_number": {
14+
"description": "Issue number to comment on",
15+
"type": "number"
16+
},
17+
"owner": {
18+
"description": "Repository owner",
19+
"type": "string"
20+
},
21+
"repo": {
22+
"description": "Repository name",
23+
"type": "string"
24+
}
25+
},
26+
"required": [
27+
"owner",
28+
"repo",
29+
"issue_number",
30+
"body"
31+
],
32+
"type": "object"
33+
},
34+
"name": "add_issue_comment"
35+
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
{
2+
"annotations": {
3+
"title": "Add comment to the requester's latest pending pull request review",
4+
"readOnlyHint": false
5+
},
6+
"description": "Add a comment to the requester's latest pending pull request review, a pending review needs to already exist to call this (check with the user if not sure).",
7+
"inputSchema": {
8+
"properties": {
9+
"body": {
10+
"description": "The text of the review comment",
11+
"type": "string"
12+
},
13+
"line": {
14+
"description": "The line of the blob in the pull request diff that the comment applies to. For multi-line comments, the last line of the range",
15+
"type": "number"
16+
},
17+
"owner": {
18+
"description": "Repository owner",
19+
"type": "string"
20+
},
21+
"path": {
22+
"description": "The relative path to the file that necessitates a comment",
23+
"type": "string"
24+
},
25+
"pullNumber": {
26+
"description": "Pull request number",
27+
"type": "number"
28+
},
29+
"repo": {
30+
"description": "Repository name",
31+
"type": "string"
32+
},
33+
"side": {
34+
"description": "The side of the diff to comment on. LEFT indicates the previous state, RIGHT indicates the new state",
35+
"enum": [
36+
"LEFT",
37+
"RIGHT"
38+
],
39+
"type": "string"
40+
},
41+
"startLine": {
42+
"description": "For multi-line comments, the first line of the range that the comment applies to",
43+
"type": "number"
44+
},
45+
"startSide": {
46+
"description": "For multi-line comments, the starting side of the diff that the comment applies to. LEFT indicates the previous state, RIGHT indicates the new state",
47+
"enum": [
48+
"LEFT",
49+
"RIGHT"
50+
],
51+
"type": "string"
52+
},
53+
"subjectType": {
54+
"description": "The level at which the comment is targeted",
55+
"enum": [
56+
"FILE",
57+
"LINE"
58+
],
59+
"type": "string"
60+
}
61+
},
62+
"required": [
63+
"owner",
64+
"repo",
65+
"pullNumber",
66+
"path",
67+
"body",
68+
"subjectType"
69+
],
70+
"type": "object"
71+
},
72+
"name": "add_pull_request_review_comment_to_pending_review"
73+
}

0 commit comments

Comments
 (0)
0