-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Tommy/tool-specific-config-support #1394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…BJ4y9xY61QVrO18ymuVt4SO9nV-z2B4ckaL2f9IU/edit?tab=t.0#heading=h.ffto4e5dwzlf specifically - allow for --tools and dynamic toolset mode together - allow for --tools and --toolsets together
There was a problem hiding this 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 tool-specific configuration support via a new --tools flag, enabling users to specify individual tools instead of (or in addition to) toolsets. Users can now compose their MCP server configuration using --tools, --toolsets, --read-only, and --dynamic-toolsets flags in any combination.
Key changes:
- Added
--toolsflag for specifying individual tools by name - Implemented additive composition logic where tools and toolsets can be combined
- Maintained read-only mode enforcement (write tools are skipped even if explicitly requested)
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/toolsets/toolsets.go | Added ToolDoesNotExistError, FindToolByName method to locate tools across all toolsets, and RegisterSpecificTools method to register individual tools with read-only mode support |
| pkg/github/tools.go | Added CleanTools utility function to remove duplicates and trim whitespace from tool names |
| internal/ghmcp/server.go | Added EnabledTools field to both MCPServerConfig and StdioServerConfig, updated NewMCPServer to handle tool registration additively with toolsets |
| cmd/github-mcp-server/main.go | Added --tools flag, viper binding for the flag, and updated default toolset logic to only apply when neither tools nor toolsets are specified |
| go.mod | Marked github.com/google/go-querystring as indirect dependency |
| README.md | Added comprehensive documentation for --tools flag including examples with command line, environment variables, Docker usage, and composition patterns |
JoannaaKL
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, it would be great if you could add more tests showing different scenarios like toolsets + tools enabled, read only mode + write tools etc. ❤️
|
@JoannaaKL good shout, I have added them to the PR description! :) |
Overview
This PR adds support for tool-specific MCP configuration via a new
--toolsflag:--toolsto list which tools they would like to enable--tools,--toolsets,--read-onlyand--dynamic-toolsetsand compose them in whatever way they'd likeExample
Default toolset case: no specific config
Behavior: the "default" toolsets are enabled if no preference is expressed (e.g. --toolsets, --tools, --read-only, dynamic)
✅ working as expected (screenshots)
Standard case:
X-MCP-ToolsonlyBehavior: the tools are enabled
✅ working as expected (screenshots)
Case with both
X-MCP-ToolsandX-MCP-ToolsetsBehavior: both toolsets and tools are enabled
✅ working as expected (screenshots)
BEFORE (toolsets only)

AFTER (toolsets + tools)

Case with both
X-MCP-ToolsandreadonlyBehavior: write tools are not enabled, readonly tools are enabled
✅ working as expected (screenshots)
issue_writeis not being enabled (correct behavior)Case with both
--toolsand--dynamic-toolsets(local MCP only)Behavior: the MCP starts with the 3 dynamic toolsets (
enable_toolset,list_available_toolsets,get_toolset_tools) and the specified tools✅ working as expected (screenshots)
Case with invalid tool name
Behavior: The MCP should throw an error and require the user to use a valid tool
✅ working as expected (screenshots)