Skip to content

Commit 71b96e2

Browse files
Merge remote-tracking branch 'origin/main' into docs/oauth-proxy-dcr-clarification
Keep main's request-state encryption section and the note that the override only changes advertised metadata. Describe what an OAuth proxy must provide and that the flag does not apply to the hosted server.
2 parents 98dc897 + 9a72d8d commit 71b96e2

85 files changed

Lines changed: 7352 additions & 533 deletions

File tree

Some content is hidden

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

‎.gemini-plugin/mcp.json‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"$schema": "https://agent-plugins.org/schemas/1.0.0/mcp.schema.json",
3+
"mcpServers": {
4+
"github": {
5+
"type": "streamable-http",
6+
"url": "https://api.githubcopilot.com/mcp/"
7+
}
8+
}
9+
}

‎.gemini-plugin/plugin.json‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
3+
"name": "github",
4+
"version": "1.0.0",
5+
"description": "Work with GitHub repositories, issues, pull requests, reviews, and code search through MCP.",
6+
"author": {
7+
"name": "GitHub",
8+
"url": "https://github.com/"
9+
},
10+
"homepage": "https://github.com/github/github-mcp-server",
11+
"repository": "https://github.com/github/github-mcp-server",
12+
"license": "MIT",
13+
"keywords": ["code-search", "github", "issues", "mcp", "pull-requests"]
14+
}

‎.github/agents/go-sdk-tool-migrator.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ When generating the migration guide, consider the following aspects:
1515

1616
* The initial tool file and its corresponding test file will have the `//go:build ignore` build tag, as the tests will fail if the code is not ignored. The `ignore` build tag should be removed before work begins.
1717
* The import for `github.com/mark3labs/mcp-go/mcp` should be changed to `github.com/modelcontextprotocol/go-sdk/mcp`
18-
* The return type for the tool constructor function should be updated from `mcp.Tool, server.ToolHandlerFunc` to `(mcp.Tool, mcp.ToolHandlerFor[map[string]any, any])`.
18+
* The return type for the tool constructor function should be updated from `mcp.Tool, server.ToolHandlerFunc` to `inventory.ServerTool`.
1919
* The tool handler function signature should be updated to use generics, changing from `func(ctx context.Context, mcp.CallToolRequest) (*mcp.CallToolResult, error)` to `func(context.Context, *mcp.CallToolRequest, map[string]any) (*mcp.CallToolResult, any, error)`.
2020
* The `RequiredParam`, `RequiredInt`, `RequiredBigInt`, `OptionalParamOK`, `OptionalParam`, `OptionalIntParam`, `OptionalIntParamWithDefault`, `OptionalBoolParamWithDefault`, `OptionalStringArrayParam`, `OptionalBigIntArrayParam` and `OptionalCursorPaginationParams` functions should be changed to use the tool arguments that are now passed as a map in the tool handler function, rather than extracting them from the `mcp.CallToolRequest`.
2121
* `mcp.NewToolResultText`, `mcp.NewToolResultError`, `mcp.NewToolResultErrorFromErr` and `mcp.NewToolResultResource` no longer available in `modelcontextprotocol/go-sdk`. There are a few helper functions available in `pkg/utils/result.go` that can be used to replace these, in the `utils` package.
@@ -64,7 +64,7 @@ The corresponding input schema in modelcontextprotocol/go-sdk would look like th
6464

6565
```go
6666
...
67-
return mcp.Tool{
67+
tool := mcp.Tool{
6868
Name: "list_dependabot_alerts",
6969
Description: t("TOOL_LIST_DEPENDABOT_ALERTS_DESCRIPTION", "List dependabot alerts in a GitHub repository."),
7070
Annotations: &mcp.ToolAnnotations{
@@ -86,7 +86,7 @@ return mcp.Tool{
8686
Type: "string",
8787
Description: "Filter dependabot alerts by state. Defaults to open",
8888
Enum: []any{"open", "fixed", "dismissed", "auto_dismissed"},
89-
Default: "open",
89+
Default: json.RawMessage(`"open"`),
9090
},
9191
"severity": {
9292
Type: "string",
@@ -109,4 +109,4 @@ At the end of your changes, you will continue to have an issue with the `toolsna
109109
UPDATE_TOOLSNAPS=true go test ./...
110110
```
111111

112-
You should however, only update the toolsnaps after confirming that the schema changes are intentional and correct. Some schema changes are unavoidable, such as argument ordering, however the schemas themselves should remain logically equivalent.
112+
You should however, only update the toolsnaps after confirming that the schema changes are intentional and correct. Some schema changes are unavoidable, however the schemas themselves should remain logically equivalent.

‎.github/copilot-instructions.md‎

Lines changed: 17 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@
55
This is the **GitHub MCP Server**, a Model Context Protocol (MCP) server that connects AI tools to GitHub's platform. It enables AI agents to manage repositories, issues, pull requests, workflows, and more through natural language.
66

77
**Key Details:**
8-
- **Language:** Go 1.27.3+ (~38k lines of code)
8+
- **Language:** Go 1.27.4+ (~38k lines of code)
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)
1212
- **Framework:** Uses modelcontextprotocol/go-sdk for MCP protocol, google/go-github for GitHub API
13-
- **Size:** ~60MB repository, 70 Go files
1413
- **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.
1514

1615
**Code Quality Standards:**
@@ -71,7 +70,7 @@ go test ./pkg/github -run TestGetMe
7170
├── pkg/ # Public API packages
7271
│ ├── github/ # GitHub API MCP tools implementation
7372
│ │ └── __toolsnaps__/ # Tool schema snapshots (*.snap files)
74-
│ ├── toolsets/ # Toolset configuration & management
73+
│ ├── inventory/ # Toolset configuration & management
7574
│ ├── errors/ # Error handling utilities
7675
│ ├── sanitize/ # HTML/content sanitization
7776
│ ├── log/ # Logging utilities
@@ -92,9 +91,9 @@ go test ./pkg/github -run TestGetMe
9291

9392
### Key Configuration Files
9493

95-
- **go.mod / go.sum:** Go module dependencies (Go 1.27.3+)
94+
- **go.mod / go.sum:** Go module dependencies (Go 1.27.4+)
9695
- **.golangci.yml:** Linter configuration (v2 format, ~15 linters enabled)
97-
- **Dockerfile:** Multi-stage build (golang:1.27.3-alpine → distroless)
96+
- **Dockerfile:** Multi-stage build (golang:1.27.4-alpine → distroless)
9897
- **server.json:** MCP server metadata for registry
9998
- **.goreleaser.yaml:** Release automation config
10099
- **.gitignore:** Excludes bin/, dist/, vendor/, *.DS_Store, github-mcp-server binary
@@ -112,15 +111,15 @@ go test ./pkg/github -run TestGetMe
112111

113112
## GitHub Workflows (CI/CD)
114113

115-
All workflows run on push/PR unless noted. Located in `.github/workflows/`:
114+
Located in `.github/workflows/`:
116115

117116
1. **go.yml** - Build and test on ubuntu/windows/macos. Runs `script/test` and builds binary
118-
2. **lint.yml** - Runs golangci-lint-action v2.5 (GitHub Action) with actions/setup-go stable
117+
2. **lint.yml** - Runs golangci-lint-action (GitHub Action) with actions/setup-go using go.mod
119118
3. **docs-check.yml** - Verifies README.md is up-to-date by running generate-docs and checking git diff
120119
4. **code-scanning.yml** - CodeQL security analysis for Go and GitHub Actions
121120
5. **license-check.yml** - Runs `script/licenses-check` to validate compliance
122121
6. **docker-publish.yml** - Publishes container image to ghcr.io
123-
7. **goreleaser.yml** - Creates releases (main branch only)
122+
7. **goreleaser.yml** - Creates releases (version tags only)
124123
8. **registry-releaser.yml** - Updates MCP registry
125124

126125
**All of these must pass for PR merge.** If docs-check fails, run `script/generate-docs` and commit changes.
@@ -130,7 +129,7 @@ All workflows run on push/PR unless noted. Located in `.github/workflows/`:
130129
### Unit Tests
131130

132131
- Use `testify` for assertions (`require` for critical checks, `assert` for non-blocking)
133-
- Tests are in `*_test.go` files alongside implementation (internal tests, not `_test` package)
132+
- Tests are in `*_test.go` files alongside implementation (internal and external test packages)
134133
- Mock GitHub API with `go-github-mock` (REST) or `githubv4mock` (GraphQL)
135134
- Test structure for tools:
136135
1. Test tool snapshot
@@ -174,21 +173,17 @@ All workflows run on push/PR unless noted. Located in `.github/workflows/`:
174173
### Code Patterns
175174

176175
- **Keep changes minimal and focused** on the specific issue being addressed
177-
- **Prefer clarity over cleverness** - code must be understandable by a wide audience
178176
- **Atomic commits** - each commit should be a complete, logical change
179-
- **Maintain or improve structure** - never degrade code organization
180177
- Use table-driven tests for behavioral testing
181-
- Comment sparingly - code should be self-documenting
182178
- Follow standard Go conventions (Effective Go, Go proverbs)
183179
- **Test changes thoroughly** before committing
184-
- Export functions (capitalize) if they could be used by other repos as a library
185180

186181
## Common Development Workflows
187182

188183
### Adding a New MCP Tool
189184

190185
1. Add tool implementation in `pkg/github/` (e.g., `foo_tools.go`)
191-
2. Register tool in appropriate toolset in `pkg/github/` or `pkg/toolsets/`
186+
2. Register tool in appropriate toolset in `pkg/github/`
192187
3. Update the relevant bundled skill, or add a reasoned exemption in `pkg/skills/catalog/availability_test.go`. Every tool must be covered or explicitly exempted.
193188
4. Write unit tests following the tool test pattern
194189
5. Run `UPDATE_TOOLSNAPS=true go test ./...` to create snapshot
@@ -277,22 +272,16 @@ server.json - MCP server registry metadata
277272
### Main Entry Point
278273

279274
`cmd/github-mcp-server/main.go` - Uses cobra for CLI, viper for config, supports:
280-
- `stdio` command (default) - MCP stdio transport
275+
- `stdio` command - MCP stdio transport
281276
- `generate-docs` command - Documentation generation
282277
- Flags: --toolsets, --read-only, --gh-host, --log-file
283278

284279
## Important Reminders
285280

286-
1. **PRIMARY FOCUS:** The local stdio MCP server (github-mcp-server) - this is what you should work on and test with
287-
2. **REMOTE SERVER:** Ignore remote server instructions when making code changes (unless specifically asked). This repo is used as a library by the remote server, so keep functions exported (capitalized) if they could be called by other repos, even if not needed internally.
288-
3. **ALWAYS** trust these instructions first - only search if information is incomplete or incorrect
289-
4. **NEVER** use `script/tag-release` or push tags
290-
5. **NEVER** skip `script/lint` before committing Go code changes
291-
6. **ALWAYS** update toolsnaps when changing MCP tool schemas
292-
7. **ALWAYS** run `script/generate-docs` after modifying tools
293-
8. For specific test files, use `go test ./path -run TestName` not full suite
294-
9. E2E tests require PAT token - you likely cannot run them
295-
10. Toolsnaps are API documentation - treat changes seriously
296-
11. Build/test/lint are very fast (~1s each) - run frequently
297-
12. CI failures for docs-check or license-check have simple fixes (run the script)
298-
13. mcpcurl is secondary - don't break it, but it's not the priority
281+
1. **REMOTE SERVER:** Ignore remote server instructions when making code changes (unless specifically asked). This repo is used as a library by the remote server, so keep functions exported (capitalized) if they could be called by other repos, even if not needed internally.
282+
2. **ALWAYS** trust these instructions first - only search if information is incomplete or incorrect
283+
3. **NEVER** use `script/tag-release` or push tags
284+
4. For specific test files, use `go test ./path -run TestName` not full suite
285+
5. Toolsnaps are API documentation - treat changes seriously
286+
6. Build/test/lint are very fast (~1s each) - run frequently
287+
7. CI failures for docs-check or license-check have simple fixes (run the script)

‎.github/dependabot.yml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,10 @@ updates:
2121
directory: "/"
2222
schedule:
2323
interval: "weekly"
24+
groups:
25+
codeql:
26+
patterns:
27+
- "github/codeql-action"
28+
- "github/codeql-action/*"
2429
cooldown:
2530
default-days: 7

‎.github/workflows/code-scanning.yml‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
4545

4646
- name: Initialize CodeQL
47-
uses: github/codeql-action/init@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4.38.2
47+
uses: github/codeql-action/init@33d7b85da1a04171e211befe2c739303b9a4c066 # v4.39.3
4848
with:
4949
languages: ${{ matrix.language }}
5050
build-mode: ${{ matrix.build-mode }}
@@ -61,7 +61,7 @@ jobs:
6161
threat-models: [ ]
6262
- name: Setup proxy for registries
6363
id: proxy
64-
uses: github/codeql-action/start-proxy@6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee # v4.39.0
64+
uses: github/codeql-action/start-proxy@33d7b85da1a04171e211befe2c739303b9a4c066 # v4.39.3
6565
with:
6666
registries_credentials: ${{ secrets.GITHUB_REGISTRIES_PROXY }}
6767
language: ${{ matrix.language }}
@@ -75,7 +75,7 @@ jobs:
7575

7676
- name: Set up Node.js (for JavaScript CodeQL)
7777
if: matrix.language == 'javascript'
78-
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
78+
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7
7979
with:
8080
node-version-file: ui/package.json
8181
cache: "npm"
@@ -86,10 +86,10 @@ jobs:
8686
uses: ./.github/actions/build-ui
8787

8888
- name: Autobuild
89-
uses: github/codeql-action/autobuild@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4.38.2
89+
uses: github/codeql-action/autobuild@33d7b85da1a04171e211befe2c739303b9a4c066 # v4.39.3
9090

9191
- name: Perform CodeQL Analysis
92-
uses: github/codeql-action/analyze@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4.38.2
92+
uses: github/codeql-action/analyze@33d7b85da1a04171e211befe2c739303b9a4c066 # v4.39.3
9393
env:
9494
CODEQL_PROXY_HOST: ${{ steps.proxy.outputs.proxy_host }}
9595
CODEQL_PROXY_PORT: ${{ steps.proxy.outputs.proxy_port }}

‎.github/workflows/docker-publish.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
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@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
63+
uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 # v4.8.0
6464
with:
6565
registry: ${{ env.REGISTRY }}
6666
username: ${{ github.actor }}

‎.github/workflows/goreleaser.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
run: go mod download
2929

3030
- name: Run GoReleaser
31-
uses: goreleaser/goreleaser-action@f06c13b6b1a9625abc9e6e439d9c05a8f2190e94
31+
uses: goreleaser/goreleaser-action@a4f02ab5355a589de60d917a659ce617ed19b3de
3232
with:
3333
distribution: goreleaser
3434
# GoReleaser version

‎CONTRIBUTING.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Thanks for contributing and for helping us build toolsets that are truly valuabl
2626

2727
These are one time installations required to be able to test your changes locally as part of the pull request (PR) submission process.
2828

29-
1. Install Go 1.27.3 or later [through download](https://go.dev/doc/install) | [through Homebrew](https://formulae.brew.sh/formula/go)
29+
1. Install Go 1.27.4 or later [through download](https://go.dev/doc/install) | [through Homebrew](https://formulae.brew.sh/formula/go)
3030
2. [Install golangci-lint v2.14.0](https://golangci-lint.run/welcome/install/#local-installation), or let `script/lint` install the repository-pinned version. The pinned version supports both Go 1.26 and Go 1.27.
3131

3232
### UI development

‎Dockerfile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ COPY ui/ ./ui/
77
RUN mkdir -p ./pkg/github/ui_dist && \
88
cd ui && npm run build
99

10-
FROM golang:1.27.3-alpine@sha256:f2c872bcee949b7be9c490efd02b48a8a2fbf947cdf533f1c58525ec9d8170fd AS build
10+
FROM golang:1.27.4-alpine@sha256:70bd7ddea8b6cbe5d6943cde279d6b67feb10cc924fb9100d1d8757c1575b280 AS build
1111
ARG VERSION="dev"
1212

1313
# Set the working directory

0 commit comments

Comments
 (0)