{"record":{"id":"fd357374de62299c","repo":"github/github-mcp-server","slug":"failed-to-create-github-mcp-server-w","errorCode":null,"errorMessage":"failed to create GitHub MCP server: %w","messagePattern":"failed to create GitHub MCP server: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/ghmcp/server.go","lineNumber":194,"sourceCode":"\t\tWithToolsets(github.ResolvedEnabledToolsets(cfg.EnabledToolsets, cfg.EnabledTools)).\n\t\tWithTools(github.CleanTools(cfg.EnabledTools)).\n\t\tWithExcludeTools(cfg.ExcludeTools).\n\t\tWithServerInstructions().\n\t\tWithFeatureChecker(featureChecker)\n\n\t// Apply token scope filtering if scopes are known (for PAT filtering)\n\tif cfg.TokenScopes != nil {\n\t\tinventoryBuilder = inventoryBuilder.WithFilter(github.CreateToolScopeFilter(cfg.TokenScopes))\n\t}\n\n\tinventory, err := inventoryBuilder.Build()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to build inventory: %w\", err)\n\t}\n\n\tghServer, err := github.NewMCPServer(ctx, &cfg, deps, inventory)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create GitHub MCP server: %w\", err)\n\t}\n\n\tghServer.AddReceivingMiddleware(addUserAgentsMiddleware(cfg, clients.restUATransp, clients.gqlHTTP))\n\n\treturn ghServer, nil\n}\n\ntype StdioServerConfig struct {\n\t// Version of the server\n\tVersion string\n\n\t// GitHub Host to target for API requests (e.g. github.com or github.enterprise.com)\n\tHost string\n\n\t// GitHub Token to authenticate with the GitHub API\n\tToken string\n\n\t// EnabledToolsets is a list of toolsets to enable","sourceCodeStart":176,"sourceCodeEnd":212,"githubUrl":"https://github.com/github/github-mcp-server/blob/0ea1f775a7c73eff1bd2e25904d01136756bbfe2/internal/ghmcp/server.go#L176-L212","documentation":"Error \"failed to create GitHub MCP server: %w\" thrown in github/github-mcp-server.","triggerScenarios":"Thrown at internal/ghmcp/server.go:194 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"}