{"record":{"id":"1b401a77a7873a6e","repo":"github/github-mcp-server","slug":"failed-to-get-github-client-w-1b401a","errorCode":null,"errorMessage":"failed to get GitHub client: %w","messagePattern":"failed to get GitHub client: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/github/ui_tools.go","lineNumber":114,"sourceCode":"\t\t\tcase \"reviewers\":\n\t\t\t\treturn uiGetReviewers(ctx, deps, args, owner)\n\t\t\tdefault:\n\t\t\t\treturn utils.NewToolResultError(fmt.Sprintf(\"unknown method: %s\", method)), nil, nil\n\t\t\t}\n\t\t})\n\tst.FeatureFlagEnable = MCPAppsFeatureFlag\n\treturn st\n}\n\nfunc uiGetLabels(ctx context.Context, deps ToolDependencies, args map[string]any, owner string) (*mcp.CallToolResult, any, error) {\n\trepo, err := RequiredParam[string](args, \"repo\")\n\tif err != nil {\n\t\treturn utils.NewToolResultError(err.Error()), nil, nil\n\t}\n\n\tclient, err := deps.GetGQLClient(ctx)\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"failed to get GitHub client: %w\", err)\n\t}\n\n\tvar query struct {\n\t\tRepository struct {\n\t\t\tLabels struct {\n\t\t\t\tNodes []struct {\n\t\t\t\t\tID          githubv4.ID\n\t\t\t\t\tName        githubv4.String\n\t\t\t\t\tColor       githubv4.String\n\t\t\t\t\tDescription githubv4.String\n\t\t\t\t}\n\t\t\t\tTotalCount githubv4.Int\n\t\t\t\tPageInfo   struct {\n\t\t\t\t\tHasNextPage githubv4.Boolean\n\t\t\t\t\tEndCursor   githubv4.String\n\t\t\t\t}\n\t\t\t} `graphql:\"labels(first: 100, after: $cursor)\"`\n\t\t} `graphql:\"repository(owner: $owner, name: $repo)\"`","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/github/github-mcp-server/blob/0ea1f775a7c73eff1bd2e25904d01136756bbfe2/pkg/github/ui_tools.go#L96-L132","documentation":"uiGetLabels failed in deps.GetGQLClient(ctx): the GraphQL client (githubv4) could not be constructed from the configured auth/transport before any query ran. Same failure family as the REST GetClient error, but for the GraphQL endpoint.","triggerScenarios":"No or invalid token; OAuth token exchange failure; GHES host where the GraphQL endpoint (/api/graphql) is disabled or unreachable; host URL configuration resolving to an invalid GraphQL URL.","commonSituations":"Remote server deployments missing token env vars; GHES instances without GraphQL enabled; proxies blocking the graphql path.","solutions":["Verify token configuration for the configured host","Check the GraphQL endpoint availability (curl https://<host>/api/graphql)","Inspect server logs for auth/transport initialization errors"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"token := os.Getenv(\"GITHUB_MCP_BACKEND_GITHUB_TOKEN\")\nif token == \"\" {\n\tlog.Fatal(\"GraphQL tools need a configured token\")\n}\nif resp, err := http.Head(graphqlURL()); err != nil || resp.StatusCode >= 500 {\n\tlog.Fatal(\"GraphQL endpoint unavailable\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify the GraphQL endpoint is enabled and reachable on GHES hosts (/api/graphql)","Construct the GraphQL client once at startup and fail fast","Keep REST and GraphQL credential configuration in sync"],"tags":["authentication","graphql","configuration"],"backgroundTag":null,"analyzedSha":"0ea1f775a7c73eff1bd2e25904d01136756bbfe2","analyzedAt":"2026-08-15T18:10:19.804Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}