github/github-mcp-server · error

failed to resolve REST URL for GitHub App authentication: %w

Error message

failed to resolve REST URL for GitHub App authentication: %w

What it means

Error "failed to resolve REST URL for GitHub App authentication: %w" thrown in github/github-mcp-server.

Source

Thrown at cmd/github-mcp-server/main.go:327

	if err := rootCmd.Execute(); err != nil {
		fmt.Fprintf(os.Stderr, "%v\n", err)
		os.Exit(1)
	}
}

func newGitHubAppTokenProvider(appID, installationID, keyPath, keyInline, host string) (func() string, error) {
	keyBytes, err := loadAppPrivateKey(keyPath, keyInline)
	if err != nil {
		return nil, err
	}

	apiHost, err := utils.NewAPIHost(host)
	if err != nil {
		return nil, fmt.Errorf("failed to parse host for GitHub App authentication: %w", err)
	}
	restURL, err := apiHost.BaseRESTURL(context.Background())
	if err != nil {
		return nil, fmt.Errorf("failed to resolve REST URL for GitHub App authentication: %w", err)
	}

	provider, err := githubapp.NewProvider(githubapp.Config{
		AppID:          appID,
		InstallationID: installationID,
		PrivateKeyPEM:  keyBytes,
		BaseRESTURL:    restURL.String(),
	}, nil)
	if err != nil {
		return nil, fmt.Errorf("failed to configure GitHub App authentication: %w", err)
	}
	return provider.AccessToken, nil
}

func loadAppPrivateKey(path, inline string) ([]byte, error) {
	switch {
	case path != "":
		data, err := os.ReadFile(path) //#nosec G304 -- operator-supplied path to their own key

View on GitHub (pinned to 0ea1f775a7)

When it happens

Trigger: Thrown at cmd/github-mcp-server/main.go:327 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


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