Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions internal/ghmcp/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ func NewMCPServer(cfg MCPServerConfig) (*mcp.Server, error) {
cfg.Translator,
github.FeatureFlags{
LockdownMode: cfg.LockdownMode,
InsiderMode: cfg.InsiderMode,
InsiderMode: cfg.InsiderMode,
},
cfg.ContentWindowSize,
featureChecker,
Expand All @@ -235,7 +235,7 @@ func NewMCPServer(cfg MCPServerConfig) (*mcp.Server, error) {
WithToolsets(enabledToolsets).
WithTools(cfg.EnabledTools).
WithFeatureChecker(featureChecker)

// Apply token scope filtering if scopes are known (for PAT filtering)
if cfg.TokenScopes != nil {
inventoryBuilder = inventoryBuilder.WithFilter(github.CreateToolScopeFilter(cfg.TokenScopes))
Expand Down
3 changes: 2 additions & 1 deletion pkg/github/inventory.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ func NewInventory(t translations.TranslationHelperFunc) *inventory.Builder {
return inventory.NewBuilder().
SetTools(AllTools(t)).
SetResources(AllResources(t)).
SetPrompts(AllPrompts(t))
SetPrompts(AllPrompts(t)).
SetToolsetMetadata(RemoteOnlyToolsets())
}
1 change: 1 addition & 0 deletions pkg/github/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ var (
ToolsetMetadataCopilot = inventory.ToolsetMetadata{
ID: "copilot",
Description: "Copilot related tools",
Default: true,
Icon: "copilot",
}
ToolsetMetadataCopilotSpaces = inventory.ToolsetMetadata{
Expand Down
3 changes: 3 additions & 0 deletions pkg/github/tools_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ func TestAddDefaultToolset(t *testing.T) {
input: []string{"default"},
expected: []string{
"context",
"copilot",
"repos",
"issues",
"pull_requests",
Expand All @@ -36,6 +37,7 @@ func TestAddDefaultToolset(t *testing.T) {
"actions",
"gists",
"context",
"copilot",
"repos",
"issues",
"pull_requests",
Expand All @@ -47,6 +49,7 @@ func TestAddDefaultToolset(t *testing.T) {
input: []string{"default", "context", "repos"},
expected: []string{
"context",
"copilot",
"repos",
"issues",
"pull_requests",
Expand Down
23 changes: 23 additions & 0 deletions pkg/inventory/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type Builder struct {
resourceTemplates []ServerResourceTemplate
prompts []ServerPrompt
deprecatedAliases map[string]string
toolsetMetadata []ToolsetMetadata // standalone toolset metadata for toolsets without registered tools (e.g., remote-only toolsets)

// Configuration options (processed at Build time)
readOnly bool
Expand Down Expand Up @@ -68,6 +69,17 @@ func (b *Builder) SetPrompts(prompts []ServerPrompt) *Builder {
return b
}

// SetToolsetMetadata sets standalone toolset metadata for the inventory.
// This is used for toolsets that may not have tools registered in this build
// but should still be recognized (e.g., remote-only toolsets).
// Any metadata provided here is added to metadata derived from registered tools/resources/prompts.
// Toolsets with Default: true will be included in default toolsets even if
// no tools use them. Returns self for chaining.
func (b *Builder) SetToolsetMetadata(metadata []ToolsetMetadata) *Builder {
b.toolsetMetadata = metadata
return b
}

// WithDeprecatedAliases adds deprecated tool name aliases that map to canonical names.
// Returns self for chaining.
func (b *Builder) WithDeprecatedAliases(aliases map[string]string) *Builder {
Expand Down Expand Up @@ -248,6 +260,17 @@ func (b *Builder) processToolsets() (map[ToolsetID]bool, []string, []ToolsetID,
descriptions[p.Toolset.ID] = p.Toolset.Description
}
}
// Process standalone toolset metadata
for i := range b.toolsetMetadata {
m := &b.toolsetMetadata[i]
validIDs[m.ID] = true
if m.Default {
defaultIDs[m.ID] = true
}
if m.Description != "" {
descriptions[m.ID] = m.Description
}
}

// Build sorted slices from the collected maps
allToolsetIDs := make([]ToolsetID, 0, len(validIDs))
Expand Down