Skip to content

Commit 4e82580

Browse files
authored
Merge pull request #60 from patvice/establish_connection-fix
Establish Connection V0.6 Fix
2 parents 89385cf + 70cc7ab commit 4e82580

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

lib/ruby_llm/mcp.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def client(...)
3434
end
3535

3636
def establish_connection(&)
37-
clients.each(&:start)
37+
clients.each_value(&:start)
3838
if block_given?
3939
begin
4040
yield clients
@@ -47,7 +47,7 @@ def establish_connection(&)
4747
end
4848

4949
def close_connection
50-
clients.each do |client|
50+
clients.each_value do |client|
5151
client.stop if client.alive?
5252
end
5353
end

lib/ruby_llm/mcp/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
module RubyLLM
44
module MCP
5-
VERSION = "0.6.0"
5+
VERSION = "0.6.1"
66
end
77
end

ruby_llm-mcp.gemspec

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
1717
services. Makes using MCP with RubyLLM as easy as possible.
1818
DESC
1919

20-
spec.homepage = "https://github.com/patvice/ruby_llm-mcp"
20+
spec.homepage = "https://www.rubyllm-mcp.com"
2121
spec.license = "MIT"
2222
spec.required_ruby_version = Gem::Requirement.new(">= 3.1.3")
2323

@@ -40,6 +40,7 @@ Gem::Specification.new do |spec|
4040
spec.add_dependency "httpx", "~> 1.4"
4141
spec.add_dependency "json-schema", "~> 5.0"
4242
spec.add_dependency "ruby_llm", "~> 1.3"
43+
spec.add_dependency "thor", "~> 1.3"
4344
spec.add_dependency "zeitwerk", "~> 2"
4445
end
4546
# rubocop:enable Metrics/BlockLength

spec/ruby_llm/mcp_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
describe "#establish_connection" do
134134
let(:client_streamable_http) { instance_double(RubyLLM::MCP::Client) }
135135
let(:client_stdio) { instance_double(RubyLLM::MCP::Client) }
136-
let(:clients) { [client_streamable_http, client_stdio] }
136+
let(:clients) { { "streamable_http" => client_streamable_http, "stdio" => client_stdio } }
137137

138138
before do
139139
allow(RubyLLM::MCP).to receive(:clients).and_return(clients)
@@ -189,7 +189,7 @@
189189
describe "#close_connection" do
190190
let(:alive_client) { instance_double(RubyLLM::MCP::Client) }
191191
let(:dead_client) { instance_double(RubyLLM::MCP::Client) }
192-
let(:clients) { [alive_client, dead_client] }
192+
let(:clients) { { "alive_client" => alive_client, "dead_client" => dead_client } }
193193

194194
before do
195195
allow(RubyLLM::MCP).to receive(:clients).and_return(clients)

0 commit comments

Comments
 (0)