feat: support standalone toolset metadata for default expansion#1824
feat: support standalone toolset metadata for default expansion#1824SamMorrowDrums merged 3 commits intocopilot-toolset-defaultfrom
Conversation
- 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>
There was a problem hiding this comment.
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 viaNewInventory() - Updated test expectations to include
copilotin 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) |
| // 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 | ||
| } | ||
| } |
There was a problem hiding this comment.
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).
Summary
Enables toolset metadata with
Default: trueto control default toolsets even when no tools use that toolset in the OSS build (e.g., remote-only toolsets likecopilot).Why
The remote server needs
copilottoolset tools enabled by default, but the previous approach of settingDefault: trueon metadata didn't work becauseprocessToolsets()only examined actual tools, not standalone metadata.Closes github/github-mcp-server-remote#619
What changed
SetToolsetMetadata()to inventory Builder for registering standalone toolset metadataprocessToolsets()to include standalone metadata when building default toolsets listcopilot,copilot_spaces,github_support_docs_search) viaNewInventory()copilotin defaultsBefore:
After:
MCP impact
copilottoolset. Remote server benefits from declarativeDefault: trueon metadata.Security / limits
Tool renaming
Lint & tests
./script/lint./script/testDocs
💡 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.