Skip to content

Conversation

tonytrg
Copy link
Contributor

@tonytrg tonytrg commented Sep 30, 2025

Summary

This PR introduces a data-driven default toolset configuration to improve performance, reduce inference costs, and provide a better out-of-the-box experience for GitHub MCP Server users.

Problem

The current "all tools enabled by default" approach causes several issues:

  • Excessive context: 102 tools consuming 64.6k tokens by default
  • Tool selection degradation: LLMs struggle with too many tool options
  • Higher inference costs: Large context windows increase computational expenses
  • User feedback: Most users don't customize toolsets and experience performance issues

Changes

New Default Toolsets (Data-Driven Selection)

Based on real-world usage analysis across all sessions, the new default includes the 5 most-used toolset groups:

  • context - Current user and GitHub context
  • repos - Repository operations
  • issues - Issue tracking
  • pull_requests - PR workflows
  • users - User information

These cover almost all top 20 most frequently used tools.

Code Changes

  1. pkg/github/tools.go:

    • Added ToolsetMetadata struct to hold toolset ID and description
    • Created metadata constants for all toolsets
    • Implemented GetDefaultToolsetIDs() to return curated default list
    • Added GenerateToolsetsHelp() for improved CLI help text
    • Moved stargazer tools from repos to new dedicated stargazers toolset
  2. cmd/github-mcp-server/main.go:

    • Updated default flag behavior to use GetDefaultToolsetIDs() when no toolsets specified
    • Improved help text with GenerateToolsetsHelp()
  3. README.md:

    • Added prominent default toolset configuration section
    • Reorganized toolset documentation for better discoverability
    • Added stargazers toolset to available toolsets table
  4. docs/remote-server.md:

    • Added stargazers toolset to remote server documentation

Performance Improvements compared to old default("all")

Token Reduction

  • Before: 102 tools, 64.6k tokens
  • After: 52 tools, 30.3k tokens
  • Savings: 53% reduction in token usage

User Experience Benefits

  • ✅ Faster LLM responses with smaller context windows
  • ✅ More accurate tool selection from focused set
  • ✅ Lower inference costs
  • ✅ Better out-of-the-box behavior for common workflows

Future Work

  • Split large toolsets (repos, pull_requests) into more specialized subgroups

Testing

  • Verified default toolsets load correctly when no --toolsets flag provided
  • Confirmed --toolsets all still enables all toolsets
  • Validated custom toolset combinations work as expected
  • Checked README and documentation updates render correctly

@tonytrg tonytrg requested a review from a team as a code owner September 30, 2025 10:47
@Copilot Copilot AI review requested due to automatic review settings September 30, 2025 10:47
Copy link
Contributor

@Copilot 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 PR introduces a new "stargazers" toolset grouping by moving stargazer-related tools from the repositories toolset into their own dedicated group, and updates the default tools list to include specific toolsets instead of "all".

  • Moved stargazer tools (list_starred_repositories, star_repository, unstar_repository) from repositories to a new dedicated stargazers toolset
  • Updated DefaultTools to explicitly list toolsets: "context", "repos", "issues", "pull_requests", "users" instead of using "all"
  • Added documentation entries for the new stargazers toolset in both remote server documentation and README

Reviewed Changes

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

File Description
pkg/github/tools.go Creates new stargazers toolset and moves stargazer tools from repositories toolset, updates DefaultTools list
docs/remote-server.md Adds stargazers toolset entry to the remote server toolsets table
README.md Moves stargazer tool documentation from repositories section to new stargazers section and updates toolsets list

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@tonytrg tonytrg marked this pull request as draft September 30, 2025 19:22
@tonytrg tonytrg marked this pull request as ready for review October 1, 2025 08:02
}
ToolsetMetadataDynamic = ToolsetMetadata{
ID: "dynamic",
Description: "Discover GitHub MCP tools that can help achieve tasks by enabling additional sets of tools, you can control the enablement of any toolset to access its tools when this toolset is enabled.",
Copy link
Contributor

Choose a reason for hiding this comment

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

shall we include this in the default? This would allow agent to see what tools are available and prompt to enable them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm right now its turned off i need to test it a bit better to make a judgement

@tonytrg tonytrg merged commit bf0d62e into main Oct 6, 2025
16 checks passed
@tonytrg tonytrg deleted the tonytrg/default-toolsetgrouping branch October 6, 2025 15:07
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.

3 participants