Class McpConfigurationMerger

java.lang.Object
com.github.thought2code.mcp.annotated.configuration.McpConfigurationMerger

public final class McpConfigurationMerger extends Object
Utility class for merging MCP server configurations.

This class provides static methods to merge base and profile-specific MCP server configurations, where profile values take precedence over base values. The merger supports hierarchical configuration merging for complex nested objects including capabilities, change notifications, and mode-specific settings.

Author:
codeboyzhou
See Also:
  • Method Details

    • merge

      Merges base and profile MCP server configurations.

      This method performs a comprehensive merge of two configuration objects, where profile configuration values override base configuration values. The merge process handles all configuration properties including:

      • Basic server information (enabled, name, version, type, instructions)
      • Timeout and capabilities settings
      • Change notification configuration
      • Mode-specific settings (SSE or STREAMABLE)
      Parameters:
      base - the base configuration containing default values
      profile - the profile configuration containing override values
      Returns:
      a new merged McpServerConfiguration instance
      Throws:
      McpServerConfigurationException - if required configuration properties are missing