fix(config, mcp): Configuration inheritance for servers and tools#216
Merged
fix(config, mcp): Configuration inheritance for servers and tools#216
Conversation
MCP server and tool configurations now properly merge specific settings with global defaults instead of using simple fallback behavior. When a specific server or tool configuration differs from the global defaults, only the differing fields are overridden while preserving other default values. This ensures that configurations like `servers.embedded.tools.*` with `run=ask` and `servers.embedded.tools.github_issues` with `run=always` work correctly, allowing the `github_issues` tool to run without prompting while other tools still ask for permission. The `get_server_with_defaults` and `get_tool_with_defaults` methods now compare each configuration field individually against the defaults and construct new configuration objects that properly inherit from global settings. This replaces the previous approach which would entirely fall back to defaults when no exact match was found, ignoring partial overrides. Fixes #201 Signed-off-by: Jean Mertz <git@jeanmertz.com>
Collaborator
Author
|
NOTE: this still needs tests, which I'll get to tomorrow, before merging this PR. |
Signed-off-by: Jean Mertz <git@jeanmertz.com>
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.
MCP server and tool configurations now properly merge specific settings with global defaults instead of using simple fallback behavior. When a specific server or tool configuration differs from the global defaults, only the differing fields are overridden while preserving other default values. This ensures that configurations like
servers.embedded.tools.*withrun=askandservers.embedded.tools.github_issueswithrun=alwayswork correctly, allowing thegithub_issuestool to run without prompting while other tools still ask for permission.The
get_server_with_defaultsandget_tool_with_defaultsmethods now compare each configuration field individually against the defaults and construct new configuration objects that properly inherit from global settings. This replaces the previous approach which would entirely fall back to defaults when no exact match was found, ignoring partial overrides.Fixes: #201