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.



1169
1170
1171
# File 'lib/claude_agent_sdk/types.rb', line 1169

def config
  @config
end

#errorObject

Returns the value of attribute error.



1168
1169
1170
# File 'lib/claude_agent_sdk/types.rb', line 1168

def error
  @error
end

#nameObject

Returns the value of attribute name.



1168
1169
1170
# File 'lib/claude_agent_sdk/types.rb', line 1168

def name
  @name
end

#scopeObject

Returns the value of attribute scope.



1168
1169
1170
# File 'lib/claude_agent_sdk/types.rb', line 1168

def scope
  @scope
end

#server_infoObject

Returns the value of attribute server_info.



1169
1170
1171
# File 'lib/claude_agent_sdk/types.rb', line 1169

def server_info
  @server_info
end

#statusObject

Returns the value of attribute status.



1168
1169
1170
# File 'lib/claude_agent_sdk/types.rb', line 1168

def status
  @status
end

#toolsObject

Returns the value of attribute tools.



1169
1170
1171
# File 'lib/claude_agent_sdk/types.rb', line 1169

def tools
  @tools
end

Class Method Details

.parse(data) ⇒ Object

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



1189
1190
1191
# File 'lib/claude_agent_sdk/types.rb', line 1189

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

.parse_config(config) ⇒ Object



1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
# File 'lib/claude_agent_sdk/types.rb', line 1193

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