github/github-mcp-server · error

failed to get base REST URL: %w

Error message

failed to get base REST URL: %w

What it means

Error "failed to get base REST URL: %w" thrown in github/github-mcp-server.

Source

Thrown at internal/ghmcp/server.go:47

	"github.com/modelcontextprotocol/go-sdk/mcp"
	"github.com/shurcooL/githubv4"
)

// githubClients holds all the GitHub API clients created for a server instance.
type githubClients struct {
	rest         *gogithub.Client
	restUATransp *transport.UserAgentTransport
	gql          *githubv4.Client
	gqlHTTP      *http.Client // retained for middleware to modify transport
	raw          *raw.Client
	repoAccess   *lockdown.RepoAccessCache
}

// createGitHubClients creates all the GitHub API clients needed by the server.
func createGitHubClients(cfg github.MCPServerConfig, apiHost utils.APIHostResolver) (*githubClients, error) {
	restURL, err := apiHost.BaseRESTURL(context.Background())
	if err != nil {
		return nil, fmt.Errorf("failed to get base REST URL: %w", err)
	}

	uploadURL, err := apiHost.UploadURL(context.Background())
	if err != nil {
		return nil, fmt.Errorf("failed to get upload URL: %w", err)
	}

	graphQLURL, err := apiHost.GraphqlURL(context.Background())
	if err != nil {
		return nil, fmt.Errorf("failed to get GraphQL URL: %w", err)
	}

	rawURL, err := apiHost.RawURL(context.Background())
	if err != nil {
		return nil, fmt.Errorf("failed to get Raw URL: %w", err)
	}

	// Construct REST client. When a TokenProvider is configured, we

View on GitHub (pinned to 0ea1f775a7)

When it happens

Trigger: Thrown at internal/ghmcp/server.go:47 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of github/github-mcp-server@0ea1f775a7 (2026-08-15). Data as JSON: /api/errors/4bb892bcabe752b2. Report an issue: GitHub.