Skip to content

Commit fc07242

Browse files
Merge branch 'main' into wm/boundaries
2 parents a7d6411 + 6b13742 commit fc07242

File tree

212 files changed

+145
-11351
lines changed

Some content is hidden

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

212 files changed

+145
-11351
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
name: "\U0001F41B Bug report"
3+
about: Report a bug or unexpected behavior while using GitHub MCP Server
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
### Describe the bug
11+
12+
A clear and concise description of what the bug is.
13+
14+
### Affected version
15+
16+
Please run ` docker run -i --rm ghcr.io/github/github-mcp-server ./github-mcp-server --version` and paste the output below
17+
18+
### Steps to reproduce the behavior
19+
20+
1. Type this '...'
21+
2. View the output '....'
22+
3. See error
23+
24+
### Expected vs actual behavior
25+
26+
A clear and concise description of what you expected to happen and what actually happened.
27+
28+
### Logs
29+
30+
Paste any available logs. Redact if needed.

.github/pull_request_template.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!--
2+
Thank you for contributing to GitHub MCP Server!
3+
Please reference an existing issue: `Closes #NUMBER`
4+
5+
Screenshots or videos of changed behavior is incredibly helpful and always appreciated.
6+
Consider addressing the following:
7+
- Tradeoffs: List tradeoffs you made to take on or pay down tech debt.
8+
- Alternatives: Describe alternative approaches you considered and why you discarded them.
9+
-->
10+
11+
Closes:

.github/workflows/docker-publish.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,22 @@ name: Docker
77

88
on:
99
schedule:
10-
- cron: '27 0 * * *'
10+
- cron: "27 0 * * *"
1111
push:
12-
branches: [ "main" ]
12+
branches: ["main"]
1313
# Publish semver tags as releases.
14-
tags: [ 'v*.*.*' ]
14+
tags: ["v*.*.*"]
1515
pull_request:
16-
branches: [ "main" ]
16+
branches: ["main"]
1717

1818
env:
1919
# Use docker.io for Docker Hub if empty
2020
REGISTRY: ghcr.io
2121
# github.repository as <account>/<repo>
2222
IMAGE_NAME: ${{ github.repository }}
2323

24-
2524
jobs:
2625
build:
27-
2826
runs-on: ubuntu-latest
2927
permissions:
3028
contents: read
@@ -43,7 +41,7 @@ jobs:
4341
if: github.event_name != 'pull_request'
4442
uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20 #v3.5.0
4543
with:
46-
cosign-release: 'v2.2.4'
44+
cosign-release: "v2.2.4"
4745

4846
# Set up BuildKit Docker container builder to be able to build
4947
# multi-platform images and export cache
@@ -82,6 +80,8 @@ jobs:
8280
cache-from: type=gha
8381
cache-to: type=gha,mode=max
8482
platforms: linux/amd64,linux/arm64
83+
build-args: |
84+
VERSION=${{ github.ref_name }}
8585
8686
# Sign the resulting Docker image digest except on PRs.
8787
# This will only write to the public Rekor transparency log when the Docker

Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1+
ARG VERSION="dev"
2+
13
FROM golang:1.23.7 AS build
4+
# allow this step access to build arg
5+
ARG VERSION
26
# Set the working directory
37
WORKDIR /build
48
# Copy the current directory contents into the working directory
59
COPY . .
610
# Install dependencies
711
RUN go mod download
812
# Build the server
9-
RUN CGO_ENABLED=0 go build -o github-mcp-server cmd/github-mcp-server/main.go
13+
RUN 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)" \
14+
-o github-mcp-server cmd/github-mcp-server/main.go
1015
# Make a stage to run the app
1116
FROM gcr.io/distroless/base-debian12
1217
# Set the working directory

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ Install the GitHub MCP server into VS Code by clicking here:
3030
Or run this command in your terminal:
3131

3232
```bash
33-
code --add-mcp '{"name":"github","command":"docker","args":["run", "-i", "--rm", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN", "ghcr.io/github/github-mcp-server:main"], "env": {"GITHUB_PERSONAL_ACCESS_TOKEN": "${input:github-pat}"}, "inputs": [{ "id": "github-pat", "type": "promptString", "description": "Github Personal Access Token", "password": true}]}'
33+
code --add-mcp '{"name":"github","command":"docker","args":["run", "-i", "--rm", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN", "ghcr.io/github/github-mcp-server"], "env": {"GITHUB_PERSONAL_ACCESS_TOKEN": "${input:github-pat}"}, "inputs": [{ "id": "github-pat", "type": "promptString", "description": "Github Personal Access Token", "password": true}]}'
3434

3535
```
36+
3637
VS Code is now configured and will prompt for your token the first time you use agent mode.
3738

3839
### Usage with Claude Desktop
@@ -48,7 +49,7 @@ VS Code is now configured and will prompt for your token the first time you use
4849
"--rm",
4950
"-e",
5051
"GITHUB_PERSONAL_ACCESS_TOKEN",
51-
"ghcr.io/github/github-mcp-server:main"
52+
"ghcr.io/github/github-mcp-server"
5253
],
5354
"env": {
5455
"GITHUB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>"

cmd/mcpcurl/main.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@ import (
55
"encoding/json"
66
"fmt"
77
"io"
8+
"math/big"
89
"os"
910
"os/exec"
1011
"slices"
1112
"strings"
1213

14+
"crypto/rand"
15+
1316
"github.com/spf13/cobra"
1417
"github.com/spf13/viper"
15-
"golang.org/x/exp/rand"
1618
)
1719

1820
type (
@@ -348,9 +350,13 @@ func buildArgumentsMap(cmd *cobra.Command, tool *Tool) (map[string]interface{},
348350

349351
// buildJSONRPCRequest creates a JSON-RPC request with the given tool name and arguments
350352
func buildJSONRPCRequest(method, toolName string, arguments map[string]interface{}) (string, error) {
353+
id, err := rand.Int(rand.Reader, big.NewInt(10000))
354+
if err != nil {
355+
return "", fmt.Errorf("failed to generate random ID: %w", err)
356+
}
351357
request := JSONRPCRequest{
352358
JSONRPC: "2.0",
353-
ID: rand.Intn(10000), // Random ID between 0 and 9999
359+
ID: int(id.Int64()), // Random ID between 0 and 9999
354360
Method: method,
355361
Params: RequestParams{
356362
Name: toolName,

go.mod

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@ require (
66
github.com/aws/smithy-go v1.22.3
77
github.com/docker/docker v28.0.4+incompatible
88
github.com/google/go-github/v69 v69.2.0
9-
github.com/mark3labs/mcp-go v0.14.1
9+
github.com/mark3labs/mcp-go v0.18.0
1010
github.com/migueleliasweb/go-github-mock v1.1.0
1111
github.com/sirupsen/logrus v1.9.3
1212
github.com/spf13/cobra v1.9.1
13-
github.com/spf13/viper v1.19.0
13+
github.com/spf13/viper v1.20.1
1414
github.com/stretchr/testify v1.10.0
15-
golang.org/x/exp v0.0.0-20230905200255-921286631fa9
1615
)
1716

1817
require (
@@ -23,31 +22,28 @@ require (
2322
github.com/docker/go-connections v0.5.0 // indirect
2423
github.com/docker/go-units v0.5.0 // indirect
2524
github.com/felixge/httpsnoop v1.0.4 // indirect
26-
github.com/fsnotify/fsnotify v1.7.0 // indirect
25+
github.com/fsnotify/fsnotify v1.8.0 // indirect
2726
github.com/go-logr/logr v1.4.2 // indirect
2827
github.com/go-logr/stdr v1.2.2 // indirect
28+
github.com/go-viper/mapstructure/v2 v2.2.1 // indirect
2929
github.com/gogo/protobuf v1.3.2 // indirect
3030
github.com/google/go-github/v64 v64.0.0 // indirect
3131
github.com/google/go-querystring v1.1.0 // indirect
3232
github.com/google/uuid v1.6.0 // indirect
3333
github.com/gorilla/mux v1.8.0 // indirect
34-
github.com/hashicorp/hcl v1.0.0 // indirect
3534
github.com/inconshreveable/mousetrap v1.1.0 // indirect
36-
github.com/magiconair/properties v1.8.9 // indirect
37-
github.com/mitchellh/mapstructure v1.5.0 // indirect
3835
github.com/moby/docker-image-spec v1.3.1 // indirect
3936
github.com/moby/term v0.5.0 // indirect
4037
github.com/morikuni/aec v1.0.0 // indirect
4138
github.com/opencontainers/go-digest v1.0.0 // indirect
4239
github.com/opencontainers/image-spec v1.1.1 // indirect
43-
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
40+
github.com/pelletier/go-toml/v2 v2.2.3 // indirect
4441
github.com/pkg/errors v0.9.1 // indirect
4542
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
46-
github.com/sagikazarmark/locafero v0.4.0 // indirect
47-
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
43+
github.com/sagikazarmark/locafero v0.9.0 // indirect
4844
github.com/sourcegraph/conc v0.3.0 // indirect
49-
github.com/spf13/afero v1.11.0 // indirect
50-
github.com/spf13/cast v1.6.0 // indirect
45+
github.com/spf13/afero v1.14.0 // indirect
46+
github.com/spf13/cast v1.7.1 // indirect
5147
github.com/spf13/pflag v1.0.6 // indirect
5248
github.com/subosito/gotenv v1.6.0 // indirect
5349
github.com/yosida95/uritemplate/v3 v3.0.2 // indirect
@@ -60,13 +56,11 @@ require (
6056
go.opentelemetry.io/otel/sdk v1.35.0 // indirect
6157
go.opentelemetry.io/otel/trace v1.35.0 // indirect
6258
go.opentelemetry.io/proto/otlp v1.5.0 // indirect
63-
go.uber.org/atomic v1.9.0 // indirect
64-
go.uber.org/multierr v1.9.0 // indirect
59+
go.uber.org/multierr v1.11.0 // indirect
6560
golang.org/x/sys v0.31.0 // indirect
66-
golang.org/x/text v0.21.0 // indirect
61+
golang.org/x/text v0.23.0 // indirect
6762
golang.org/x/time v0.5.0 // indirect
6863
google.golang.org/protobuf v1.36.5 // indirect
69-
gopkg.in/ini.v1 v1.67.0 // indirect
7064
gopkg.in/yaml.v3 v3.0.1 // indirect
7165
gotest.tools/v3 v3.5.1 // indirect
7266
)

0 commit comments

Comments
 (0)