Skip to content
Merged
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())
}
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
}
}
Comment on lines +263 to +273
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new functionality to process standalone toolset metadata lacks dedicated unit test coverage in pkg/inventory/registry_test.go. While integration testing via pkg/github/tools_test.go verifies that copilot appears in defaults, there should be direct tests for SetToolsetMetadata() that verify: (1) standalone metadata with Default: true adds to default toolsets, (2) standalone metadata without tools still appears in available toolsets, (3) standalone metadata descriptions are properly stored, and (4) interaction with tool-based metadata (e.g., no conflicts when both exist).

Copilot uses AI. Check for mistakes.

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