fix: emit GITHUB_HOST in MCP server env for GHES targets via tools.github.host#20940
Closed
fix: emit GITHUB_HOST in MCP server env for GHES targets via tools.github.host#20940
Conversation
…thub.host Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
pelikhan
March 14, 2026 14:15
View session
Contributor
|
@copilot the compiler should add a step to try to info the GH_HOST at runtime if the host field is not configured. |
…t configured Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
Author
Done in 14c68ed. When |
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.
Compiled lock files never included
GITHUB_HOSTin the MCP server container env, causing all GitHub API calls to targetapi.github.comon GHES deployments (resulting in 401/404). Users had to manually inject the env var after every recompile.Changes
tools.github.hostfrontmatter field — accepts a bare hostname or fullhttps://URL; silently ignored when set togithub.comorapi.github.comnormalizeGitHubHost()— canonicalizes the value: strips trailing slashes, prependshttps://if scheme is absent, returns""for default GitHub targetsRenderGitHubMCPDockerConfig) — emits"GITHUB_HOST": "<url>"into the container env block when host is non-emptyrenderGitHubTOML, Codex engine) — same treatmentGitHubMCPDockerOptions.Host— plumbed through fromRenderGitHubMCP→ options struct → rendererUsage
Produces in the lock file: