{"record":{"id":"2f736412a2116a68","repo":"github/github-mcp-server","slug":"failed-to-create-rest-client-w","errorCode":null,"errorMessage":"failed to create REST client: %w","messagePattern":"failed to create REST client: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/ghmcp/server.go","lineNumber":90,"sourceCode":"\t}\n\tvar restClient *gogithub.Client\n\tif cfg.TokenProvider != nil {\n\t\trestClient, err = gogithub.NewClient(\n\t\t\tgogithub.WithHTTPClient(&http.Client{Transport: &transport.BearerAuthTransport{\n\t\t\t\tTransport:     restUATransport,\n\t\t\t\tTokenProvider: cfg.TokenProvider,\n\t\t\t}}),\n\t\t\tgogithub.WithEnterpriseURLs(restURL.String(), uploadURL.String()),\n\t\t)\n\t} else {\n\t\trestClient, err = gogithub.NewClient(\n\t\t\tgogithub.WithHTTPClient(&http.Client{Transport: restUATransport}),\n\t\t\tgogithub.WithAuthToken(cfg.Token),\n\t\t\tgogithub.WithEnterpriseURLs(restURL.String(), uploadURL.String()),\n\t\t)\n\t}\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create REST client: %w\", err)\n\t}\n\n\t// Construct GraphQL client\n\t// We use NewEnterpriseClient unconditionally since we already parsed the API host\n\tgqlHTTPClient := &http.Client{\n\t\tTransport: &transport.BearerAuthTransport{\n\t\t\tTransport: &transport.GraphQLFeaturesTransport{\n\t\t\t\tTransport: http.DefaultTransport,\n\t\t\t},\n\t\t\tToken:         cfg.Token,\n\t\t\tTokenProvider: cfg.TokenProvider,\n\t\t},\n\t}\n\n\tgqlClient := githubv4.NewEnterpriseClient(graphQLURL.String(), gqlHTTPClient)\n\n\t// Create raw content client (shares REST client's HTTP transport)\n\trawClient, err := raw.NewClient(restClient, rawURL)","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/github/github-mcp-server/blob/0ea1f775a7c73eff1bd2e25904d01136756bbfe2/internal/ghmcp/server.go#L72-L108","documentation":"Error \"failed to create REST client: %w\" thrown in github/github-mcp-server.","triggerScenarios":"Thrown at internal/ghmcp/server.go:90 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0ea1f775a7c73eff1bd2e25904d01136756bbfe2","analyzedAt":"2026-08-15T18:10:19.804Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}