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.



1288
1289
1290
# File 'lib/claude_agent_sdk/types.rb', line 1288

def config
  @config
end

#errorObject

Returns the value of attribute error.



1287
1288
1289
# File 'lib/claude_agent_sdk/types.rb', line 1287

def error
  @error
end

#nameObject

Returns the value of attribute name.



1287
1288
1289
# File 'lib/claude_agent_sdk/types.rb', line 1287

def name
  @name
end

#scopeObject

Returns the value of attribute scope.



1287
1288
1289
# File 'lib/claude_agent_sdk/types.rb', line 1287

def scope
  @scope
end

#server_infoObject

Returns the value of attribute server_info.



1288
1289
1290
# File 'lib/claude_agent_sdk/types.rb', line 1288

def server_info
  @server_info
end

#statusObject

Returns the value of attribute status.



1287
1288
1289
# File 'lib/claude_agent_sdk/types.rb', line 1287

def status
  @status
end

#toolsObject

Returns the value of attribute tools.



1288
1289
1290
# File 'lib/claude_agent_sdk/types.rb', line 1288

def tools
  @tools
end

Class Method Details

.parse(data) ⇒ Object

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



1308
1309
1310
# File 'lib/claude_agent_sdk/types.rb', line 1308

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

.parse_config(config) ⇒ Object



1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
# File 'lib/claude_agent_sdk/types.rb', line 1312

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