Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 16, 2026

Summary

Enables toolset metadata with Default: true to control default toolsets even when no tools use that toolset in the OSS build (e.g., remote-only toolsets like copilot).

Why

The remote server needs copilot toolset tools enabled by default, but the previous approach of setting Default: true on metadata didn't work because processToolsets() only examined actual tools, not standalone metadata.

Closes github/github-mcp-server-remote#619

What changed

  • Added SetToolsetMetadata() to inventory Builder for registering standalone toolset metadata
  • Updated processToolsets() to include standalone metadata when building default toolsets list
  • Registered remote-only toolsets (copilot, copilot_spaces, github_support_docs_search) via NewInventory()
  • Updated test expectations to include copilot in defaults

Before:

// GetDefaultToolsetIDs() only found defaults from actual tools
// copilot toolset with Default: true but no tools → not in defaults

After:

// Standalone metadata is processed alongside tool metadata
inv := NewInventory(t).
    SetToolsetMetadata(RemoteOnlyToolsets()). // copilot now in defaults
    Build()

MCP impact

  • No tool or API changes - OSS users see no change since no OSS tools use copilot toolset. Remote server benefits from declarative Default: true on metadata.

Security / limits

  • No security or limits impact - Only affects which toolsets expand to when "default" keyword is used.

Tool renaming

  • I am not renaming tools as part of this PR

Lint & tests

  • Linted locally with ./script/lint
  • Tested locally with ./script/test

Docs

  • Not needed - No user-facing documentation changes required. Code comments updated.

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits January 16, 2026 11:24
- Added `toolsetMetadata` field to Builder for registering standalone toolset metadata
- Added `SetToolsetMetadata()` method to Builder for setting standalone metadata
- Updated `processToolsets()` to include standalone metadata in default toolsets
- Updated `NewInventory()` to register remote-only toolset metadata
- Updated test expectations to include `copilot` in defaults

This change enables toolset metadata with `Default: true` to control whether
tools in that toolset are included by default, even if no tools in the OSS
repo use that toolset. The remote server can now register tools in the
`copilot` toolset and they will automatically be included in defaults.

Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
- Enhanced field comment to clarify use case
- Added note about additive behavior to SetToolsetMetadata docstring

Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
Copilot AI changed the title [WIP] Set copilot toolset as default for remote server feat: support standalone toolset metadata for default expansion Jan 16, 2026
Copilot AI requested a review from SamMorrowDrums January 16, 2026 11:27
@SamMorrowDrums SamMorrowDrums marked this pull request as ready for review January 16, 2026 12:12
@SamMorrowDrums SamMorrowDrums requested a review from a team as a code owner January 16, 2026 12:12
Copilot AI review requested due to automatic review settings January 16, 2026 12:12
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request enables toolset metadata with Default: true to control default toolsets even when no tools are registered for that toolset in the OSS build. This is specifically needed for remote-only toolsets like copilot that should be default but have no tools in the local server.

Changes:

  • Added SetToolsetMetadata() method to the inventory Builder for registering standalone toolset metadata
  • Updated processToolsets() to process standalone metadata alongside tool/resource/prompt metadata when building default toolsets
  • Integrated remote-only toolsets (copilot, copilot_spaces, github_support_docs_search) into the main inventory via NewInventory()
  • Updated test expectations to include copilot in default toolsets

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

File Description
pkg/inventory/builder.go Added toolsetMetadata field and SetToolsetMetadata() method; updated processToolsets() to include standalone metadata in default toolset calculation
pkg/github/inventory.go Registered remote-only toolsets via SetToolsetMetadata() in NewInventory()
pkg/github/tools_test.go Updated test expectations to include copilot in default toolsets list
internal/ghmcp/server.go Fixed whitespace formatting (trailing spaces removed)

Comment on lines +263 to +273
// 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
}
}
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.
@SamMorrowDrums SamMorrowDrums merged commit 21a7eec into copilot-toolset-default Jan 16, 2026
19 checks passed
@SamMorrowDrums SamMorrowDrums deleted the copilot/sub-pr-1823 branch January 16, 2026 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants