Skip to content

Commit bab6b7c

Browse files
Rename registry to inventory in comments
Update remaining references to 'registry' in code comments to use 'inventory' consistently after the package rename.
1 parent fa18a2f commit bab6b7c

37 files changed

+301
-301
lines changed

cmd/github-mcp-server/generate_docs.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"strings"
99

1010
"github.com/github/github-mcp-server/pkg/github"
11-
"github.com/github/github-mcp-server/pkg/registry"
11+
"github.com/github/github-mcp-server/pkg/inventory"
1212
"github.com/github/github-mcp-server/pkg/translations"
1313
"github.com/google/jsonschema-go/jsonschema"
1414
"github.com/modelcontextprotocol/go-sdk/mcp"
@@ -50,8 +50,8 @@ func generateReadmeDocs(readmePath string) error {
5050
// Create translation helper
5151
t, _ := translations.TranslationHelper()
5252

53-
// Build registry - stateless, no dependencies needed for doc generation
54-
r := github.NewRegistry(t).Build()
53+
// Build inventory - stateless, no dependencies needed for doc generation
54+
r := github.NewInventory(t).Build()
5555

5656
// Generate toolsets documentation
5757
toolsetsDoc := generateToolsetsDoc(r)
@@ -104,7 +104,7 @@ func generateRemoteServerDocs(docsPath string) error {
104104
return os.WriteFile(docsPath, []byte(updatedContent), 0600) //#nosec G306
105105
}
106106

107-
func generateToolsetsDoc(r *registry.Registry) string {
107+
func generateToolsetsDoc(i *inventory.Inventory) string {
108108
var buf strings.Builder
109109

110110
// Add table header and separator
@@ -116,14 +116,14 @@ func generateToolsetsDoc(r *registry.Registry) string {
116116

117117
// AvailableToolsets() returns toolsets that have tools, sorted by ID
118118
// Exclude context (custom description above) and dynamic (internal only)
119-
for _, ts := range r.AvailableToolsets("context", "dynamic") {
119+
for _, ts := range i.AvailableToolsets("context", "dynamic") {
120120
fmt.Fprintf(&buf, "| `%s` | %s |\n", ts.ID, ts.Description)
121121
}
122122

123123
return strings.TrimSuffix(buf.String(), "\n")
124124
}
125125

126-
func generateToolsDoc(r *registry.Registry) string {
126+
func generateToolsDoc(r *inventory.Inventory) string {
127127
// AllTools() returns tools sorted by toolset ID then tool name.
128128
// We iterate once, grouping by toolset as we encounter them.
129129
tools := r.AllTools()
@@ -133,7 +133,7 @@ func generateToolsDoc(r *registry.Registry) string {
133133

134134
var buf strings.Builder
135135
var toolBuf strings.Builder
136-
var currentToolsetID registry.ToolsetID
136+
var currentToolsetID inventory.ToolsetID
137137
firstSection := true
138138

139139
writeSection := func() {
@@ -299,8 +299,8 @@ func generateRemoteToolsetsDoc() string {
299299
// Create translation helper
300300
t, _ := translations.TranslationHelper()
301301

302-
// Build registry - stateless
303-
r := github.NewRegistry(t).Build()
302+
// Build inventory - stateless
303+
r := github.NewInventory(t).Build()
304304

305305
// Generate table header
306306
buf.WriteString("| Name | Description | API URL | 1-Click Install (VS Code) | Read-only Link | 1-Click Read-only Install (VS Code) |\n")

e2e.test

15.2 MB
Binary file not shown.

internal/ghmcp/server.go

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ import (
1515

1616
"github.com/github/github-mcp-server/pkg/errors"
1717
"github.com/github/github-mcp-server/pkg/github"
18+
"github.com/github/github-mcp-server/pkg/inventory"
1819
"github.com/github/github-mcp-server/pkg/lockdown"
1920
mcplog "github.com/github/github-mcp-server/pkg/log"
2021
"github.com/github/github-mcp-server/pkg/raw"
21-
"github.com/github/github-mcp-server/pkg/registry"
2222
"github.com/github/github-mcp-server/pkg/translations"
2323
gogithub "github.com/google/go-github/v79/github"
2424
"github.com/modelcontextprotocol/go-sdk/mcp"
@@ -161,7 +161,7 @@ func NewMCPServer(cfg MCPServerConfig) (*mcp.Server, error) {
161161
enabledToolsets := resolveEnabledToolsets(cfg)
162162

163163
// For instruction generation, we need actual toolset names (not nil).
164-
// nil means "use defaults" in registry, so expand it for instructions.
164+
// nil means "use defaults" in inventory, so expand it for instructions.
165165
instructionToolsets := enabledToolsets
166166
if instructionToolsets == nil {
167167
instructionToolsets = github.GetDefaultToolsetIDs()
@@ -201,51 +201,51 @@ func NewMCPServer(cfg MCPServerConfig) (*mcp.Server, error) {
201201
cfg.ContentWindowSize,
202202
)
203203

204-
// Build and register the tool/resource/prompt registry
205-
registry := github.NewRegistry(cfg.Translator).
204+
// Build and register the tool/resource/prompt inventory
205+
inventory := github.NewInventory(cfg.Translator).
206206
WithDeprecatedAliases(github.DeprecatedToolAliases).
207207
WithReadOnly(cfg.ReadOnly).
208208
WithToolsets(enabledToolsets).
209209
WithTools(github.CleanTools(cfg.EnabledTools)).
210210
WithFeatureChecker(createFeatureChecker(cfg.EnabledFeatures)).
211211
Build()
212212

213-
if unrecognized := registry.UnrecognizedToolsets(); len(unrecognized) > 0 {
213+
if unrecognized := inventory.UnrecognizedToolsets(); len(unrecognized) > 0 {
214214
fmt.Fprintf(os.Stderr, "Warning: unrecognized toolsets ignored: %s\n", strings.Join(unrecognized, ", "))
215215
}
216216

217-
// Register GitHub tools/resources/prompts from the registry.
217+
// Register GitHub tools/resources/prompts from the inventory.
218218
// In dynamic mode with no explicit toolsets, this is a no-op since enabledToolsets
219219
// is empty - users enable toolsets at runtime via the dynamic tools below (but can
220220
// enable toolsets or tools explicitly that do need registration).
221-
registry.RegisterAll(context.Background(), ghServer, deps)
221+
inventory.RegisterAll(context.Background(), ghServer, deps)
222222

223223
// Register dynamic toolset management tools (enable/disable) - these are separate
224-
// meta-tools that control the registry, not part of the registry itself
224+
// meta-tools that control the inventory, not part of the inventory itself
225225
if cfg.DynamicToolsets {
226-
registerDynamicTools(ghServer, registry, deps, cfg.Translator)
226+
registerDynamicTools(ghServer, inventory, deps, cfg.Translator)
227227
}
228228

229229
return ghServer, nil
230230
}
231231

232232
// registerDynamicTools adds the dynamic toolset enable/disable tools to the server.
233-
func registerDynamicTools(server *mcp.Server, registry *registry.Registry, deps *github.BaseDeps, t translations.TranslationHelperFunc) {
233+
func registerDynamicTools(server *mcp.Server, inventory *inventory.Inventory, deps *github.BaseDeps, t translations.TranslationHelperFunc) {
234234
dynamicDeps := github.DynamicToolDependencies{
235-
Server: server,
236-
Registry: registry,
237-
ToolDeps: deps,
238-
T: t,
235+
Server: server,
236+
Inventory: inventory,
237+
ToolDeps: deps,
238+
T: t,
239239
}
240-
for _, tool := range github.DynamicTools(registry) {
240+
for _, tool := range github.DynamicTools(inventory) {
241241
tool.RegisterFunc(server, dynamicDeps)
242242
}
243243
}
244244

245245
// createFeatureChecker returns a FeatureFlagChecker that checks if a flag name
246246
// is present in the provided list of enabled features. For the local server,
247247
// this is populated from the --features CLI flag.
248-
func createFeatureChecker(enabledFeatures []string) registry.FeatureFlagChecker {
248+
func createFeatureChecker(enabledFeatures []string) inventory.FeatureFlagChecker {
249249
// Build a set for O(1) lookup
250250
featureSet := make(map[string]bool, len(enabledFeatures))
251251
for _, f := range enabledFeatures {

pkg/github/actions.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"github.com/github/github-mcp-server/internal/profiler"
1212
buffer "github.com/github/github-mcp-server/pkg/buffer"
1313
ghErrors "github.com/github/github-mcp-server/pkg/errors"
14-
"github.com/github/github-mcp-server/pkg/registry"
14+
"github.com/github/github-mcp-server/pkg/inventory"
1515
"github.com/github/github-mcp-server/pkg/translations"
1616
"github.com/github/github-mcp-server/pkg/utils"
1717
"github.com/google/go-github/v79/github"
@@ -25,7 +25,7 @@ const (
2525
)
2626

2727
// ListWorkflows creates a tool to list workflows in a repository
28-
func ListWorkflows(t translations.TranslationHelperFunc) registry.ServerTool {
28+
func ListWorkflows(t translations.TranslationHelperFunc) inventory.ServerTool {
2929
return NewTool(
3030
ToolsetMetadataActions,
3131
mcp.Tool{
@@ -96,7 +96,7 @@ func ListWorkflows(t translations.TranslationHelperFunc) registry.ServerTool {
9696
}
9797

9898
// ListWorkflowRuns creates a tool to list workflow runs for a specific workflow
99-
func ListWorkflowRuns(t translations.TranslationHelperFunc) registry.ServerTool {
99+
func ListWorkflowRuns(t translations.TranslationHelperFunc) inventory.ServerTool {
100100
return NewTool(
101101
ToolsetMetadataActions,
102102
mcp.Tool{
@@ -250,7 +250,7 @@ func ListWorkflowRuns(t translations.TranslationHelperFunc) registry.ServerTool
250250
}
251251

252252
// RunWorkflow creates a tool to run an Actions workflow
253-
func RunWorkflow(t translations.TranslationHelperFunc) registry.ServerTool {
253+
func RunWorkflow(t translations.TranslationHelperFunc) inventory.ServerTool {
254254
return NewTool(
255255
ToolsetMetadataActions,
256256
mcp.Tool{
@@ -362,7 +362,7 @@ func RunWorkflow(t translations.TranslationHelperFunc) registry.ServerTool {
362362
}
363363

364364
// GetWorkflowRun creates a tool to get details of a specific workflow run
365-
func GetWorkflowRun(t translations.TranslationHelperFunc) registry.ServerTool {
365+
func GetWorkflowRun(t translations.TranslationHelperFunc) inventory.ServerTool {
366366
return NewTool(
367367
ToolsetMetadataActions,
368368
mcp.Tool{
@@ -430,7 +430,7 @@ func GetWorkflowRun(t translations.TranslationHelperFunc) registry.ServerTool {
430430
}
431431

432432
// GetWorkflowRunLogs creates a tool to download logs for a specific workflow run
433-
func GetWorkflowRunLogs(t translations.TranslationHelperFunc) registry.ServerTool {
433+
func GetWorkflowRunLogs(t translations.TranslationHelperFunc) inventory.ServerTool {
434434
return NewTool(
435435
ToolsetMetadataActions,
436436
mcp.Tool{
@@ -508,7 +508,7 @@ func GetWorkflowRunLogs(t translations.TranslationHelperFunc) registry.ServerToo
508508
}
509509

510510
// ListWorkflowJobs creates a tool to list jobs for a specific workflow run
511-
func ListWorkflowJobs(t translations.TranslationHelperFunc) registry.ServerTool {
511+
func ListWorkflowJobs(t translations.TranslationHelperFunc) inventory.ServerTool {
512512
return NewTool(
513513
ToolsetMetadataActions,
514514
mcp.Tool{
@@ -608,7 +608,7 @@ func ListWorkflowJobs(t translations.TranslationHelperFunc) registry.ServerTool
608608
}
609609

610610
// GetJobLogs creates a tool to download logs for a specific workflow job or efficiently get all failed job logs for a workflow run
611-
func GetJobLogs(t translations.TranslationHelperFunc) registry.ServerTool {
611+
func GetJobLogs(t translations.TranslationHelperFunc) inventory.ServerTool {
612612
return NewTool(
613613
ToolsetMetadataActions,
614614
mcp.Tool{
@@ -873,7 +873,7 @@ func downloadLogContent(ctx context.Context, logURL string, tailLines int, maxLi
873873
}
874874

875875
// RerunWorkflowRun creates a tool to re-run an entire workflow run
876-
func RerunWorkflowRun(t translations.TranslationHelperFunc) registry.ServerTool {
876+
func RerunWorkflowRun(t translations.TranslationHelperFunc) inventory.ServerTool {
877877
return NewTool(
878878
ToolsetMetadataActions,
879879
mcp.Tool{
@@ -948,7 +948,7 @@ func RerunWorkflowRun(t translations.TranslationHelperFunc) registry.ServerTool
948948
}
949949

950950
// RerunFailedJobs creates a tool to re-run only the failed jobs in a workflow run
951-
func RerunFailedJobs(t translations.TranslationHelperFunc) registry.ServerTool {
951+
func RerunFailedJobs(t translations.TranslationHelperFunc) inventory.ServerTool {
952952
return NewTool(
953953
ToolsetMetadataActions,
954954
mcp.Tool{
@@ -1023,7 +1023,7 @@ func RerunFailedJobs(t translations.TranslationHelperFunc) registry.ServerTool {
10231023
}
10241024

10251025
// CancelWorkflowRun creates a tool to cancel a workflow run
1026-
func CancelWorkflowRun(t translations.TranslationHelperFunc) registry.ServerTool {
1026+
func CancelWorkflowRun(t translations.TranslationHelperFunc) inventory.ServerTool {
10271027
return NewTool(
10281028
ToolsetMetadataActions,
10291029
mcp.Tool{
@@ -1100,7 +1100,7 @@ func CancelWorkflowRun(t translations.TranslationHelperFunc) registry.ServerTool
11001100
}
11011101

11021102
// ListWorkflowRunArtifacts creates a tool to list artifacts for a workflow run
1103-
func ListWorkflowRunArtifacts(t translations.TranslationHelperFunc) registry.ServerTool {
1103+
func ListWorkflowRunArtifacts(t translations.TranslationHelperFunc) inventory.ServerTool {
11041104
return NewTool(
11051105
ToolsetMetadataActions,
11061106
mcp.Tool{
@@ -1180,7 +1180,7 @@ func ListWorkflowRunArtifacts(t translations.TranslationHelperFunc) registry.Ser
11801180
}
11811181

11821182
// DownloadWorkflowRunArtifact creates a tool to download a workflow run artifact
1183-
func DownloadWorkflowRunArtifact(t translations.TranslationHelperFunc) registry.ServerTool {
1183+
func DownloadWorkflowRunArtifact(t translations.TranslationHelperFunc) inventory.ServerTool {
11841184
return NewTool(
11851185
ToolsetMetadataActions,
11861186
mcp.Tool{
@@ -1257,7 +1257,7 @@ func DownloadWorkflowRunArtifact(t translations.TranslationHelperFunc) registry.
12571257
}
12581258

12591259
// DeleteWorkflowRunLogs creates a tool to delete logs for a workflow run
1260-
func DeleteWorkflowRunLogs(t translations.TranslationHelperFunc) registry.ServerTool {
1260+
func DeleteWorkflowRunLogs(t translations.TranslationHelperFunc) inventory.ServerTool {
12611261
return NewTool(
12621262
ToolsetMetadataActions,
12631263
mcp.Tool{
@@ -1333,7 +1333,7 @@ func DeleteWorkflowRunLogs(t translations.TranslationHelperFunc) registry.Server
13331333
}
13341334

13351335
// GetWorkflowRunUsage creates a tool to get usage metrics for a workflow run
1336-
func GetWorkflowRunUsage(t translations.TranslationHelperFunc) registry.ServerTool {
1336+
func GetWorkflowRunUsage(t translations.TranslationHelperFunc) inventory.ServerTool {
13371337
return NewTool(
13381338
ToolsetMetadataActions,
13391339
mcp.Tool{

pkg/github/code_scanning.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ import (
88
"net/http"
99

1010
ghErrors "github.com/github/github-mcp-server/pkg/errors"
11-
"github.com/github/github-mcp-server/pkg/registry"
11+
"github.com/github/github-mcp-server/pkg/inventory"
1212
"github.com/github/github-mcp-server/pkg/translations"
1313
"github.com/github/github-mcp-server/pkg/utils"
1414
"github.com/google/go-github/v79/github"
1515
"github.com/google/jsonschema-go/jsonschema"
1616
"github.com/modelcontextprotocol/go-sdk/mcp"
1717
)
1818

19-
func GetCodeScanningAlert(t translations.TranslationHelperFunc) registry.ServerTool {
19+
func GetCodeScanningAlert(t translations.TranslationHelperFunc) inventory.ServerTool {
2020
return NewTool(
2121
ToolsetMetadataCodeSecurity,
2222
mcp.Tool{
@@ -94,7 +94,7 @@ func GetCodeScanningAlert(t translations.TranslationHelperFunc) registry.ServerT
9494
)
9595
}
9696

97-
func ListCodeScanningAlerts(t translations.TranslationHelperFunc) registry.ServerTool {
97+
func ListCodeScanningAlerts(t translations.TranslationHelperFunc) inventory.ServerTool {
9898
return NewTool(
9999
ToolsetMetadataCodeSecurity,
100100
mcp.Tool{

pkg/github/context_tools.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"time"
77

88
ghErrors "github.com/github/github-mcp-server/pkg/errors"
9-
"github.com/github/github-mcp-server/pkg/registry"
9+
"github.com/github/github-mcp-server/pkg/inventory"
1010
"github.com/github/github-mcp-server/pkg/translations"
1111
"github.com/github/github-mcp-server/pkg/utils"
1212
"github.com/google/jsonschema-go/jsonschema"
@@ -37,7 +37,7 @@ type UserDetails struct {
3737
}
3838

3939
// GetMe creates a tool to get details of the authenticated user.
40-
func GetMe(t translations.TranslationHelperFunc) registry.ServerTool {
40+
func GetMe(t translations.TranslationHelperFunc) inventory.ServerTool {
4141
return NewTool(
4242
ToolsetMetadataContext,
4343
mcp.Tool{
@@ -111,7 +111,7 @@ type OrganizationTeams struct {
111111
Teams []TeamInfo `json:"teams"`
112112
}
113113

114-
func GetTeams(t translations.TranslationHelperFunc) registry.ServerTool {
114+
func GetTeams(t translations.TranslationHelperFunc) inventory.ServerTool {
115115
return NewTool(
116116
ToolsetMetadataContext,
117117
mcp.Tool{
@@ -210,7 +210,7 @@ func GetTeams(t translations.TranslationHelperFunc) registry.ServerTool {
210210
)
211211
}
212212

213-
func GetTeamMembers(t translations.TranslationHelperFunc) registry.ServerTool {
213+
func GetTeamMembers(t translations.TranslationHelperFunc) inventory.ServerTool {
214214
return NewTool(
215215
ToolsetMetadataContext,
216216
mcp.Tool{

pkg/github/dependabot.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ import (
88
"net/http"
99

1010
ghErrors "github.com/github/github-mcp-server/pkg/errors"
11-
"github.com/github/github-mcp-server/pkg/registry"
11+
"github.com/github/github-mcp-server/pkg/inventory"
1212
"github.com/github/github-mcp-server/pkg/translations"
1313
"github.com/github/github-mcp-server/pkg/utils"
1414
"github.com/google/go-github/v79/github"
1515
"github.com/google/jsonschema-go/jsonschema"
1616
"github.com/modelcontextprotocol/go-sdk/mcp"
1717
)
1818

19-
func GetDependabotAlert(t translations.TranslationHelperFunc) registry.ServerTool {
19+
func GetDependabotAlert(t translations.TranslationHelperFunc) inventory.ServerTool {
2020
return NewTool(
2121
ToolsetMetadataDependabot,
2222
mcp.Tool{
@@ -94,7 +94,7 @@ func GetDependabotAlert(t translations.TranslationHelperFunc) registry.ServerToo
9494
)
9595
}
9696

97-
func ListDependabotAlerts(t translations.TranslationHelperFunc) registry.ServerTool {
97+
func ListDependabotAlerts(t translations.TranslationHelperFunc) inventory.ServerTool {
9898
return NewTool(
9999
ToolsetMetadataDependabot,
100100
mcp.Tool{

0 commit comments

Comments
 (0)