Tommy/tool-specific-config-support#1394
Merged
tommaso-moro merged 19 commits intomainfrom Nov 26, 2025
Merged
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
Contributor
There was a problem hiding this comment.
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
reviewed
Nov 24, 2025
Contributor
JoannaaKL
left a comment
There was a problem hiding this comment.
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. ❤️
Contributor
Author
|
@JoannaaKL good shout, I have added them to the PR description! :) |
JoannaaKL
approved these changes
Nov 25, 2025
omgitsads
approved these changes
Nov 25, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)