Skip to content

Commit bede236

Browse files
committed
Merge remote-tracking branch 'upstream/main' into feature/org
2 parents 6ed2205 + 121d50a commit bede236

File tree

343 files changed

+36401
-13510
lines changed

Some content is hidden

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

343 files changed

+36401
-13510
lines changed

.github/copilot-instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This is the **GitHub MCP Server**, a Model Context Protocol (MCP) server that co
99
- **Type:** MCP server application with CLI interface
1010
- **Primary Package:** github-mcp-server (stdio MCP server - **this is the main focus**)
1111
- **Secondary Package:** mcpcurl (testing utility - don't break it, but not the priority)
12-
- **Framework:** Uses mark3labs/mcp-go for MCP protocol, google/go-github for GitHub API
12+
- **Framework:** Uses modelcontextprotocol/go-sdk for MCP protocol, google/go-github for GitHub API
1313
- **Size:** ~60MB repository, 70 Go files
1414
- **Library Usage:** This repository is also used as a library by the remote server. Functions that could be called by other repositories should be exported (capitalized), even if not required internally. Preserve existing export patterns.
1515

.github/pull_request_template.md

Lines changed: 48 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,51 @@
11
<!--
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.
2+
Copilot: Fill all sections. Prefer short, concrete answers.
3+
If a checkbox is selected, add a brief explanation.
94
-->
105

11-
Closes:
6+
## Summary
7+
<!-- In 1–2 sentences: what does this PR do? -->
8+
9+
## Why
10+
<!-- Why is this change needed? Link issues or discussions. -->
11+
Fixes #
12+
13+
## What changed
14+
<!-- Bullet list of concrete changes. -->
15+
-
16+
-
17+
18+
## MCP impact
19+
<!-- Select one or more. If selected, add 1–2 sentences. -->
20+
- [ ] No tool or API changes
21+
- [ ] Tool schema or behavior changed
22+
- [ ] New tool added
23+
24+
## Prompts tested (tool changes only)
25+
<!-- If you changed or added tools, list example prompts you tested. -->
26+
<!-- Include prompts that trigger the tool and describe the use case. -->
27+
<!-- Example: "List all open issues in the repo assigned to me" -->
28+
-
29+
30+
## Security / limits
31+
<!-- Select if relevant. Add a short note if checked. -->
32+
- [ ] No security or limits impact
33+
- [ ] Auth / permissions considered
34+
- [ ] Data exposure, filtering, or token/size limits considered
35+
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+
43+
## Lint & tests
44+
<!-- Check what you ran. If not run, explain briefly. -->
45+
- [ ] Linted locally with `./script/lint`
46+
- [ ] Tested locally with `./script/test`
47+
48+
## Docs
49+
50+
- [ ] Not needed
51+
- [ ] Updated (README / docs / examples)

.github/workflows/ai-issue-assessment.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ on:
66

77
jobs:
88
ai-issue-assessment:
9-
if: >
10-
(github.event.action == 'opened' && github.event.issue.labels[0] == null) ||
11-
(github.event.action == 'labeled' && github.event.label.name == 'bug')
129
runs-on: ubuntu-latest
1310
permissions:
1411
issues: write
@@ -23,8 +20,8 @@ jobs:
2320
uses: github/ai-assessment-comment-labeler@e3bedc38cfffa9179fe4cee8f7ecc93bffb3fee7 # v1.0.1
2421
with:
2522
token: ${{ secrets.GITHUB_TOKEN }}
26-
ai_review_label: 'bug, enhancement'
23+
ai_review_label: "request ai review"
2724
issue_number: ${{ github.event.issue.number }}
2825
issue_body: ${{ github.event.issue.body }}
29-
prompts_directory: '.github/prompts'
30-
labels_to_prompts_mapping: 'bug,bug-report-review.prompt.yml|default,default-issue-review.prompt.yml'
26+
prompts_directory: ".github/prompts"
27+
labels_to_prompts_mapping: "bug,bug-report-review.prompt.yml|default,default-issue-review.prompt.yml"

.github/workflows/code-scanning.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ env:
1414
jobs:
1515
analyze:
1616
name: Analyze (${{ matrix.language }})
17+
# Only run on the main repository, not on forks
18+
if: github.repository == 'github/github-mcp-server'
1719
runs-on: ${{ fromJSON(matrix.runner) }}
1820
permissions:
1921
actions: read
@@ -46,6 +48,9 @@ jobs:
4648
queries: "" # Default query suite
4749
packs: github/ccr-${{ matrix.language }}-queries
4850
config: |
51+
paths-ignore:
52+
- third-party
53+
- third-party-licenses.*.md
4954
default-setup:
5055
org:
5156
model-packs: [ ${{ github.event.inputs.code_scanning_codeql_packs }} ]

.github/workflows/docker-publish.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ 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
6161
- name: Log into registry ${{ env.REGISTRY }}
6262
if: github.event_name != 'pull_request'
63-
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
63+
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
6464
with:
6565
registry: ${{ env.REGISTRY }}
6666
username: ${{ github.actor }}
@@ -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@318604b99e75e41977312d83839a89be02ca4893 # v5.9.0
73+
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5.10.0
7474
with:
7575
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
7676
tags: |
@@ -87,7 +87,7 @@ jobs:
8787
type=raw,value=latest,enable=${{ github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-') }}
8888
8989
- name: Go Build Cache for Docker
90-
uses: actions/cache@v4
90+
uses: actions/cache@v5
9191
with:
9292
path: go-build-cache
9393
key: ${{ runner.os }}-go-build-cache-${{ hashFiles('**/go.sum') }}

.github/workflows/go.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ jobs:
1414
runs-on: ${{ matrix.os }}
1515

1616
steps:
17+
- name: Force git to use LF
18+
# This step is required on Windows to work around go mod tidy -diff issues caused by CRLF line endings.
19+
# TODO: replace with a checkout option when https://github.com/actions/checkout/issues/226 is implemented
20+
if: runner.os == 'Windows'
21+
run: |
22+
git config --global core.autocrlf false
23+
git config --global core.eol lf
24+
1725
- name: Check out code
1826
uses: actions/checkout@v6
1927

@@ -22,8 +30,8 @@ jobs:
2230
with:
2331
go-version-file: "go.mod"
2432

25-
- name: Download dependencies
26-
run: go mod download
33+
- name: Tidy dependencies
34+
run: go mod tidy -diff
2735

2836
- name: Run unit tests
2937
run: script/test
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Label issues for AI review
2+
on:
3+
issues:
4+
types:
5+
- reopened
6+
- opened
7+
jobs:
8+
label_issues:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
issues: write
12+
steps:
13+
- name: Add AI review label to issue
14+
run: gh issue edit "$NUMBER" --add-label "$LABELS"
15+
env:
16+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17+
GH_REPO: ${{ github.repository }}
18+
NUMBER: ${{ github.event.issue.number }}
19+
LABELS: "request ai review"
Lines changed: 97 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:
@@ -13,9 +26,88 @@ jobs:
1326
- name: Check out code
1427
uses: actions/checkout@v6
1528

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

.github/workflows/mcp-diff.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: MCP Server Diff
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
tags: ['v*']
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
mcp-diff:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Check out code
18+
uses: actions/checkout@v6
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Run MCP Server Diff
23+
uses: SamMorrowDrums/mcp-server-diff@v2.3.5
24+
with:
25+
setup_go: "true"
26+
install_command: go mod download
27+
start_command: go run ./cmd/github-mcp-server stdio
28+
env_vars: |
29+
GITHUB_PERSONAL_ACCESS_TOKEN=test-token
30+
configurations: |
31+
[
32+
{"name": "default", "args": ""},
33+
{"name": "read-only", "args": "--read-only"},
34+
{"name": "dynamic-toolsets", "args": "--dynamic-toolsets"},
35+
{"name": "read-only+dynamic", "args": "--read-only --dynamic-toolsets"},
36+
{"name": "toolsets-repos", "args": "--toolsets=repos"},
37+
{"name": "toolsets-issues", "args": "--toolsets=issues"},
38+
{"name": "toolsets-context", "args": "--toolsets=context"},
39+
{"name": "toolsets-pull_requests", "args": "--toolsets=pull_requests"},
40+
{"name": "toolsets-repos,issues", "args": "--toolsets=repos,issues"},
41+
{"name": "toolsets-issues,context", "args": "--toolsets=issues,context"},
42+
{"name": "toolsets-all", "args": "--toolsets=all"},
43+
{"name": "tools-get_me", "args": "--tools=get_me"},
44+
{"name": "tools-get_me,list_issues", "args": "--tools=get_me,list_issues"},
45+
{"name": "toolsets-repos+read-only", "args": "--toolsets=repos --read-only"},
46+
{"name": "toolsets-all+dynamic", "args": "--toolsets=all --dynamic-toolsets"},
47+
{"name": "toolsets-repos+dynamic", "args": "--toolsets=repos --dynamic-toolsets"},
48+
{"name": "toolsets-repos,issues+dynamic", "args": "--toolsets=repos,issues --dynamic-toolsets"},
49+
{
50+
"name": "dynamic-tool-calls",
51+
"args": "--dynamic-toolsets",
52+
"custom_messages": [
53+
{"id": 10, "name": "list_toolsets_before", "message": {"jsonrpc": "2.0", "id": 10, "method": "tools/call", "params": {"name": "list_available_toolsets", "arguments": {}}}},
54+
{"id": 11, "name": "get_toolset_tools", "message": {"jsonrpc": "2.0", "id": 11, "method": "tools/call", "params": {"name": "get_toolset_tools", "arguments": {"toolset": "repos"}}}},
55+
{"id": 12, "name": "enable_toolset", "message": {"jsonrpc": "2.0", "id": 12, "method": "tools/call", "params": {"name": "enable_toolset", "arguments": {"toolset": "repos"}}}},
56+
{"id": 13, "name": "list_toolsets_after", "message": {"jsonrpc": "2.0", "id": 13, "method": "tools/call", "params": {"name": "list_available_toolsets", "arguments": {}}}}
57+
]
58+
}
59+
]
60+
61+
- name: Add interpretation note
62+
if: always()
63+
run: |
64+
echo "" >> $GITHUB_STEP_SUMMARY
65+
echo "---" >> $GITHUB_STEP_SUMMARY
66+
echo "" >> $GITHUB_STEP_SUMMARY
67+
echo "ℹ️ **Note:** Differences may be intentional improvements." >> $GITHUB_STEP_SUMMARY
68+
echo "" >> $GITHUB_STEP_SUMMARY
69+
echo "Common expected differences:" >> $GITHUB_STEP_SUMMARY
70+
echo "- New tools/toolsets added" >> $GITHUB_STEP_SUMMARY
71+
echo "- Tool descriptions updated" >> $GITHUB_STEP_SUMMARY
72+
echo "- Capability changes (intentional improvements)" >> $GITHUB_STEP_SUMMARY

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,8 @@ bin/
1818

1919
# binary
2020
github-mcp-server
21+
mcpcurl
22+
e2e.test
2123

22-
.history
24+
.history
25+
conformance-report/

0 commit comments

Comments
 (0)