Skip to content

Commit 6797a9a

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents f2d79f9 + 2f8c287 commit 6797a9a

39 files changed

+5130
-1215
lines changed

.dockerignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.github
2+
.vscode
3+
script
4+
third-party
5+
.dockerignore
6+
.gitignore
7+
**/*.yml
8+
**/*.yaml
9+
**/*.md
10+
**/*_test.go
11+
LICENSE

.github/workflows/lint.yaml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@ jobs:
2424
go mod verify
2525
go mod download
2626
27-
LINT_VERSION=1.64.8
28-
curl -fsSL https://github.com/golangci/golangci-lint/releases/download/v${LINT_VERSION}/golangci-lint-${LINT_VERSION}-linux-amd64.tar.gz | \
29-
tar xz --strip-components 1 --wildcards \*/golangci-lint
30-
mkdir -p bin && mv golangci-lint bin/
31-
3227
- name: Run checks
3328
run: |
3429
STATUS=0
@@ -41,10 +36,10 @@ jobs:
4136
STATUS=1
4237
fi
4338
}
44-
45-
assert-nothing-changed go fmt ./...
4639
assert-nothing-changed go mod tidy
47-
48-
bin/golangci-lint run --out-format=colored-line-number --timeout=3m || STATUS=$?
49-
5040
exit $STATUS
41+
42+
- name: golangci-lint
43+
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9
44+
with:
45+
version: v2.1.6

.golangci.yml

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# https://golangci-lint.run/usage/configuration
2+
version: "2"
3+
14
run:
25
timeout: 5m
36
tests: true
@@ -8,21 +11,37 @@ linters:
811
- govet
912
- errcheck
1013
- staticcheck
11-
- gofmt
12-
- goimports
1314
- revive
1415
- ineffassign
15-
- typecheck
1616
- unused
17-
- gosimple
1817
- misspell
1918
- nakedret
2019
- bodyclose
2120
- gocritic
2221
- makezero
2322
- gosec
23+
settings:
24+
staticcheck:
25+
checks:
26+
- all
27+
- '-QF1008' # Allow embedded structs to be referenced by field
28+
- '-ST1000' # Do not require package comments
29+
revive:
30+
rules:
31+
- name: exported
32+
disabled: true
33+
- name: exported
34+
disabled: true
35+
- name: package-comments
36+
disabled: true
37+
38+
formatters:
39+
enable:
40+
- gofmt
41+
- goimports
2442

2543
output:
26-
formats: colored-line-number
27-
print-issued-lines: true
28-
print-linter-name: true
44+
formats:
45+
text:
46+
print-linter-name: true
47+
print-issued-lines: true

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Please note that this project is released with a [Contributor Code of Conduct](C
1515
These are one time installations required to be able to test your changes locally as part of the pull request (PR) submission process.
1616

1717
1. install Go [through download](https://go.dev/doc/install) | [through Homebrew](https://formulae.brew.sh/formula/go)
18-
1. [install golangci-lint](https://golangci-lint.run/welcome/install/#local-installation)
18+
1. [install golangci-lint v2](https://golangci-lint.run/welcome/install/#local-installation)
1919

2020
## Submitting a pull request
2121

Dockerfile

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,26 @@
1+
FROM golang:1.24.3-alpine AS build
12
ARG VERSION="dev"
23

3-
FROM golang:1.24.2 AS build
4-
# allow this step access to build arg
5-
ARG VERSION
64
# Set the working directory
75
WORKDIR /build
86

9-
RUN go env -w GOMODCACHE=/root/.cache/go-build
7+
# Install git
8+
RUN --mount=type=cache,target=/var/cache/apk \
9+
apk add git
1010

11-
# Install dependencies
12-
COPY go.mod go.sum ./
13-
RUN --mount=type=cache,target=/root/.cache/go-build go mod download
14-
15-
COPY . ./
1611
# Build the server
17-
RUN --mount=type=cache,target=/root/.cache/go-build CGO_ENABLED=0 go build -ldflags="-s -w -X main.version=${VERSION} -X main.commit=$(git rev-parse HEAD) -X main.date=$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
18-
-o github-mcp-server cmd/github-mcp-server/main.go
12+
# go build automatically download required module dependencies to /go/pkg/mod
13+
RUN --mount=type=cache,target=/go/pkg/mod \
14+
--mount=type=cache,target=/root/.cache/go-build \
15+
--mount=type=bind,target=. \
16+
CGO_ENABLED=0 go build -ldflags="-s -w -X main.version=${VERSION} -X main.commit=$(git rev-parse HEAD) -X main.date=$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
17+
-o /bin/github-mcp-server cmd/github-mcp-server/main.go
1918

2019
# Make a stage to run the app
2120
FROM gcr.io/distroless/base-debian12
2221
# Set the working directory
2322
WORKDIR /server
2423
# Copy the binary from the build stage
25-
COPY --from=build /build/github-mcp-server .
24+
COPY --from=build /bin/github-mcp-server .
2625
# Command to run the server
2726
CMD ["./github-mcp-server", "stdio"]

README.md

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ automation and interaction capabilities for developers and tools.
1515
## Prerequisites
1616

1717
1. To run the server in a container, you will need to have [Docker](https://www.docker.com/) installed.
18-
2. Once Docker is installed, you will also need to ensure Docker is running.
18+
2. Once Docker is installed, you will also need to ensure Docker is running. The image is public; if you get errors on pull, you may have an expired token and need to `docker logout ghcr.io`.
1919
3. Lastly you will need to [Create a GitHub Personal Access Token](https://github.com/settings/personal-access-tokens/new).
2020
The MCP server can use many of the GitHub APIs, so enable the permissions that you feel comfortable granting your AI tools (to learn more about access tokens, please check out the [documentation](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens)).
2121

@@ -200,7 +200,7 @@ GITHUB_TOOLSETS="all" ./github-mcp-server
200200

201201
**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.
202202

203-
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 shear number of tools available.
203+
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.
204204

205205
### Using Dynamic Tool Discovery
206206

@@ -223,6 +223,27 @@ docker run -i --rm \
223223

224224
The flag `--gh-host` and the environment variable `GITHUB_HOST` can be used to set
225225
the GitHub Enterprise Server hostname.
226+
Prefix the hostname with the `https://` URI scheme, as it otherwise defaults to `http://` which GitHub Enterprise Server does not support.
227+
228+
``` json
229+
"github": {
230+
"command": "docker",
231+
"args": [
232+
"run",
233+
"-i",
234+
"--rm",
235+
"-e",
236+
"GITHUB_PERSONAL_ACCESS_TOKEN",
237+
"-e",
238+
"GITHUB_HOST",
239+
"ghcr.io/github/github-mcp-server"
240+
],
241+
"env": {
242+
"GITHUB_PERSONAL_ACCESS_TOKEN": "${input:github_token}",
243+
"GITHUB_HOST": "https://<your GHES domain name>"
244+
}
245+
}
246+
```
226247

227248
## i18n / Overriding Descriptions
228249

@@ -458,6 +479,13 @@ export GITHUB_MCP_TOOL_ADD_ISSUE_COMMENT_DESCRIPTION="an alternative description
458479
- `base`: New base branch name (string, optional)
459480
- `maintainer_can_modify`: Allow maintainer edits (boolean, optional)
460481

482+
- **request_copilot_review** - Request a GitHub Copilot review for a pull request (experimental; subject to GitHub API support)
483+
484+
- `owner`: Repository owner (string, required)
485+
- `repo`: Repository name (string, required)
486+
- `pullNumber`: Pull request number (number, required)
487+
- _Note_: Currently, this tool will only work for github.com
488+
461489
### Repositories
462490

463491
- **create_or_update_file** - Create or update a single file in a repository

0 commit comments

Comments
 (0)