You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, any hostname ending with "github.com" (such as "slack-github.com") is incorrectly identified as the public GitHub host github.com. This is because in parsAPiHost(), host's suffix is matched with github.com . As a result, all hosts that end with github.com are characterized as public github.com hosts instead of GHES.
Steps to reproduce the behavior
In the mcp tool's config, set GITHUB_HOST to custom GHES host. Eg abcd-github.com
2.Run any tool. Eg. list_pull_requests
Expected vs actual behavior
Expected: MCP tool should use abcd-github.com/api/v3 rest api url.
Actual: MCP tool uses github.com/api/v3 rest api url.
I ran into this with connecting to another github enterprise instance with the name https://github.aq.tc. I tried configuring the hosted instance by setting the GITHUB_HOST environment variable when configuring the docker instance for use with claude code.
@aozgaa and @HK78-HAHA Sees like it's pretty easy to run into this issue if you're using enterprise github. Did the referenced PR/fix work for your use case?
I totally jumped the gun -- the problem was that I wasn't including the env var GITHUB_HOST in the docker run command. After including it with a config like the following, everything works as expected:
Still have the same issue... The dangerous with the docker images without tagging is that any new version may remove a previous supported feature without a proper tagging/versioning... Everyone claims it's working, when it's really apparent it's not... Where's the current problem?
👋 We're actively looking at improving GHES support for the MCP server! If you have thoughts on GHES-specific needs, please share your feedback in this discussion. 🙏
Unfortunately, this is till not closed. My organization has a github url like https://{org_name}-github.com. I can see the docker container is intialized with the right env variables for github_host, token etc. But, the api rest url is being resolved as https://api.github.com instead of https://api.{org_name}-github.com. Upon checking the code, it's pretty obvious why that is happening. It's this line, where we check if host suffix is github.com and then use the default api url instead of using the one that is passed as env variable. I request this issue be re-opened. I am happy to raise a PR for it.
Activity
4dollar4 commentedon Jul 25, 2025
I had experienced the same issue.
aozgaa commentedon Aug 4, 2025
I ran into this with connecting to another github enterprise instance with the name
https://github.aq.tc. I tried configuring the hosted instance by setting theGITHUB_HOSTenvironment variable when configuring the docker instance for use with claude code.jtquip88 commentedon Aug 4, 2025
@aozgaa and @HK78-HAHA Sees like it's pretty easy to run into this issue if you're using enterprise github. Did the referenced PR/fix work for your use case?
aozgaa commentedon Aug 4, 2025
I totally jumped the gun -- the problem was that I wasn't including the env var
GITHUB_HOSTin the docker run command. After including it with a config like the following, everything works as expected:This shouldn't bear on the originally reported issue, which seems to trigger a specific codepath that my case shouldn't. Apologies for the confusion.
marcellodesales commentedon Sep 2, 2025
Still have the same issue... The dangerous with the docker images without tagging is that any new version may remove a previous supported feature without a proper tagging/versioning... Everyone claims it's working, when it's really apparent it's not... Where's the current problem?
🔧 Settings with GITHUB_HOST != github.com
{ "github-viasat": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN", "-e", "GITHUB_HOST", "ghcr.io/github/github-mcp-server" ], "env": { "GITHUB_HOST": "https://github.company.com", "GITHUB_PERSONAL_ACCESS_TOKEN": "gh****PV" }, "working_directory": null } }🔴 Incorrect MCP API call going to github.com
marcellodesales commentedon Sep 11, 2025
Solution
⌨️ MCP Client Terminal
"latest", but in Docker image terms, the docker engine will NOT pull the latest version🔧 Suggested Config
https://github.com/github/github-mcp-server/pkgs/container/github-mcp-server/versions?filters%5Bversion_type%5D=tagged
Tip
sha-0c5cfc3to lock in the version I want to uselatesttag, make sure to constantly performdocker pull{ "github-company": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "GITHUB_HOST", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN", "ghcr.io/github/github-mcp-server:sha-0c5cfc3" ], "env": { "GITHUB_HOST": "https://github.company.com", "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_E****47" }, "working_directory": null } }✅ Testing
tonytrg commentedon Sep 12, 2025
Closing this one since it seems resolved.
SamMorrowDrums commentedon Nov 25, 2025
👋 We're actively looking at improving GHES support for the MCP server! If you have thoughts on GHES-specific needs, please share your feedback in this discussion. 🙏
jtquip88 commentedon Feb 3, 2026
Unfortunately, this is till not closed. My organization has a github url like https://{org_name}-github.com. I can see the docker container is intialized with the right env variables for github_host, token etc. But, the api rest url is being resolved as https://api.github.com instead of https://api.{org_name}-github.com. Upon checking the code, it's pretty obvious why that is happening. It's this line, where we check if host suffix is github.com and then use the default api url instead of using the one that is passed as env variable. I request this issue be re-opened. I am happy to raise a PR for it.