Conversation
…ss all engines Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…nted Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update compiler so that the github host is passed along in the github MCP configuration.
Use the github action host environment variable.
---
GitHub Enterprise Server and Enterprise Cloud with data residency (ghe.com)
The flag --gh-host and the en...
Add GITHUB_HOST environment variable support for GitHub Enterprise Server and GitHub Enterprise Cloud
Sep 16, 2025
pelikhan
approved these changes
Sep 16, 2025
|
Why was this closed without merging? I'm running into this problem. |
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.
This PR adds support for GitHub Enterprise Server (GHES) and GitHub Enterprise Cloud with data residency by passing the
GITHUB_HOSTenvironment variable to the GitHub MCP server Docker container.Problem
The GitHub MCP server configuration was missing the
GITHUB_HOSTenvironment variable, which is required for connecting to GitHub Enterprise Server or GitHub Enterprise Cloud with data residency (ghe.com). Without this variable, the MCP server defaults to connecting to github.com, preventing workflows from working with enterprise GitHub instances.Solution
Updated all three AI engines (Claude, Custom, and Codex) to include the
GITHUB_HOSTenvironment variable in their GitHub MCP server configurations:-e GITHUB_HOSTto pass the environment variable to the containerGITHUB_HOSTto${{ env.GITHUB_SERVER_URL }}(GitHub Actions' built-in environment variable)Example Configuration
The generated GitHub MCP configuration now includes:
{ "mcpServers": { "github": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN", "-e", "GITHUB_HOST", "ghcr.io/github/github-mcp-server:sha-09deac4" ], "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "${{ secrets.GITHUB_TOKEN }}", "GITHUB_HOST": "${{ env.GITHUB_SERVER_URL }}" } } } }This enables the GitHub MCP server to automatically connect to the correct GitHub instance based on where the workflow is running:
GITHUB_SERVER_URL=https://github.comGITHUB_SERVER_URL=https://your-ghes-instance.comGITHUB_SERVER_URL=https://yoursubdomain.ghe.comTesting
GITHUB_HOSTis included in generated configurationsFiles Changed
pkg/workflow/claude_engine.go: UpdatedrenderGitHubClaudeMCPConfigpkg/workflow/custom_engine.go: UpdatedrenderGitHubMCPConfigpkg/workflow/codex_engine.go: UpdatedrenderGitHubCodexMCPConfigpkg/workflow/codex_engine_test.go: Updated test expectationspkg/workflow/mcp_config_test.go: Added validation test for GITHUB_HOSTWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
api.contoso.com/tmp/go-build527290485/b279/cli.test -test.testlogfile=/tmp/go-build527290485/b279/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true(dns block)/tmp/go-build1584658749/b279/cli.test -test.testlogfile=/tmp/go-build1584658749/b279/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true(dns block)/tmp/go-build4114491301/b279/cli.test -test.testlogfile=/tmp/go-build4114491301/b279/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.