Class: ClaudeAgentSDK::McpStdioServerConfig

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

Overview

MCP Server configurations

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command:, args: nil, env: nil, type: 'stdio') ⇒ McpStdioServerConfig

Returns a new instance of McpStdioServerConfig.



1537
1538
1539
1540
1541
1542
# File 'lib/claude_agent_sdk/types.rb', line 1537

def initialize(command:, args: nil, env: nil, type: 'stdio')
  @type = type
  @command = command
  @args = args
  @env = env
end

Instance Attribute Details

#argsObject

Returns the value of attribute args.



1535
1536
1537
# File 'lib/claude_agent_sdk/types.rb', line 1535

def args
  @args
end

#commandObject

Returns the value of attribute command.



1535
1536
1537
# File 'lib/claude_agent_sdk/types.rb', line 1535

def command
  @command
end

#envObject

Returns the value of attribute env.



1535
1536
1537
# File 'lib/claude_agent_sdk/types.rb', line 1535

def env
  @env
end

#typeObject

Returns the value of attribute type.



1535
1536
1537
# File 'lib/claude_agent_sdk/types.rb', line 1535

def type
  @type
end

Instance Method Details

#to_hObject



1544
1545
1546
1547
1548
1549
# File 'lib/claude_agent_sdk/types.rb', line 1544

def to_h
  result = { type: @type, command: @command }
  result[:args] = @args if @args
  result[:env] = @env if @env
  result
end