Conversation
Preserve release identities, resolve actual source revisions, and attach upstream client metadata per request without mutating shared transports. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6dde41da-ec25-4370-b26c-b036d0a53b3c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Give STDIO GitHub API requests a server/version user agent before any MCP handshake, and preserve upstream client metadata per request across both legacy and modern MCP protocols. Source builds identify their actual source revision rather than reporting
versionordev.Why
The GraphQL transport starts without a server user agent and currently relies on middleware for the literal
initializemethod. The pinned MCP SDK's default client instead negotiates2026-07-28throughserver/discover, and the protocol also permits a direct metadata-bearingtools/call. In addition, the existing concrete*mcp.InitializeRequestassertion does not match incoming server requests in this SDK: that name aliases a client request.Before the fix, six local wire-level regressions reached the production
list_issueshandler and observedGo-http-client/1.1, including the legacy-initialisation control. The fix does not depend on a particular handshake or mutate a shared HTTP transport when client metadata changes.What changed
ClientInfoaccessor and a request-scoped transport context. Keep the existing server product, optional parenthesised upstream identity and insiders marker. Existing transport defaults, including remote-server markers, remain unchanged when no override is supplied.vcs-<full-sha>with a dirty suffix when appropriate. Missing or malformed metadata produces an explicit startup error.MCP impact
Prompts tested (tool changes only)
Not applicable: no tool definition or schema changed. Automated protocol tests invoke the actual
list_issueshandler through newline-delimited MCP transports and record its HTTP request at a local test server. They cover SDK discovery, direct modern calls, missing optional client information, legacy initialisation, insiders and changed server/client versions.Security / limits
Tool renaming
deprecated_tool_aliases.goNote: 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.
Lint & tests
./script/lint— run in a Codespace withGOTOOLCHAIN=go1.25.12, matching the checked-in lint workflow's Go 1.25 configuration../script/test— the completego test -race ./...suite passed in the Codespace.The initial lint attempt used the image's Go 1.27.1 and failed because the pinned golangci-lint v2.9.0 could not decode that toolchain's standard-library export data. The CI-compatible toolchain passed with zero issues. No linter, dependency or CI configuration was changed. The formatter's unrelated pre-existing indentation change in
pkg/http/oauth/oauth_test.gowas removed, and the standalone analyser passed again.The actual compiled STDIO executable was also exercised against a local HTTP fixture with a direct modern
tools/call. The source build emitted its full embedded source revision with-dirty; a separately compiled release-labelled fixture retained exactlygithub-mcp-server/v1.2.3 (binary-probe/1.0.0). This exposed and corrected precedence for newer Go toolchains that infer a main-module pseudo-version even in a source checkout.After committing, the clean source binary was rebuilt and the same actual HTTP probe emitted
github-mcp-server/vcs-e99ab3cda12c0259aa4319fb9188a64016d5f3eb (binary-probe/1.0.0), matching the published source rather than the previous build.go test -race -count=1 ./internal/ghmcp ./pkg/http/transport ./cmd/github-mcp-server GOTOOLCHAIN=go1.25.12 script/lint script/test go build -o /tmp/github-mcp-server ./cmd/github-mcp-server GOTOOLCHAIN=go1.25.12 bin/golangci-lint run git diff --checkThe tagged live-service E2E suite, full container build and production rollout were not run. This remains an unsigned draft for review.
Docs