Class: ClaudeAgentSDK::McpServerStatus

Inherits:
Type
  • Object
show all
Defined in:
lib/claude_agent_sdk/types.rb

Overview

Status of a single MCP server connection

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Type

#[], #[]=, from_hash, #initialize, #to_h, wrap

Constructor Details

This class inherits a constructor from ClaudeAgentSDK::Type

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ClaudeAgentSDK::Type

Instance Attribute Details

#configObject

Returns the value of attribute config.



1210
1211
1212
# File 'lib/claude_agent_sdk/types.rb', line 1210

def config
  @config
end

#errorObject

Returns the value of attribute error.



1209
1210
1211
# File 'lib/claude_agent_sdk/types.rb', line 1209

def error
  @error
end

#nameObject

Returns the value of attribute name.



1209
1210
1211
# File 'lib/claude_agent_sdk/types.rb', line 1209

def name
  @name
end

#scopeObject

Returns the value of attribute scope.



1209
1210
1211
# File 'lib/claude_agent_sdk/types.rb', line 1209

def scope
  @scope
end

#server_infoObject

Returns the value of attribute server_info.



1210
1211
1212
# File 'lib/claude_agent_sdk/types.rb', line 1210

def server_info
  @server_info
end

#statusObject

Returns the value of attribute status.



1209
1210
1211
# File 'lib/claude_agent_sdk/types.rb', line 1209

def status
  @status
end

#toolsObject

Returns the value of attribute tools.



1210
1211
1212
# File 'lib/claude_agent_sdk/types.rb', line 1210

def tools
  @tools
end

Class Method Details

.parse(data) ⇒ Object

Backwards-compatible parse; normalizes camelCase ‘serverInfo` and polymorphically builds the nested `config`.



1230
1231
1232
# File 'lib/claude_agent_sdk/types.rb', line 1230

def self.parse(data)
  from_hash(data)
end

.parse_config(config) ⇒ Object



1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
# File 'lib/claude_agent_sdk/types.rb', line 1234

def self.parse_config(config)
  return nil unless config.is_a?(Hash) && config[:type]

  case config[:type]
  when 'claudeai-proxy'
    McpClaudeAIProxyServerConfig.new(url: config[:url], id: config[:id])
  when 'sdk'
    McpSdkServerConfigStatus.new(name: config[:name])
  else
    config
  end
end