Skip to content

Commit dfa5cd3

Browse files
authored
Merge branch 'main' into almaleksia/auto-resolve-default-branch
2 parents fda28d2 + 7e32623 commit dfa5cd3

File tree

14 files changed

+143
-36
lines changed

14 files changed

+143
-36
lines changed

.github/pull_request_template.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@ Fixes #
3333
- [ ] Auth / permissions considered
3434
- [ ] Data exposure, filtering, or token/size limits considered
3535

36+
## Tool renaming
37+
- [ ] I am renaming tools as part of this PR (e.g. a part of a consolidation effort)
38+
- [ ] I have added the new tool aliases in `deprecated_tool_aliases.go`
39+
- [ ] I am not renaming tools as part of this PR
40+
41+
Note: if you're renaming tools, you *must* add the tool aliases. For more information on how to do so, please refer to the [official docs](https://github.com/github/github-mcp-server/blob/main/docs/tool-renaming.md).
42+
3643
## Lint & tests
3744
<!-- Check what you ran. If not run, explain briefly. -->
3845
- [ ] Linted locally with `./script/lint`

.github/workflows/code-scanning.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ jobs:
4646
queries: "" # Default query suite
4747
packs: github/ccr-${{ matrix.language }}-queries
4848
config: |
49+
paths-ignore:
50+
- third-party
51+
- third-party-licenses.*.md
4952
default-setup:
5053
org:
5154
model-packs: [ ${{ github.event.inputs.code_scanning_codeql_packs }} ]

.github/workflows/docker-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
# multi-platform images and export cache
5555
# https://github.com/docker/setup-buildx-action
5656
- name: Set up Docker Buildx
57-
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
57+
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
5858

5959
# Login against a Docker registry except on PR
6060
# https://github.com/docker/login-action
Lines changed: 93 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,22 @@
1-
# Create a github action that runs the license check script and fails if it exits with a non-zero status
1+
# Automatically fix license files on PRs that need updates
2+
# Tries to auto-commit the fix, or comments with instructions if push fails
23

34
name: License Check
4-
on: [push, pull_request]
5+
on:
6+
pull_request:
7+
branches:
8+
- main # Only run when PR targets main
9+
paths:
10+
- "**.go"
11+
- go.mod
12+
- go.sum
13+
- ".github/licenses.tmpl"
14+
- "script/licenses*"
15+
- "third-party-licenses.*.md"
16+
- "third-party/**"
517
permissions:
6-
contents: read
18+
contents: write
19+
pull-requests: write
720

821
jobs:
922
license-check:
@@ -12,10 +25,85 @@ jobs:
1225
steps:
1326
- name: Check out code
1427
uses: actions/checkout@v6
28+
with:
29+
ref: ${{ github.head_ref }}
1530

1631
- name: Set up Go
1732
uses: actions/setup-go@v6
1833
with:
1934
go-version-file: "go.mod"
20-
- name: check licenses
21-
run: ./script/licenses-check
35+
36+
# actions/setup-go does not setup the installed toolchain to be preferred over the system install,
37+
# which causes go-licenses to raise "Package ... does not have module info" errors.
38+
# For more information, https://github.com/google/go-licenses/issues/244#issuecomment-1885098633
39+
- name: Regenerate licenses
40+
env:
41+
CI: "true"
42+
run: |
43+
export GOROOT=$(go env GOROOT)
44+
export PATH=${GOROOT}/bin:$PATH
45+
./script/licenses
46+
47+
- name: Check for changes
48+
id: changes
49+
continue-on-error: true
50+
run: script/licenses-check
51+
52+
- name: Commit and push fixes
53+
if: steps.changes.outcome == 'failure'
54+
continue-on-error: true
55+
id: push
56+
run: |
57+
git config user.name "github-actions[bot]"
58+
git config user.email "github-actions[bot]@users.noreply.github.com"
59+
git add third-party-licenses.*.md third-party/
60+
git commit -m "chore: regenerate license files" -m "Auto-generated by license-check workflow"
61+
git push
62+
63+
- name: Check if already commented
64+
if: steps.changes.outcome == 'failure' && steps.push.outcome == 'failure'
65+
id: check_comment
66+
uses: actions/github-script@v7
67+
with:
68+
script: |
69+
const { data: comments } = await github.rest.issues.listComments({
70+
owner: context.repo.owner,
71+
repo: context.repo.repo,
72+
issue_number: context.issue.number
73+
});
74+
75+
const alreadyCommented = comments.some(comment =>
76+
comment.user.login === 'github-actions[bot]' &&
77+
comment.body.includes('## ⚠️ License files need updating')
78+
);
79+
80+
core.setOutput('already_commented', alreadyCommented ? 'true' : 'false');
81+
82+
- name: Comment with instructions if cannot push
83+
if: steps.changes.outcome == 'failure' && steps.push.outcome == 'failure' && steps.check_comment.outputs.already_commented == 'false'
84+
uses: actions/github-script@v7
85+
with:
86+
script: |
87+
await github.rest.issues.createComment({
88+
owner: context.repo.owner,
89+
repo: context.repo.repo,
90+
issue_number: context.issue.number,
91+
body: `## ⚠️ License files need updating
92+
93+
The license files are out of date. I tried to fix them automatically but don't have permission to push to this branch.
94+
95+
**Please run:**
96+
\`\`\`bash
97+
script/licenses
98+
git add third-party-licenses.*.md third-party/
99+
git commit -m "chore: regenerate license files"
100+
git push
101+
\`\`\`
102+
103+
Alternatively, enable "Allow edits by maintainers" in the PR settings so I can fix it automatically.`
104+
});
105+
106+
- name: Fail check if changes needed
107+
if: steps.changes.outcome == 'failure'
108+
run: exit 1
109+

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ When using Docker, you can pass the toolsets as environment variables:
393393
```bash
394394
docker run -i --rm \
395395
-e GITHUB_PERSONAL_ACCESS_TOKEN=<your-token> \
396-
-e GITHUB_TOOLSETS="repos,issues,pull_requests,actions,code_security,experiments" \
396+
-e GITHUB_TOOLSETS="repos,issues,pull_requests,actions,code_security" \
397397
ghcr.io/github/github-mcp-server
398398
```
399399

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ go 1.24.0
44

55
require (
66
github.com/google/go-github/v79 v79.0.0
7-
github.com/google/jsonschema-go v0.3.0
7+
github.com/google/jsonschema-go v0.4.2
88
github.com/josephburnett/jd v1.9.2
99
github.com/microcosm-cc/bluemonday v1.0.27
1010
github.com/migueleliasweb/go-github-mock v1.3.0
1111
github.com/muesli/cache2go v0.0.0-20221011235721-518229cd8021
12-
github.com/spf13/cobra v1.10.1
12+
github.com/spf13/cobra v1.10.2
1313
github.com/spf13/viper v1.21.0
1414
github.com/stretchr/testify v1.11.1
1515
)
@@ -37,7 +37,7 @@ require (
3737
github.com/go-viper/mapstructure/v2 v2.4.0
3838
github.com/google/go-querystring v1.1.0 // indirect
3939
github.com/inconshreveable/mousetrap v1.1.0 // indirect
40-
github.com/modelcontextprotocol/go-sdk v1.2.0-pre.1
40+
github.com/modelcontextprotocol/go-sdk v1.2.0
4141
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
4242
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
4343
github.com/rogpeppe/go-internal v1.13.1 // indirect

go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ github.com/google/go-github/v79 v79.0.0 h1:MdodQojuFPBhmtwHiBcIGLw/e/wei2PvFX9nd
2828
github.com/google/go-github/v79 v79.0.0/go.mod h1:OAFbNhq7fQwohojb06iIIQAB9CBGYLq999myfUFnrS4=
2929
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
3030
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
31-
github.com/google/jsonschema-go v0.3.0 h1:6AH2TxVNtk3IlvkkhjrtbUc4S8AvO0Xii0DxIygDg+Q=
32-
github.com/google/jsonschema-go v0.3.0/go.mod h1:r5quNTdLOYEz95Ru18zA0ydNbBuYoo9tgaYcxEYhJVE=
31+
github.com/google/jsonschema-go v0.4.2 h1:tmrUohrwoLZZS/P3x7ex0WAVknEkBZM46iALbcqoRA8=
32+
github.com/google/jsonschema-go v0.4.2/go.mod h1:r5quNTdLOYEz95Ru18zA0ydNbBuYoo9tgaYcxEYhJVE=
3333
github.com/gorilla/css v1.0.1 h1:ntNaBIghp6JmvWnxbZKANoLyuXTPZ4cAMlo6RyhlbO8=
3434
github.com/gorilla/css v1.0.1/go.mod h1:BvnYkspnSzMmwRK+b8/xgNPLiIuNZr6vbZBTPQ2A3b0=
3535
github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=
@@ -57,8 +57,8 @@ github.com/microcosm-cc/bluemonday v1.0.27 h1:MpEUotklkwCSLeH+Qdx1VJgNqLlpY2KXwX
5757
github.com/microcosm-cc/bluemonday v1.0.27/go.mod h1:jFi9vgW+H7c3V0lb6nR74Ib/DIB5OBs92Dimizgw2cA=
5858
github.com/migueleliasweb/go-github-mock v1.3.0 h1:2sVP9JEMB2ubQw1IKto3/fzF51oFC6eVWOOFDgQoq88=
5959
github.com/migueleliasweb/go-github-mock v1.3.0/go.mod h1:ipQhV8fTcj/G6m7BKzin08GaJ/3B5/SonRAkgrk0zCY=
60-
github.com/modelcontextprotocol/go-sdk v1.2.0-pre.1 h1:14+JrlEIFvUmbu5+iJzWPLk8CkpvegfKr42oXyjp3O4=
61-
github.com/modelcontextprotocol/go-sdk v1.2.0-pre.1/go.mod h1:6fM3LCm3yV7pAs8isnKLn07oKtB0MP9LHd3DfAcKw10=
60+
github.com/modelcontextprotocol/go-sdk v1.2.0 h1:Y23co09300CEk8iZ/tMxIX1dVmKZkzoSBZOpJwUnc/s=
61+
github.com/modelcontextprotocol/go-sdk v1.2.0/go.mod h1:6fM3LCm3yV7pAs8isnKLn07oKtB0MP9LHd3DfAcKw10=
6262
github.com/muesli/cache2go v0.0.0-20221011235721-518229cd8021 h1:31Y+Yu373ymebRdJN1cWLLooHH8xAr0MhKTEJGV/87g=
6363
github.com/muesli/cache2go v0.0.0-20221011235721-518229cd8021/go.mod h1:WERUkUryfUWlrHnFSO/BEUZ+7Ns8aZy7iVOGewxKzcc=
6464
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
@@ -82,8 +82,8 @@ github.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I=
8282
github.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg=
8383
github.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY=
8484
github.com/spf13/cast v1.10.0/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo=
85-
github.com/spf13/cobra v1.10.1 h1:lJeBwCfmrnXthfAupyUTzJ/J4Nc1RsHC/mSRU2dll/s=
86-
github.com/spf13/cobra v1.10.1/go.mod h1:7SmJGaTHFVBY0jW4NXGluQoLvhqFQM+6XSKD+P4XaB0=
85+
github.com/spf13/cobra v1.10.2 h1:DMTTonx5m65Ic0GOoRY2c16WCbHxOOw6xxezuLaBpcU=
86+
github.com/spf13/cobra v1.10.2/go.mod h1:7C1pvHqHw5A4vrJfjNwvOdzYu0Gml16OCs2GRiTUUS4=
8787
github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
8888
github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=
8989
github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=

pkg/github/tools.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,6 @@ var (
9292
Description: "GitHub Notifications related tools",
9393
Icon: "bell",
9494
}
95-
ToolsetMetadataExperiments = inventory.ToolsetMetadata{
96-
ID: "experiments",
97-
Description: "Experimental features that are not considered stable yet",
98-
Icon: "beaker",
99-
}
10095
ToolsetMetadataDiscussions = inventory.ToolsetMetadata{
10196
ID: "discussions",
10297
Description: "GitHub Discussions related tools",

pkg/octicons/octicons.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,12 @@ func Icons(name string) []mcp.Icon {
7373
{
7474
Source: DataURI(name, ThemeLight),
7575
MIMEType: "image/png",
76-
Theme: string(ThemeLight),
76+
Theme: mcp.IconThemeLight,
7777
},
7878
{
7979
Source: DataURI(name, ThemeDark),
8080
MIMEType: "image/png",
81-
Theme: string(ThemeDark),
81+
Theme: mcp.IconThemeDark,
8282
},
8383
}
8484
}

pkg/octicons/octicons_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"strings"
55
"testing"
66

7+
"github.com/modelcontextprotocol/go-sdk/mcp"
78
"github.com/stretchr/testify/assert"
89
)
910

@@ -87,13 +88,13 @@ func TestIcons(t *testing.T) {
8788
assert.Equal(t, DataURI(tc.icon, ThemeLight), result[0].Source)
8889
assert.Equal(t, "image/png", result[0].MIMEType)
8990
assert.Empty(t, result[0].Sizes) // Sizes field omitted for backward compatibility
90-
assert.Equal(t, "light", result[0].Theme)
91+
assert.Equal(t, mcp.IconThemeLight, result[0].Theme)
9192

9293
// Verify second icon is dark theme
9394
assert.Equal(t, DataURI(tc.icon, ThemeDark), result[1].Source)
9495
assert.Equal(t, "image/png", result[1].MIMEType)
9596
assert.Empty(t, result[1].Sizes) // Sizes field omitted for backward compatibility
96-
assert.Equal(t, "dark", result[1].Theme)
97+
assert.Equal(t, mcp.IconThemeDark, result[1].Theme)
9798
})
9899
}
99100
}

0 commit comments

Comments
 (0)