- Notifications
You must be signed in to change notification settings - Fork899
set user agent for client requests#61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Pull Request Overview
This PR sets a custom User-Agent for GitHub client requests in the github-mcp-server application.
- Adds a hard-coded User-Agent ("github-mcp-server/1.0") to override the default from the go-github library.
- Prepares groundwork for potential future refactoring to dynamically set the version.
Comments suppressed due to low confidence (1)
cmd/github-mcp-server/main.go:104
- [nitpick] Consider defining a constant for the User-Agent string to centralize the version value and simplify future updates.
ghClient.UserAgent = "github-mcp-server/1.0"
Tip: Copilot only keeps its highest confidence comments to reduce noise and keep you focused.Learn more
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Thank you so much! I'll revisit the version once the SEMVER stuff is sorted.
84ec566
intomainUh oh!
There was an error while loading.Please reload this page.
Set a User-Agent "github-mcp-server/1.0" for Client requests.
This overrideshttps://github.com/google/go-github/blob/0710d0b66118875dd853e35fdbeadf32f0264376/github/github.go#L36 and is set inhttps://github.com/google/go-github/blob/0710d0b66118875dd853e35fdbeadf32f0264376/github/github.go#L423
I wish there was a way to dynamically set the version, but I don't know of a sane way to pull the GitHub release version so starting with 1.0
With this being built directly in the command I don't have a good way to write a test in code, a future refactor could help with that.