Describe the bug
Currently, any hostname ending with "github.com" (such as "slack-github.mirrors.m2d.in") 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.mirrors.m2d.in
2.Run any tool. Eg. list_pull_requests
Expected vs actual behavior
Expected: MCP tool should use abcd-github.mirrors.m2d.in/api/v3 rest api url.
Actual: MCP tool uses github.com/api/v3 rest api url.
Describe the bug
Currently, any hostname ending with "github.com" (such as "slack-github.mirrors.m2d.in") is incorrectly identified as the public GitHub host github.com. This is because in
parsAPiHost(), host's suffix is matched withgithub.mirrors.m2d.in. As a result, all hosts that end withgithub.mirrors.m2d.inare characterized as public github.com hosts instead of GHES.Steps to reproduce the behavior
abcd-github.mirrors.m2d.in2.Run any tool. Eg.
list_pull_requestsExpected vs actual behavior
Expected: MCP tool should use
abcd-github.mirrors.m2d.in/api/v3rest api url.Actual: MCP tool uses
github.com/api/v3rest api url.