Module: AIA::McpParser
- Defined in:
- lib/aia/config/mcp_parser.rb
Class Method Summary collapse
-
.parse_files(file_paths) ⇒ Array<Hash>
Parse MCP server configuration files and return array of server configs.
Class Method Details
.parse_files(file_paths) ⇒ Array<Hash>
Parse MCP server configuration files and return array of server configs
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/aia/config/mcp_parser.rb', line 37 def parse_files(file_paths) return [] if file_paths.nil? || file_paths.empty? servers = [] file_paths.each do |file_path| = File.(file_path) unless File.exist?() warn "Warning: MCP config file not found: #{file_path}" next end begin json_content = File.read() parsed = JSON.parse(json_content) servers.concat(convert_to_config_format(parsed, file_path)) rescue JSON::ParserError => e warn "Warning: Invalid JSON in MCP config file '#{file_path}': #{e.}" rescue StandardError => e warn "Warning: Error reading MCP config file '#{file_path}': #{e.}" end end servers end |