feat(config, mcp)!: Implement nested inheritance for MCP config#218
Merged
feat(config, mcp)!: Implement nested inheritance for MCP config#218
Conversation
The previous MCP configuration resolution was based on a simple, two-level inheritance model that was evaluated at runtime using getter methods. This approach was brittle and led to complex consumer code. This commit refactors the configuration loading to use a more robust, multi-level inheritance model implemented within the `with_fallback` logic of the partial configuration structs. This centralizes resolution logic, making it more predictable and simplifying consuming code, as the final `Config` struct is always fully resolved. `Tool` configurations now inherit settings through multiple layers of specificity, from a specific tool on a specific server to global tool settings on a global server. BREAKING CHANGE: The inheritance and resolution logic for MCP server and tool configurations has been completely overhauled. The previous model used a simple fallback from a specific server/tool configuration to a global (*) one. The new model implements a more complex, multi-level inheritance system that correctly merges configurations from different sources (e.g., user config and default config). Users should review their configurations to ensure they are compatible with the new, more predictable inheritance rules. This may allow for simplification of existing configurations. Signed-off-by: Jean Mertz <git@jeanmertz.com>
JeanMertz
added a commit
that referenced
this pull request
Jul 23, 2025
This commit refactors the tool execution configuration to enhance security by defaulting to user confirmation before running a tool. The global run policy is changed from `always` to `ask`. To maintain a smooth user experience for safe, read-only operations, servers like `embedded`, `bookworm`, and `kagi` are configured to run their tools automatically. However, potentially destructive file system tools like `fs_modify_file` and `fs_create_file` are explicitly configured to require user confirmation, overriding the server-level settings and aligning with the new safer default. This change also simplifies the configuration file by removing redundant entries, which are no longer needed since the recent inheritance refactor merged in #218. Signed-off-by: Jean Mertz <git@jeanmertz.com>
JeanMertz
added a commit
that referenced
this pull request
Jul 23, 2025
) This commit refactors the tool execution configuration to enhance security by defaulting to user confirmation before running a tool. The global run policy is changed from `always` to `ask`. To maintain a smooth user experience for safe, read-only operations, servers like `embedded`, `bookworm`, and `kagi` are configured to run their tools automatically. However, potentially destructive file system tools like `fs_modify_file` and `fs_create_file` are explicitly configured to require user confirmation, overriding the server-level settings and aligning with the new safer default. This change also simplifies the configuration file by removing redundant entries, which are no longer needed since the recent inheritance refactor merged in #218. 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.
The previous MCP configuration resolution was based on a simple, two-level inheritance model that was evaluated at runtime using getter methods. This approach was brittle and led to complex consumer code.
This commit refactors the configuration loading to use a more robust, multi-level inheritance model implemented within the
with_fallbacklogic of the partial configuration structs. This centralizes resolution logic, making it more predictable and simplifying consuming code, as the finalConfigstruct is always fully resolved.Toolconfigurations now inherit settings through multiple layers of specificity, from a specific tool on a specific server to global tool settings on a global server.BREAKING CHANGE: The inheritance and resolution logic for MCP server and tool configurations has been completely overhauled.
The previous model used a simple fallback from a specific server/tool configuration to a global (*) one. The new model implements a more complex, multi-level inheritance system that correctly merges configurations from different sources (e.g., user config and default config).
Users should review their configurations to ensure they are compatible with the new, more predictable inheritance rules. This may allow for simplification of existing configurations.