{"record":{"id":"cf663c6613aeb43c","repo":"github/github-mcp-server","slug":"failed-to-resolve-authorization-server-url-v","errorCode":null,"errorMessage":"failed to resolve authorization server URL: %v","messagePattern":"failed to resolve authorization server URL: (.+?)","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"pkg/http/oauth/oauth.go","lineNumber":129,"sourceCode":"\t}\n}\n\nfunc (h *AuthHandler) metadataHandler() http.Handler {\n\treturn http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tctx := r.Context()\n\t\tresourcePath := resolveResourcePath(\n\t\t\tstrings.TrimPrefix(r.URL.Path, OAuthProtectedResourcePrefix),\n\t\t\th.cfg.ResourcePath,\n\t\t)\n\t\tresourceURL := h.buildResourceURL(r, resourcePath)\n\n\t\tvar authorizationServerURL string\n\t\tif h.cfg.AuthorizationServer != \"\" {\n\t\t\tauthorizationServerURL = h.cfg.AuthorizationServer\n\t\t} else {\n\t\t\tauthURL, err := h.apiHost.AuthorizationServerURL(ctx)\n\t\t\tif err != nil {\n\t\t\t\thttp.Error(w, fmt.Sprintf(\"failed to resolve authorization server URL: %v\", err), http.StatusInternalServerError)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tauthorizationServerURL = authURL.String()\n\t\t}\n\n\t\tmetadata := &oauthex.ProtectedResourceMetadata{\n\t\t\tResource:               resourceURL,\n\t\t\tAuthorizationServers:   []string{authorizationServerURL},\n\t\t\tResourceName:           \"GitHub MCP Server\",\n\t\t\tScopesSupported:        SupportedScopes,\n\t\t\tBearerMethodsSupported: []string{\"header\"},\n\t\t}\n\n\t\tauth.ProtectedResourceMetadataHandler(metadata).ServeHTTP(w, r)\n\t})\n}\n\n// routesForPattern generates route variants for a given pattern.","sourceCodeStart":111,"sourceCodeEnd":147,"githubUrl":"https://github.com/github/github-mcp-server/blob/0ea1f775a7c73eff1bd2e25904d01136756bbfe2/pkg/http/oauth/oauth.go#L111-L147","documentation":"Error \"failed to resolve authorization server URL: %v\" thrown in github/github-mcp-server.","triggerScenarios":"Thrown at pkg/http/oauth/oauth.go:129 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"}