Uh oh!
There was an error while loading. Please reload this page.
feat: enterprise host support - #28
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds rudimentary enterprise support by introducing a new "gh-host" parameter, allowing the GitHub MCP server to direct API calls to GitHub Enterprise endpoints.
- Added the "gh-host" persistent flag.
- Bound "gh-host" to viper.
- Updated the GitHub client to use enterprise-specific base and upload URLs when provided.
Tip: Copilot code review supports C#, Go, Java, JavaScript, Markdown, Python, Ruby and TypeScript, with more languages coming soon. Learn more
Uh oh!
There was an error while loading. Please reload this page.
toby
commented
Mar 20, 2025
Awesome! Do think it would make sense to support an env var (in addition to or instead of the flag)? Just because we're using them elsewhere. |
| if host := viper.GetString("gh-host"); host != "" { | ||
| parsedURL, err := url.Parse(fmt.Sprintf("https://api.%s/", host)) | ||
| if err != nil { | ||
| return fmt.Errorf("failed to parse provided GitHub host URL: %w", err) | ||
| } | ||
| uploadURL, err := url.Parse(fmt.Sprintf("https://uploads.%s/", host)) | ||
| if err != nil { | ||
| return fmt.Errorf("failed to parse provided GitHub host URL: %w", err) | ||
| } | ||
| ghClient.BaseURL = parsedURL | ||
| ghClient.UploadURL = uploadURL | ||
| } |
There was a problem hiding this comment.
Maybe we can use the WithEnterpriseURLs() function in the gogithub.Client instead?
SamMorrowDrums
commented
Mar 20, 2025
Yeah, that's easy. I was considering doing so too. Just didn't 😅 |
Uh oh!
There was an error while loading. Please reload this page.
* fix: remove github auth token requirement
…ons/goreleaser/goreleaser-action-7.0.0 build(deps): bump goreleaser/goreleaser-action from 6.4.0 to 7.0.0
Adds support for a
gh-hostparam so that enterprises work. Tested it out with failing attempt to call localhost:go run cmd/github-mcp-server/main.go stdio --gh-host github.localhostSo the override is working well.