Skip to content

Commit f812de6

Browse files
Add scope hierarchy and auto-derive accepted scopes
- Add ScopeHierarchy map defining parent-child scope relationships - Add ExpandScopes() function to derive accepted scopes from required scopes - Update NewTool/NewToolFromHandler to take []scopes.Scope and auto-derive AcceptedScopes - Add new scope constants: NoScope, User, ReadUser, UserEmail, ReadPackages, WritePackages - Update all tool files to use new signature with typed scopes - Add comprehensive tests for ExpandScopes The scope hierarchy allows automatic derivation of accepted scopes: - repo → public_repo, security_events - admin:org → write:org → read:org - project → read:project - write:packages → read:packages - user → read:user, user:email This enables the remote server to consume scope info directly from OSS tools.
1 parent c32646d commit f812de6

19 files changed

+325
-206
lines changed

pkg/github/actions.go

Lines changed: 18 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ func ListWorkflows(t translations.TranslationHelperFunc) inventory.ServerTool {
7575
Required: []string{"owner", "repo"},
7676
}),
7777
},
78-
scopes.ToStringSlice(scopes.Repo),
79-
scopes.ToStringSlice(scopes.Repo),
78+
[]scopes.Scope{scopes.Repo},
8079
func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) {
8180
client, err := deps.GetClient(ctx)
8281
if err != nil {
@@ -203,8 +202,7 @@ func ListWorkflowRuns(t translations.TranslationHelperFunc) inventory.ServerTool
203202
Required: []string{"owner", "repo", "workflow_id"},
204203
}),
205204
},
206-
scopes.ToStringSlice(scopes.Repo),
207-
scopes.ToStringSlice(scopes.Repo),
205+
[]scopes.Scope{scopes.Repo},
208206
func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) {
209207
client, err := deps.GetClient(ctx)
210208
if err != nil {
@@ -316,8 +314,7 @@ func RunWorkflow(t translations.TranslationHelperFunc) inventory.ServerTool {
316314
Required: []string{"owner", "repo", "workflow_id", "ref"},
317315
},
318316
},
319-
scopes.ToStringSlice(scopes.Repo),
320-
scopes.ToStringSlice(scopes.Repo),
317+
[]scopes.Scope{scopes.Repo},
321318
func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) {
322319
client, err := deps.GetClient(ctx)
323320
if err != nil {
@@ -422,8 +419,7 @@ func GetWorkflowRun(t translations.TranslationHelperFunc) inventory.ServerTool {
422419
Required: []string{"owner", "repo", "run_id"},
423420
},
424421
},
425-
scopes.ToStringSlice(scopes.Repo),
426-
scopes.ToStringSlice(scopes.Repo),
422+
[]scopes.Scope{scopes.Repo},
427423
func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) {
428424
client, err := deps.GetClient(ctx)
429425
if err != nil {
@@ -492,8 +488,7 @@ func GetWorkflowRunLogs(t translations.TranslationHelperFunc) inventory.ServerTo
492488
Required: []string{"owner", "repo", "run_id"},
493489
},
494490
},
495-
scopes.ToStringSlice(scopes.Repo),
496-
scopes.ToStringSlice(scopes.Repo),
491+
[]scopes.Scope{scopes.Repo},
497492
func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) {
498493
client, err := deps.GetClient(ctx)
499494
if err != nil {
@@ -577,8 +572,7 @@ func ListWorkflowJobs(t translations.TranslationHelperFunc) inventory.ServerTool
577572
Required: []string{"owner", "repo", "run_id"},
578573
}),
579574
},
580-
scopes.ToStringSlice(scopes.Repo),
581-
scopes.ToStringSlice(scopes.Repo),
575+
[]scopes.Scope{scopes.Repo},
582576
func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) {
583577
client, err := deps.GetClient(ctx)
584578
if err != nil {
@@ -691,8 +685,7 @@ func GetJobLogs(t translations.TranslationHelperFunc) inventory.ServerTool {
691685
Required: []string{"owner", "repo"},
692686
},
693687
},
694-
scopes.ToStringSlice(scopes.Repo),
695-
scopes.ToStringSlice(scopes.Repo),
688+
[]scopes.Scope{scopes.Repo},
696689
func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) {
697690
client, err := deps.GetClient(ctx)
698691
if err != nil {
@@ -941,8 +934,7 @@ func RerunWorkflowRun(t translations.TranslationHelperFunc) inventory.ServerTool
941934
Required: []string{"owner", "repo", "run_id"},
942935
},
943936
},
944-
scopes.ToStringSlice(scopes.Repo),
945-
scopes.ToStringSlice(scopes.Repo),
937+
[]scopes.Scope{scopes.Repo},
946938
func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) {
947939
client, err := deps.GetClient(ctx)
948940
if err != nil {
@@ -1018,8 +1010,7 @@ func RerunFailedJobs(t translations.TranslationHelperFunc) inventory.ServerTool
10181010
Required: []string{"owner", "repo", "run_id"},
10191011
},
10201012
},
1021-
scopes.ToStringSlice(scopes.Repo),
1022-
scopes.ToStringSlice(scopes.Repo),
1013+
[]scopes.Scope{scopes.Repo},
10231014
func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) {
10241015
client, err := deps.GetClient(ctx)
10251016
if err != nil {
@@ -1095,8 +1086,7 @@ func CancelWorkflowRun(t translations.TranslationHelperFunc) inventory.ServerToo
10951086
Required: []string{"owner", "repo", "run_id"},
10961087
},
10971088
},
1098-
scopes.ToStringSlice(scopes.Repo),
1099-
scopes.ToStringSlice(scopes.Repo),
1089+
[]scopes.Scope{scopes.Repo},
11001090
func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) {
11011091
client, err := deps.GetClient(ctx)
11021092
if err != nil {
@@ -1174,8 +1164,7 @@ func ListWorkflowRunArtifacts(t translations.TranslationHelperFunc) inventory.Se
11741164
Required: []string{"owner", "repo", "run_id"},
11751165
}),
11761166
},
1177-
scopes.ToStringSlice(scopes.Repo),
1178-
scopes.ToStringSlice(scopes.Repo),
1167+
[]scopes.Scope{scopes.Repo},
11791168
func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) {
11801169
client, err := deps.GetClient(ctx)
11811170
if err != nil {
@@ -1256,8 +1245,7 @@ func DownloadWorkflowRunArtifact(t translations.TranslationHelperFunc) inventory
12561245
Required: []string{"owner", "repo", "artifact_id"},
12571246
},
12581247
},
1259-
scopes.ToStringSlice(scopes.Repo),
1260-
scopes.ToStringSlice(scopes.Repo),
1248+
[]scopes.Scope{scopes.Repo},
12611249
func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) {
12621250
client, err := deps.GetClient(ctx)
12631251
if err != nil {
@@ -1336,8 +1324,7 @@ func DeleteWorkflowRunLogs(t translations.TranslationHelperFunc) inventory.Serve
13361324
Required: []string{"owner", "repo", "run_id"},
13371325
},
13381326
},
1339-
scopes.ToStringSlice(scopes.Repo),
1340-
scopes.ToStringSlice(scopes.Repo),
1327+
[]scopes.Scope{scopes.Repo},
13411328
func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) {
13421329
client, err := deps.GetClient(ctx)
13431330
if err != nil {
@@ -1413,8 +1400,7 @@ func GetWorkflowRunUsage(t translations.TranslationHelperFunc) inventory.ServerT
14131400
Required: []string{"owner", "repo", "run_id"},
14141401
},
14151402
},
1416-
scopes.ToStringSlice(scopes.Repo),
1417-
scopes.ToStringSlice(scopes.Repo),
1403+
[]scopes.Scope{scopes.Repo},
14181404
func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) {
14191405
client, err := deps.GetClient(ctx)
14201406
if err != nil {
@@ -1579,8 +1565,7 @@ Use this tool to list workflows in a repository, or list workflow runs, jobs, an
15791565
Required: []string{"method", "owner", "repo"},
15801566
},
15811567
},
1582-
scopes.ToStringSlice(scopes.Repo),
1583-
scopes.ToStringSlice(scopes.Repo),
1568+
[]scopes.Scope{scopes.Repo},
15841569
func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) {
15851570
owner, err := RequiredParam[string](args, "owner")
15861571
if err != nil {
@@ -1699,8 +1684,7 @@ Use this tool to get details about individual workflows, workflow runs, jobs, an
16991684
Required: []string{"method", "owner", "repo", "resource_id"},
17001685
},
17011686
},
1702-
scopes.ToStringSlice(scopes.Repo),
1703-
scopes.ToStringSlice(scopes.Repo),
1687+
[]scopes.Scope{scopes.Repo},
17041688
func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) {
17051689
owner, err := RequiredParam[string](args, "owner")
17061690
if err != nil {
@@ -1814,8 +1798,7 @@ func ActionsRunTrigger(t translations.TranslationHelperFunc) inventory.ServerToo
18141798
Required: []string{"method", "owner", "repo"},
18151799
},
18161800
},
1817-
scopes.ToStringSlice(scopes.Repo),
1818-
scopes.ToStringSlice(scopes.Repo),
1801+
[]scopes.Scope{scopes.Repo},
18191802
func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) {
18201803
owner, err := RequiredParam[string](args, "owner")
18211804
if err != nil {
@@ -1930,8 +1913,7 @@ For single job logs, provide job_id. For all failed jobs in a run, provide run_i
19301913
Required: []string{"owner", "repo"},
19311914
},
19321915
},
1933-
scopes.ToStringSlice(scopes.Repo),
1934-
scopes.ToStringSlice(scopes.Repo),
1916+
[]scopes.Scope{scopes.Repo},
19351917
func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) {
19361918
owner, err := RequiredParam[string](args, "owner")
19371919
if err != nil {

pkg/github/code_scanning.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ func GetCodeScanningAlert(t translations.TranslationHelperFunc) inventory.Server
4545
Required: []string{"owner", "repo", "alertNumber"},
4646
},
4747
},
48-
scopes.ToStringSlice(scopes.SecurityEvents),
49-
scopes.ToStringSlice(scopes.SecurityEvents, scopes.Repo),
48+
[]scopes.Scope{scopes.SecurityEvents},
5049
func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) {
5150
owner, err := RequiredParam[string](args, "owner")
5251
if err != nil {
@@ -138,8 +137,7 @@ func ListCodeScanningAlerts(t translations.TranslationHelperFunc) inventory.Serv
138137
Required: []string{"owner", "repo"},
139138
},
140139
},
141-
scopes.ToStringSlice(scopes.SecurityEvents),
142-
scopes.ToStringSlice(scopes.SecurityEvents, scopes.Repo),
140+
[]scopes.Scope{scopes.SecurityEvents},
143141
func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) {
144142
owner, err := RequiredParam[string](args, "owner")
145143
if err != nil {

pkg/github/context_tools.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ func GetMe(t translations.TranslationHelperFunc) inventory.ServerTool {
5252
// OpenAI strict mode requires the properties field to be present.
5353
InputSchema: json.RawMessage(`{"type":"object","properties":{}}`),
5454
},
55-
nil, // no required scopes
56-
nil, // no accepted scopes
55+
nil,
5756
func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, _ map[string]any) (*mcp.CallToolResult, any, error) {
5857
client, err := deps.GetClient(ctx)
5958
if err != nil {
@@ -132,8 +131,7 @@ func GetTeams(t translations.TranslationHelperFunc) inventory.ServerTool {
132131
},
133132
},
134133
},
135-
scopes.ToStringSlice(scopes.ReadOrg),
136-
scopes.ToStringSlice(scopes.ReadOrg, scopes.WriteOrg, scopes.AdminOrg),
134+
[]scopes.Scope{scopes.ReadOrg},
137135
func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) {
138136
user, err := OptionalParam[string](args, "user")
139137
if err != nil {
@@ -236,8 +234,7 @@ func GetTeamMembers(t translations.TranslationHelperFunc) inventory.ServerTool {
236234
Required: []string{"org", "team_slug"},
237235
},
238236
},
239-
scopes.ToStringSlice(scopes.ReadOrg),
240-
scopes.ToStringSlice(scopes.ReadOrg, scopes.WriteOrg, scopes.AdminOrg),
237+
[]scopes.Scope{scopes.ReadOrg},
241238
func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) {
242239
org, err := RequiredParam[string](args, "org")
243240
if err != nil {

pkg/github/dependabot.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ func GetDependabotAlert(t translations.TranslationHelperFunc) inventory.ServerTo
4646
Required: []string{"owner", "repo", "alertNumber"},
4747
},
4848
},
49-
scopes.ToStringSlice(scopes.SecurityEvents),
50-
scopes.ToStringSlice(scopes.SecurityEvents, scopes.Repo),
49+
[]scopes.Scope{scopes.SecurityEvents},
5150
func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) {
5251
owner, err := RequiredParam[string](args, "owner")
5352
if err != nil {
@@ -131,8 +130,7 @@ func ListDependabotAlerts(t translations.TranslationHelperFunc) inventory.Server
131130
Required: []string{"owner", "repo"},
132131
},
133132
},
134-
scopes.ToStringSlice(scopes.SecurityEvents),
135-
scopes.ToStringSlice(scopes.SecurityEvents, scopes.Repo),
133+
[]scopes.Scope{scopes.SecurityEvents},
136134
func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) {
137135
owner, err := RequiredParam[string](args, "owner")
138136
if err != nil {

pkg/github/dependencies.go

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"github.com/github/github-mcp-server/pkg/inventory"
88
"github.com/github/github-mcp-server/pkg/lockdown"
99
"github.com/github/github-mcp-server/pkg/raw"
10+
"github.com/github/github-mcp-server/pkg/scopes"
1011
"github.com/github/github-mcp-server/pkg/translations"
1112
gogithub "github.com/google/go-github/v79/github"
1213
"github.com/modelcontextprotocol/go-sdk/mcp"
@@ -149,20 +150,21 @@ func (d BaseDeps) GetContentWindowSize() int { return d.ContentWindowSize }
149150
// The handler function receives deps extracted from context via MustDepsFromContext.
150151
// Ensure ContextWithDeps is called to inject deps before any tool handlers are invoked.
151152
//
152-
// All tools must explicitly specify their OAuth scope requirements, even if empty (nil).
153+
// requiredScopes specifies the minimum OAuth scopes needed for this tool.
154+
// AcceptedScopes are automatically derived using the scope hierarchy (e.g., if
155+
// public_repo is required, repo is also accepted since repo grants public_repo).
153156
func NewTool[In, Out any](
154157
toolset inventory.ToolsetMetadata,
155158
tool mcp.Tool,
156-
requiredScopes []string,
157-
acceptedScopes []string,
159+
requiredScopes []scopes.Scope,
158160
handler func(ctx context.Context, deps ToolDependencies, req *mcp.CallToolRequest, args In) (*mcp.CallToolResult, Out, error),
159161
) inventory.ServerTool {
160162
st := inventory.NewServerToolWithContextHandler(tool, toolset, func(ctx context.Context, req *mcp.CallToolRequest, args In) (*mcp.CallToolResult, Out, error) {
161163
deps := MustDepsFromContext(ctx)
162164
return handler(ctx, deps, req, args)
163165
})
164-
st.RequiredScopes = requiredScopes
165-
st.AcceptedScopes = acceptedScopes
166+
st.RequiredScopes = scopes.ToStringSlice(requiredScopes...)
167+
st.AcceptedScopes = scopes.ExpandScopes(requiredScopes...)
166168
return st
167169
}
168170

@@ -172,19 +174,19 @@ func NewTool[In, Out any](
172174
// The handler function receives deps extracted from context via MustDepsFromContext.
173175
// Ensure ContextWithDeps is called to inject deps before any tool handlers are invoked.
174176
//
175-
// All tools must explicitly specify their OAuth scope requirements, even if empty (nil).
177+
// requiredScopes specifies the minimum OAuth scopes needed for this tool.
178+
// AcceptedScopes are automatically derived using the scope hierarchy.
176179
func NewToolFromHandler(
177180
toolset inventory.ToolsetMetadata,
178181
tool mcp.Tool,
179-
requiredScopes []string,
180-
acceptedScopes []string,
182+
requiredScopes []scopes.Scope,
181183
handler func(ctx context.Context, deps ToolDependencies, req *mcp.CallToolRequest) (*mcp.CallToolResult, error),
182184
) inventory.ServerTool {
183185
st := inventory.NewServerToolWithRawContextHandler(tool, toolset, func(ctx context.Context, req *mcp.CallToolRequest) (*mcp.CallToolResult, error) {
184186
deps := MustDepsFromContext(ctx)
185187
return handler(ctx, deps, req)
186188
})
187-
st.RequiredScopes = requiredScopes
188-
st.AcceptedScopes = acceptedScopes
189+
st.RequiredScopes = scopes.ToStringSlice(requiredScopes...)
190+
st.AcceptedScopes = scopes.ExpandScopes(requiredScopes...)
189191
return st
190192
}

pkg/github/discussions.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,7 @@ func ListDiscussions(t translations.TranslationHelperFunc) inventory.ServerTool
162162
Required: []string{"owner"},
163163
}),
164164
},
165-
scopes.ToStringSlice(scopes.Repo),
166-
scopes.ToStringSlice(scopes.Repo),
165+
[]scopes.Scope{scopes.Repo},
167166
func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) {
168167
owner, err := RequiredParam[string](args, "owner")
169168
if err != nil {
@@ -306,8 +305,7 @@ func GetDiscussion(t translations.TranslationHelperFunc) inventory.ServerTool {
306305
Required: []string{"owner", "repo", "discussionNumber"},
307306
},
308307
},
309-
scopes.ToStringSlice(scopes.Repo),
310-
scopes.ToStringSlice(scopes.Repo),
308+
[]scopes.Scope{scopes.Repo},
311309
func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) {
312310
// Decode params
313311
var params struct {
@@ -411,8 +409,7 @@ func GetDiscussionComments(t translations.TranslationHelperFunc) inventory.Serve
411409
Required: []string{"owner", "repo", "discussionNumber"},
412410
}),
413411
},
414-
scopes.ToStringSlice(scopes.Repo),
415-
scopes.ToStringSlice(scopes.Repo),
412+
[]scopes.Scope{scopes.Repo},
416413
func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) {
417414
// Decode params
418415
var params struct {
@@ -535,8 +532,7 @@ func ListDiscussionCategories(t translations.TranslationHelperFunc) inventory.Se
535532
Required: []string{"owner"},
536533
},
537534
},
538-
scopes.ToStringSlice(scopes.Repo),
539-
scopes.ToStringSlice(scopes.Repo),
535+
[]scopes.Scope{scopes.Repo},
540536
func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) {
541537
owner, err := RequiredParam[string](args, "owner")
542538
if err != nil {

pkg/github/gists.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ func ListGists(t translations.TranslationHelperFunc) inventory.ServerTool {
4242
},
4343
}),
4444
},
45-
nil, // no required scopes
46-
nil, // no accepted scopes
45+
nil,
4746
func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) {
4847
username, err := OptionalParam[string](args, "username")
4948
if err != nil {
@@ -127,8 +126,7 @@ func GetGist(t translations.TranslationHelperFunc) inventory.ServerTool {
127126
Required: []string{"gist_id"},
128127
},
129128
},
130-
nil, // no required scopes
131-
nil, // no accepted scopes
129+
nil,
132130
func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) {
133131
gistID, err := RequiredParam[string](args, "gist_id")
134132
if err != nil {
@@ -199,8 +197,7 @@ func CreateGist(t translations.TranslationHelperFunc) inventory.ServerTool {
199197
Required: []string{"filename", "content"},
200198
},
201199
},
202-
scopes.ToStringSlice(scopes.Gist),
203-
scopes.ToStringSlice(scopes.Gist),
200+
[]scopes.Scope{scopes.Gist},
204201
func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) {
205202
description, err := OptionalParam[string](args, "description")
206203
if err != nil {
@@ -302,8 +299,7 @@ func UpdateGist(t translations.TranslationHelperFunc) inventory.ServerTool {
302299
Required: []string{"gist_id", "filename", "content"},
303300
},
304301
},
305-
scopes.ToStringSlice(scopes.Gist),
306-
scopes.ToStringSlice(scopes.Gist),
302+
[]scopes.Scope{scopes.Gist},
307303
func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) {
308304
gistID, err := RequiredParam[string](args, "gist_id")
309305
if err != nil {

pkg/github/git.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@ func GetRepositoryTree(t translations.TranslationHelperFunc) inventory.ServerToo
7777
Required: []string{"owner", "repo"},
7878
},
7979
},
80-
scopes.ToStringSlice(scopes.Repo),
81-
scopes.ToStringSlice(scopes.Repo),
80+
[]scopes.Scope{scopes.Repo},
8281
func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) {
8382
owner, err := RequiredParam[string](args, "owner")
8483
if err != nil {

0 commit comments

Comments
 (0)