@@ -13,6 +13,7 @@ import (
1313 buffer "github.com/github/github-mcp-server/pkg/buffer"
1414 ghErrors "github.com/github/github-mcp-server/pkg/errors"
1515 "github.com/github/github-mcp-server/pkg/inventory"
16+ "github.com/github/github-mcp-server/pkg/scopes"
1617 "github.com/github/github-mcp-server/pkg/translations"
1718 "github.com/github/github-mcp-server/pkg/utils"
1819 "github.com/google/go-github/v79/github"
@@ -74,6 +75,7 @@ func ListWorkflows(t translations.TranslationHelperFunc) inventory.ServerTool {
7475 Required : []string {"owner" , "repo" },
7576 }),
7677 },
78+ []scopes.Scope {scopes .Repo },
7779 func (ctx context.Context , deps ToolDependencies , _ * mcp.CallToolRequest , args map [string ]any ) (* mcp.CallToolResult , any , error ) {
7880 client , err := deps .GetClient (ctx )
7981 if err != nil {
@@ -200,6 +202,7 @@ func ListWorkflowRuns(t translations.TranslationHelperFunc) inventory.ServerTool
200202 Required : []string {"owner" , "repo" , "workflow_id" },
201203 }),
202204 },
205+ []scopes.Scope {scopes .Repo },
203206 func (ctx context.Context , deps ToolDependencies , _ * mcp.CallToolRequest , args map [string ]any ) (* mcp.CallToolResult , any , error ) {
204207 client , err := deps .GetClient (ctx )
205208 if err != nil {
@@ -311,6 +314,7 @@ func RunWorkflow(t translations.TranslationHelperFunc) inventory.ServerTool {
311314 Required : []string {"owner" , "repo" , "workflow_id" , "ref" },
312315 },
313316 },
317+ []scopes.Scope {scopes .Repo },
314318 func (ctx context.Context , deps ToolDependencies , _ * mcp.CallToolRequest , args map [string ]any ) (* mcp.CallToolResult , any , error ) {
315319 client , err := deps .GetClient (ctx )
316320 if err != nil {
@@ -415,6 +419,7 @@ func GetWorkflowRun(t translations.TranslationHelperFunc) inventory.ServerTool {
415419 Required : []string {"owner" , "repo" , "run_id" },
416420 },
417421 },
422+ []scopes.Scope {scopes .Repo },
418423 func (ctx context.Context , deps ToolDependencies , _ * mcp.CallToolRequest , args map [string ]any ) (* mcp.CallToolResult , any , error ) {
419424 client , err := deps .GetClient (ctx )
420425 if err != nil {
@@ -483,6 +488,7 @@ func GetWorkflowRunLogs(t translations.TranslationHelperFunc) inventory.ServerTo
483488 Required : []string {"owner" , "repo" , "run_id" },
484489 },
485490 },
491+ []scopes.Scope {scopes .Repo },
486492 func (ctx context.Context , deps ToolDependencies , _ * mcp.CallToolRequest , args map [string ]any ) (* mcp.CallToolResult , any , error ) {
487493 client , err := deps .GetClient (ctx )
488494 if err != nil {
@@ -566,6 +572,7 @@ func ListWorkflowJobs(t translations.TranslationHelperFunc) inventory.ServerTool
566572 Required : []string {"owner" , "repo" , "run_id" },
567573 }),
568574 },
575+ []scopes.Scope {scopes .Repo },
569576 func (ctx context.Context , deps ToolDependencies , _ * mcp.CallToolRequest , args map [string ]any ) (* mcp.CallToolResult , any , error ) {
570577 client , err := deps .GetClient (ctx )
571578 if err != nil {
@@ -678,6 +685,7 @@ func GetJobLogs(t translations.TranslationHelperFunc) inventory.ServerTool {
678685 Required : []string {"owner" , "repo" },
679686 },
680687 },
688+ []scopes.Scope {scopes .Repo },
681689 func (ctx context.Context , deps ToolDependencies , _ * mcp.CallToolRequest , args map [string ]any ) (* mcp.CallToolResult , any , error ) {
682690 client , err := deps .GetClient (ctx )
683691 if err != nil {
@@ -926,6 +934,7 @@ func RerunWorkflowRun(t translations.TranslationHelperFunc) inventory.ServerTool
926934 Required : []string {"owner" , "repo" , "run_id" },
927935 },
928936 },
937+ []scopes.Scope {scopes .Repo },
929938 func (ctx context.Context , deps ToolDependencies , _ * mcp.CallToolRequest , args map [string ]any ) (* mcp.CallToolResult , any , error ) {
930939 client , err := deps .GetClient (ctx )
931940 if err != nil {
@@ -1001,6 +1010,7 @@ func RerunFailedJobs(t translations.TranslationHelperFunc) inventory.ServerTool
10011010 Required : []string {"owner" , "repo" , "run_id" },
10021011 },
10031012 },
1013+ []scopes.Scope {scopes .Repo },
10041014 func (ctx context.Context , deps ToolDependencies , _ * mcp.CallToolRequest , args map [string ]any ) (* mcp.CallToolResult , any , error ) {
10051015 client , err := deps .GetClient (ctx )
10061016 if err != nil {
@@ -1076,6 +1086,7 @@ func CancelWorkflowRun(t translations.TranslationHelperFunc) inventory.ServerToo
10761086 Required : []string {"owner" , "repo" , "run_id" },
10771087 },
10781088 },
1089+ []scopes.Scope {scopes .Repo },
10791090 func (ctx context.Context , deps ToolDependencies , _ * mcp.CallToolRequest , args map [string ]any ) (* mcp.CallToolResult , any , error ) {
10801091 client , err := deps .GetClient (ctx )
10811092 if err != nil {
@@ -1153,6 +1164,7 @@ func ListWorkflowRunArtifacts(t translations.TranslationHelperFunc) inventory.Se
11531164 Required : []string {"owner" , "repo" , "run_id" },
11541165 }),
11551166 },
1167+ []scopes.Scope {scopes .Repo },
11561168 func (ctx context.Context , deps ToolDependencies , _ * mcp.CallToolRequest , args map [string ]any ) (* mcp.CallToolResult , any , error ) {
11571169 client , err := deps .GetClient (ctx )
11581170 if err != nil {
@@ -1233,6 +1245,7 @@ func DownloadWorkflowRunArtifact(t translations.TranslationHelperFunc) inventory
12331245 Required : []string {"owner" , "repo" , "artifact_id" },
12341246 },
12351247 },
1248+ []scopes.Scope {scopes .Repo },
12361249 func (ctx context.Context , deps ToolDependencies , _ * mcp.CallToolRequest , args map [string ]any ) (* mcp.CallToolResult , any , error ) {
12371250 client , err := deps .GetClient (ctx )
12381251 if err != nil {
@@ -1311,6 +1324,7 @@ func DeleteWorkflowRunLogs(t translations.TranslationHelperFunc) inventory.Serve
13111324 Required : []string {"owner" , "repo" , "run_id" },
13121325 },
13131326 },
1327+ []scopes.Scope {scopes .Repo },
13141328 func (ctx context.Context , deps ToolDependencies , _ * mcp.CallToolRequest , args map [string ]any ) (* mcp.CallToolResult , any , error ) {
13151329 client , err := deps .GetClient (ctx )
13161330 if err != nil {
@@ -1386,6 +1400,7 @@ func GetWorkflowRunUsage(t translations.TranslationHelperFunc) inventory.ServerT
13861400 Required : []string {"owner" , "repo" , "run_id" },
13871401 },
13881402 },
1403+ []scopes.Scope {scopes .Repo },
13891404 func (ctx context.Context , deps ToolDependencies , _ * mcp.CallToolRequest , args map [string ]any ) (* mcp.CallToolResult , any , error ) {
13901405 client , err := deps .GetClient (ctx )
13911406 if err != nil {
@@ -1550,6 +1565,7 @@ Use this tool to list workflows in a repository, or list workflow runs, jobs, an
15501565 Required : []string {"method" , "owner" , "repo" },
15511566 },
15521567 },
1568+ []scopes.Scope {scopes .Repo },
15531569 func (ctx context.Context , deps ToolDependencies , _ * mcp.CallToolRequest , args map [string ]any ) (* mcp.CallToolResult , any , error ) {
15541570 owner , err := RequiredParam [string ](args , "owner" )
15551571 if err != nil {
@@ -1668,6 +1684,7 @@ Use this tool to get details about individual workflows, workflow runs, jobs, an
16681684 Required : []string {"method" , "owner" , "repo" , "resource_id" },
16691685 },
16701686 },
1687+ []scopes.Scope {scopes .Repo },
16711688 func (ctx context.Context , deps ToolDependencies , _ * mcp.CallToolRequest , args map [string ]any ) (* mcp.CallToolResult , any , error ) {
16721689 owner , err := RequiredParam [string ](args , "owner" )
16731690 if err != nil {
@@ -1781,6 +1798,7 @@ func ActionsRunTrigger(t translations.TranslationHelperFunc) inventory.ServerToo
17811798 Required : []string {"method" , "owner" , "repo" },
17821799 },
17831800 },
1801+ []scopes.Scope {scopes .Repo },
17841802 func (ctx context.Context , deps ToolDependencies , _ * mcp.CallToolRequest , args map [string ]any ) (* mcp.CallToolResult , any , error ) {
17851803 owner , err := RequiredParam [string ](args , "owner" )
17861804 if err != nil {
@@ -1895,6 +1913,7 @@ For single job logs, provide job_id. For all failed jobs in a run, provide run_i
18951913 Required : []string {"owner" , "repo" },
18961914 },
18971915 },
1916+ []scopes.Scope {scopes .Repo },
18981917 func (ctx context.Context , deps ToolDependencies , _ * mcp.CallToolRequest , args map [string ]any ) (* mcp.CallToolResult , any , error ) {
18991918 owner , err := RequiredParam [string ](args , "owner" )
19001919 if err != nil {
0 commit comments