Skip to content

Commit b19efe2

Browse files
authored
Merge branch 'main' into main
2 parents a3c3232 + e95d8ee commit b19efe2

File tree

82 files changed

+2245
-648
lines changed

Some content is hidden

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

82 files changed

+2245
-648
lines changed

.github/workflows/close-inactive-issues.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ jobs:
77
close-issues:
88
runs-on: ubuntu-latest
99
env:
10-
PR_DAYS_BEFORE_STALE: 60
11-
PR_DAYS_BEFORE_CLOSE: 120
10+
PR_DAYS_BEFORE_STALE: 30
11+
PR_DAYS_BEFORE_CLOSE: 60
1212
PR_STALE_LABEL: stale
1313
permissions:
1414
issues: write
@@ -21,8 +21,8 @@ jobs:
2121
stale-issue-label: ${{ env.PR_STALE_LABEL }}
2222
stale-issue-message: "This issue is stale because it has been open for ${{ env.PR_DAYS_BEFORE_STALE }} days with no activity. Leave a comment to avoid closing this issue in ${{ env.PR_DAYS_BEFORE_CLOSE }} days."
2323
close-issue-message: "This issue was closed because it has been inactive for ${{ env.PR_DAYS_BEFORE_CLOSE }} days since being marked as stale."
24-
days-before-pr-stale: -1
25-
days-before-pr-close: -1
24+
days-before-pr-stale: ${{ env.PR_DAYS_BEFORE_STALE }}
25+
days-before-pr-close: ${{ env.PR_DAYS_BEFORE_STALE }}
2626
# Start with the oldest items first
2727
ascending: true
2828
repo-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/docker-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
# https://github.com/docker/metadata-action
7171
- name: Extract Docker metadata
7272
id: meta
73-
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0
73+
uses: docker/metadata-action@318604b99e75e41977312d83839a89be02ca4893 # v5.9.0
7474
with:
7575
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
7676
tags: |

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ jobs:
1818
with:
1919
go-version: stable
2020
- name: golangci-lint
21-
uses: golangci/golangci-lint-action@v8
21+
uses: golangci/golangci-lint-action@v9
2222
with:
23-
version: v2.1
23+
version: v2.5

.github/workflows/moderator.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
models: read
1717
contents: read
1818
steps:
19-
- uses: actions/checkout@v4
19+
- uses: actions/checkout@v5
2020
- uses: github/ai-moderator@v1
2121
with:
2222
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/registry-releaser.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
if [[ "${{ github.ref_type }}" == "tag" ]]; then
3535
TAG="${{ github.ref_name }}"
3636
else
37-
TAG=$(git tag --sort=-version:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+' | head -n1)
37+
TAG=$(git tag --sort=-version:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | head -n1)
3838
fi
3939
IMAGE="ghcr.io/github/github-mcp-server:$TAG"
4040
@@ -59,7 +59,7 @@ jobs:
5959
if [[ "${{ github.ref_type }}" == "tag" ]]; then
6060
TAG_VERSION=$(echo "${{ github.ref_name }}" | sed 's/^v//')
6161
else
62-
LATEST_TAG=$(git tag --sort=-version:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+(-.*)?$' | head -n 1)
62+
LATEST_TAG=$(git tag --sort=-version:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | head -n 1)
6363
[ -z "$LATEST_TAG" ] && { echo "No release tag found"; exit 1; }
6464
TAG_VERSION=$(echo "$LATEST_TAG" | sed 's/^v//')
6565
echo "Using latest tag: $LATEST_TAG"

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,6 @@ bin/
1717
.DS_Store
1818

1919
# binary
20-
github-mcp-server
20+
github-mcp-server
21+
22+
.history

.golangci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ linters:
1111
- misspell
1212
- nakedret
1313
- revive
14+
- errcheck
15+
- staticcheck
16+
- govet
17+
- ineffassign
18+
- unused
1419
exclusions:
1520
generated: lax
1621
presets:

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.25.3-alpine AS build
1+
FROM golang:1.25.4-alpine AS build
22
ARG VERSION="dev"
33

44
# Set the working directory

README.md

Lines changed: 53 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,7 @@ The following sets of tools are available:
400400
| `discussions` | GitHub Discussions related tools |
401401
| `experiments` | Experimental features that are not considered stable yet |
402402
| `gists` | GitHub Gist related tools |
403+
| `git` | GitHub Git API related tools for low-level Git operations |
403404
| `issues` | GitHub Issues related tools |
404405
| `labels` | GitHub Labels related tools |
405406
| `notifications` | GitHub Notifications related tools |
@@ -413,7 +414,7 @@ The following sets of tools are available:
413414
| `users` | GitHub User related tools |
414415
<!-- END AUTOMATED TOOLSETS -->
415416

416-
### Additional Toolsets in Remote Github MCP Server
417+
### Additional Toolsets in Remote GitHub MCP Server
417418

418419
| Toolset | Description |
419420
| ----------------------- | ------------------------------------------------------------- |
@@ -611,6 +612,9 @@ The following sets of tools are available:
611612
- `filename`: Filename for simple single-file gist creation (string, required)
612613
- `public`: Whether the gist is public (boolean, optional)
613614

615+
- **get_gist** - Get Gist Content
616+
- `gist_id`: The ID of the gist (string, required)
617+
614618
- **list_gists** - List Gists
615619
- `page`: Page number for pagination (min 1) (number, optional)
616620
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
@@ -627,6 +631,19 @@ The following sets of tools are available:
627631

628632
<details>
629633

634+
<summary>Git</summary>
635+
636+
- **get_repository_tree** - Get repository tree
637+
- `owner`: Repository owner (username or organization) (string, required)
638+
- `path_filter`: Optional path prefix to filter the tree results (e.g., 'src/' to only show files in the src directory) (string, optional)
639+
- `recursive`: Setting this parameter to true returns the objects or subtrees referenced by the tree. Default is false (boolean, optional)
640+
- `repo`: Repository name (string, required)
641+
- `tree_sha`: The SHA1 value or ref (branch or tag) name of the tree. Defaults to the repository's default branch (string, optional)
642+
643+
</details>
644+
645+
<details>
646+
630647
<summary>Issues</summary>
631648

632649
- **add_issue_comment** - Add comment to issue
@@ -676,7 +693,7 @@ Options are:
676693
- `state`: New state (string, optional)
677694
- `state_reason`: Reason for the state change. Ignored unless state is changed. (string, optional)
678695
- `title`: Issue title (string, optional)
679-
- `type`: Type of this issue (string, optional)
696+
- `type`: Type of this issue. Only use if the repository has issue types configured. Use list_issue_types tool to get valid type values for the organization. If the repository doesn't support issue types, omit this parameter. (string, optional)
680697

681698
- **list_issue_types** - List available issue types
682699
- `owner`: The organization owner of the repository (string, required)
@@ -827,31 +844,37 @@ Options are:
827844
- `project_number`: The project's number. (number, required)
828845

829846
- **list_project_fields** - List project fields
847+
- `after`: Forward pagination cursor from previous pageInfo.nextCursor. (string, optional)
848+
- `before`: Backward pagination cursor from previous pageInfo.prevCursor (rare). (string, optional)
830849
- `owner`: If owner_type == user it is the handle for the GitHub user account. If owner_type == org it is the name of the organization. The name is not case sensitive. (string, required)
831850
- `owner_type`: Owner type (string, required)
832-
- `per_page`: Number of results per page (max 100, default: 30) (number, optional)
851+
- `per_page`: Results per page (max 50) (number, optional)
833852
- `project_number`: The project's number. (number, required)
834853

835854
- **list_project_items** - List project items
836-
- `fields`: Specific list of field IDs to include in the response (e.g. ["102589", "985201", "169875"]). If not provided, only the title field is included. (string[], optional)
855+
- `after`: Forward pagination cursor from previous pageInfo.nextCursor. (string, optional)
856+
- `before`: Backward pagination cursor from previous pageInfo.prevCursor (rare). (string, optional)
857+
- `fields`: Field IDs to include (e.g. ["102589", "985201"]). CRITICAL: Always provide to get field values. Without this, only titles returned. (string[], optional)
837858
- `owner`: If owner_type == user it is the handle for the GitHub user account. If owner_type == org it is the name of the organization. The name is not case sensitive. (string, required)
838859
- `owner_type`: Owner type (string, required)
839-
- `per_page`: Number of results per page (max 100, default: 30) (number, optional)
860+
- `per_page`: Results per page (max 50) (number, optional)
840861
- `project_number`: The project's number. (number, required)
841-
- `query`: Search query to filter items (string, optional)
862+
- `query`: Query string for advanced filtering of project items using GitHub's project filtering syntax. (string, optional)
842863

843864
- **list_projects** - List projects
865+
- `after`: Forward pagination cursor from previous pageInfo.nextCursor. (string, optional)
866+
- `before`: Backward pagination cursor from previous pageInfo.prevCursor (rare). (string, optional)
844867
- `owner`: If owner_type == user it is the handle for the GitHub user account. If owner_type == org it is the name of the organization. The name is not case sensitive. (string, required)
845868
- `owner_type`: Owner type (string, required)
846-
- `per_page`: Number of results per page (max 100, default: 30) (number, optional)
847-
- `query`: Filter projects by a search query (matches title and description) (string, optional)
869+
- `per_page`: Results per page (max 50) (number, optional)
870+
- `query`: Filter projects by title text and open/closed state; permitted qualifiers: is:open, is:closed; examples: "roadmap is:open", "is:open feature planning". (string, optional)
848871

849872
- **update_project_item** - Update project item
850873
- `item_id`: The unique identifier of the project item. This is not the issue or pull request ID. (number, required)
851874
- `owner`: If owner_type == user it is the handle for the GitHub user account. If owner_type == org it is the name of the organization. The name is not case sensitive. (string, required)
852875
- `owner_type`: Owner type (string, required)
853876
- `project_number`: The project's number. (number, required)
854-
- `updated_field`: Object consisting of the ID of the project field to update and the new value for the field. To clear the field, set "value" to null. Example: {"id": 123456, "value": "New Value"} (object, required)
877+
- `updated_field`: Object consisting of the ID of the project field to update and the new value for the field. To clear the field, set value to null. Example: {"id": 123456, "value": "New Value"} (object, required)
855878

856879
</details>
857880

@@ -1165,7 +1188,7 @@ Possible options:
11651188
</details>
11661189
<!-- END AUTOMATED TOOLS -->
11671190

1168-
### Additional Tools in Remote Github MCP Server
1191+
### Additional Tools in Remote GitHub MCP Server
11691192

11701193
<details>
11711194

@@ -1201,7 +1224,7 @@ Possible options:
12011224

12021225
## Dynamic Tool Discovery
12031226

1204-
**Note**: This feature is currently in beta and may not be available in all environments. Please test it out and let us know if you encounter any issues.
1227+
**Note**: This feature is currently in beta and is not available in the Remote GitHub MCP Server. Please test it out and let us know if you encounter any issues.
12051228

12061229
Instead of starting with all tools enabled, you can turn on dynamic toolset discovery. Dynamic toolsets allow the MCP host to list and enable toolsets in response to a user prompt. This should help to avoid situations where the model gets confused by the sheer number of tools available.
12071230

@@ -1239,6 +1262,25 @@ docker run -i --rm \
12391262
ghcr.io/github/github-mcp-server
12401263
```
12411264

1265+
## Lockdown Mode
1266+
1267+
Lockdown mode limits the content that the server will surface from public repositories. When enabled, requests that fetch issue details will return an error if the issue was created by someone who does not have push access to the repository. Private repositories are unaffected, and collaborators can still access their own issues.
1268+
1269+
```bash
1270+
./github-mcp-server --lockdown-mode
1271+
```
1272+
1273+
When running with Docker, set the corresponding environment variable:
1274+
1275+
```bash
1276+
docker run -i --rm \
1277+
-e GITHUB_PERSONAL_ACCESS_TOKEN=<your-token> \
1278+
-e GITHUB_LOCKDOWN_MODE=1 \
1279+
ghcr.io/github/github-mcp-server
1280+
```
1281+
1282+
At the moment lockdown mode applies to the issue read toolset, but it is designed to extend to additional data surfaces over time.
1283+
12421284
## i18n / Overriding Descriptions
12431285

12441286
The descriptions of the tools can be overridden by creating a

cmd/github-mcp-server/generate_docs.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
"github.com/github/github-mcp-server/pkg/raw"
1414
"github.com/github/github-mcp-server/pkg/toolsets"
1515
"github.com/github/github-mcp-server/pkg/translations"
16-
gogithub "github.com/google/go-github/v74/github"
16+
gogithub "github.com/google/go-github/v79/github"
1717
"github.com/mark3labs/mcp-go/mcp"
1818
"github.com/shurcooL/githubv4"
1919
"github.com/spf13/cobra"
@@ -64,7 +64,7 @@ func generateReadmeDocs(readmePath string) error {
6464
t, _ := translations.TranslationHelper()
6565

6666
// Create toolset group with mock clients
67-
tsg := github.DefaultToolsetGroup(false, mockGetClient, mockGetGQLClient, mockGetRawClient, t, 5000)
67+
tsg := github.DefaultToolsetGroup(false, mockGetClient, mockGetGQLClient, mockGetRawClient, t, 5000, github.FeatureFlags{})
6868

6969
// Generate toolsets documentation
7070
toolsetsDoc := generateToolsetsDoc(tsg)
@@ -302,7 +302,7 @@ func generateRemoteToolsetsDoc() string {
302302
t, _ := translations.TranslationHelper()
303303

304304
// Create toolset group with mock clients
305-
tsg := github.DefaultToolsetGroup(false, mockGetClient, mockGetGQLClient, mockGetRawClient, t, 5000)
305+
tsg := github.DefaultToolsetGroup(false, mockGetClient, mockGetGQLClient, mockGetRawClient, t, 5000, github.FeatureFlags{})
306306

307307
// Generate table header
308308
buf.WriteString("| Name | Description | API URL | 1-Click Install (VS Code) | Read-only Link | 1-Click Read-only Install (VS Code) |\n")

0 commit comments

Comments
 (0)