class RubyLLM::MCP::Collection
The MCP servers connected to a chat, readable by name.
chat.with_mcp(Linear.new(user: current_user)) chat.mcp.linear # => #<Linear ...> chat.mcp[:linear] # => #<Linear ...> chat.mcp.map(&:name) # => ["linear"]
Public Instance Methods
Source
# File lib/ruby_llm/mcp/collection.rb, line 25 def [](name) @servers[name.to_sym] end
Returns the server named name, or nil.
Source
# File lib/ruby_llm/mcp/collection.rb, line 30 def each(&) @servers.each_value(&) end
Yields each server.
Source
# File lib/ruby_llm/mcp/collection.rb, line 35 def empty? @servers.empty? end
Returns whether no servers are connected.