Class: SchwabMCP::Server

Inherits:
Object
  • Object
show all
Includes:
Loggable
Defined in:
lib/schwab_mcp.rb

Instance Method Summary collapse

Methods included from Loggable

#log_debug, #log_error, #log_fatal, #log_info, #log_warn, #logger

Constructor Details

#initializeServer

Returns a new instance of Server.



54
55
56
57
58
59
60
61
62
63
# File 'lib/schwab_mcp.rb', line 54

def initialize
  configure_schwab_rb

  @server = MCP::Server.new(
    name: "schwab_mcp_server",
    version: SchwabMCP::VERSION,
    tools: TOOLS,
    server_context: { user: "foobar" }
  )
end

Instance Method Details

#startObject



65
66
67
68
69
70
71
72
# File 'lib/schwab_mcp.rb', line 65

def start
  configure_mcp
  log_info("Starting Schwab MCP Server #{SchwabMCP::VERSION}")
  log_info("Available tools: #{TOOLS.map { |tool| tool.name.split('::').last }.join(', ')}")
  log_info("Logs will be written to: #{log_file_path}")
  transport = MCP::Transports::StdioTransport.new(@server)
  transport.open
end