{"record":{"id":"9f96eea2603c77db","repo":"github/github-mcp-server","slug":"choose-exactly-one-authentication-mode-a-static-t","errorCode":null,"errorMessage":"choose exactly one authentication mode: a static Token, OAuthManager, or TokenProvider","messagePattern":"choose exactly one authentication mode: a static Token, OAuthManager, or TokenProvider","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/ghmcp/server.go","lineNumber":279,"sourceCode":"\t// the scope set for tool filtering: tools requiring a scope outside this set\n\t// are hidden. The default set is the full supported list, which hides\n\t// nothing; an explicit, narrower list filters accordingly.\n\tOAuthScopes []string\n\n\t// TokenProvider supplies a token for each GitHub API request.\n\tTokenProvider func() string\n}\n\n// RunStdioServer is not concurrent safe.\nfunc RunStdioServer(cfg StdioServerConfig) error {\n\tauthModes := 0\n\tfor _, on := range []bool{cfg.Token != \"\", cfg.OAuthManager != nil, cfg.TokenProvider != nil} {\n\t\tif on {\n\t\t\tauthModes++\n\t\t}\n\t}\n\tif authModes > 1 {\n\t\treturn fmt.Errorf(\"choose exactly one authentication mode: a static Token, OAuthManager, or TokenProvider\")\n\t}\n\n\t// Create app context\n\tctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)\n\tdefer stop()\n\n\tt, dumpTranslations := translations.TranslationHelper()\n\n\tvar slogHandler slog.Handler\n\tvar logOutput io.Writer\n\tif cfg.LogFilePath != \"\" {\n\t\tfile, err := os.OpenFile(cfg.LogFilePath, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0600)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to open log file: %w\", err)\n\t\t}\n\t\tlogOutput = file\n\t\tslogHandler = slog.NewTextHandler(logOutput, &slog.HandlerOptions{Level: slog.LevelDebug})\n\t} else {","sourceCodeStart":261,"sourceCodeEnd":297,"githubUrl":"https://github.com/github/github-mcp-server/blob/0ea1f775a7c73eff1bd2e25904d01136756bbfe2/internal/ghmcp/server.go#L261-L297","documentation":"Error \"choose exactly one authentication mode: a static Token, OAuthManager, or TokenProvider\" thrown in github/github-mcp-server.","triggerScenarios":"Thrown at internal/ghmcp/server.go:279 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"}