Skip to content

fix: report the release version to MCP clients - #185

Merged
danbarr merged 1 commit into
mainfrom
fix/report-release-version
Nov 19, 2026
Merged

danbarr merged 1 commit into
mainfrom
fix/report-release-version

Conversation

@danbarr

@danbarr danbarr commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

.ko.yaml sets -X main.version from the release tag, but main had no version variable, so the flag did nothing and every release reported the hardcoded version 1.0.0 in serverInfo.

  • Declare main.version and pass it to the server through config.Config.Version.
  • When no ldflag is set, fall back to the module version from build info (for go install ...@vX.Y.Z), then to dev.
  • Replace the exported config.ServerVersion constant with config.DefaultVersion.

Testing: unit tests for version resolution and the version an in-memory client sees on connect. I also built with -X main.version=4.5.6 and confirmed initialize returns it.

🤖 Generated with Claude Code

.ko.yaml sets -X main.version from the release tag, but main had no
version variable, so the flag silently did nothing and every release
reported the hardcoded version 1.0.0 in serverInfo.

Declare main.version and pass it to the server through Config.Version,
falling back to the module version from build info for `go install`
builds, then to "dev". Replace the ServerVersion constant with
DefaultVersion.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@danbarr
danbarr enabled auto-merge (squash) November 19, 2026 22:15
@danbarr
danbarr merged commit 0ae8a9d into main Nov 19, 2026
2 checks passed
@danbarr
danbarr deleted the fix/report-release-version branch November 19, 2026 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants