{"record":{"id":"e38b7d21b22977f4","repo":"github/github-mcp-server","slug":"failed-to-unmarshal-oauth-scopes-w","errorCode":null,"errorMessage":"failed to unmarshal oauth-scopes: %w","messagePattern":"failed to unmarshal oauth-scopes: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/github-mcp-server/main.go","lineNumber":138,"sourceCode":"\t\t\t\tExportTranslations:   viper.GetBool(\"export-translations\"),\n\t\t\t\tEnableCommandLogging: viper.GetBool(\"enable-command-logging\"),\n\t\t\t\tLogFilePath:          viper.GetString(\"log-file\"),\n\t\t\t\tContentWindowSize:    viper.GetInt(\"content-window-size\"),\n\t\t\t\tLockdownMode:         viper.GetBool(\"lockdown-mode\"),\n\t\t\t\tInsidersMode:         viper.GetBool(\"insiders\"),\n\t\t\t\tExcludeTools:         excludeTools,\n\t\t\t\tRepoAccessCacheTTL:   &ttl,\n\t\t\t}\n\n\t\t\t// When no static token is provided, log in via OAuth using the given\n\t\t\t// client. The requested scopes default to the full supported set\n\t\t\t// (which filters out no tools); an explicit, narrower --oauth-scopes\n\t\t\t// both narrows the grant and hides tools needing other scopes.\n\t\t\tif token == \"\" && !appAuthRequested {\n\t\t\t\tscopes := ghoauth.SupportedScopes\n\t\t\t\tif viper.IsSet(\"oauth-scopes\") {\n\t\t\t\t\tif err := viper.UnmarshalKey(\"oauth-scopes\", &scopes); err != nil {\n\t\t\t\t\t\treturn fmt.Errorf(\"failed to unmarshal oauth-scopes: %w\", err)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\toauthConfig := oauth.NewGitHubConfig(\n\t\t\t\t\toauthClientID,\n\t\t\t\t\toauthClientSecret,\n\t\t\t\t\tscopes,\n\t\t\t\t\tviper.GetString(\"host\"),\n\t\t\t\t\tviper.GetInt(\"oauth-callback-port\"),\n\t\t\t\t)\n\t\t\t\tstdioServerConfig.OAuthManager = oauth.NewManager(oauthConfig, nil)\n\t\t\t\tstdioServerConfig.OAuthScopes = scopes\n\t\t\t}\n\n\t\t\tif appAuthRequested {\n\t\t\t\ttokenProvider, err := newGitHubAppTokenProvider(appID, appInstallationID, appPrivateKeyPath, appPrivateKeyInline, viper.GetString(\"host\"))\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/github/github-mcp-server/blob/0ea1f775a7c73eff1bd2e25904d01136756bbfe2/cmd/github-mcp-server/main.go#L120-L156","documentation":"Error \"failed to unmarshal oauth-scopes: %w\" thrown in github/github-mcp-server.","triggerScenarios":"Thrown at cmd/github-mcp-server/main.go:138 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-16T03:17:38.424Z"}