ruby_llm-mcp 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +20 -620
- data/lib/generators/ruby_llm/mcp/install_generator.rb +27 -0
- data/lib/generators/ruby_llm/mcp/templates/README.txt +32 -0
- data/lib/generators/ruby_llm/mcp/templates/initializer.rb +42 -0
- data/lib/generators/ruby_llm/mcp/templates/mcps.yml +9 -0
- data/lib/ruby_llm/mcp/client.rb +56 -2
- data/lib/ruby_llm/mcp/completion.rb +3 -2
- data/lib/ruby_llm/mcp/configuration.rb +30 -1
- data/lib/ruby_llm/mcp/coordinator.rb +30 -6
- data/lib/ruby_llm/mcp/elicitation.rb +46 -0
- data/lib/ruby_llm/mcp/errors.rb +2 -0
- data/lib/ruby_llm/mcp/prompt.rb +4 -3
- data/lib/ruby_llm/mcp/protocol.rb +34 -0
- data/lib/ruby_llm/mcp/requests/completion_prompt.rb +13 -3
- data/lib/ruby_llm/mcp/requests/completion_resource.rb +13 -3
- data/lib/ruby_llm/mcp/resource.rb +1 -2
- data/lib/ruby_llm/mcp/resource_template.rb +4 -3
- data/lib/ruby_llm/mcp/response_handler.rb +10 -1
- data/lib/ruby_llm/mcp/responses/elicitation.rb +33 -0
- data/lib/ruby_llm/mcp/result.rb +2 -1
- data/lib/ruby_llm/mcp/tool.rb +33 -5
- data/lib/ruby_llm/mcp/transports/sse.rb +69 -25
- data/lib/ruby_llm/mcp/transports/stdio.rb +2 -2
- data/lib/ruby_llm/mcp/transports/streamable_http.rb +87 -19
- data/lib/ruby_llm/mcp/transports/support/http_client.rb +28 -0
- data/lib/ruby_llm/mcp/transports/support/rate_limit.rb +47 -0
- data/lib/ruby_llm/mcp/transports/support/timeout.rb +34 -0
- data/lib/ruby_llm/mcp/version.rb +1 -1
- data/lib/ruby_llm/mcp.rb +21 -9
- data/lib/tasks/release.rake +23 -0
- metadata +28 -8
- data/lib/ruby_llm/mcp/transports/http_client.rb +0 -26
- data/lib/ruby_llm/mcp/transports/timeout.rb +0 -32
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_llm-mcp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patrick Vice
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: httpx
|
@@ -24,6 +23,20 @@ dependencies:
|
|
24
23
|
- - "~>"
|
25
24
|
- !ruby/object:Gem::Version
|
26
25
|
version: '1.4'
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: json-schema
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - "~>"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '5.0'
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '5.0'
|
27
40
|
- !ruby/object:Gem::Dependency
|
28
41
|
name: ruby_llm
|
29
42
|
requirement: !ruby/object:Gem::Requirement
|
@@ -65,6 +78,10 @@ extra_rdoc_files: []
|
|
65
78
|
files:
|
66
79
|
- LICENSE
|
67
80
|
- README.md
|
81
|
+
- lib/generators/ruby_llm/mcp/install_generator.rb
|
82
|
+
- lib/generators/ruby_llm/mcp/templates/README.txt
|
83
|
+
- lib/generators/ruby_llm/mcp/templates/initializer.rb
|
84
|
+
- lib/generators/ruby_llm/mcp/templates/mcps.yml
|
68
85
|
- lib/ruby_llm/chat.rb
|
69
86
|
- lib/ruby_llm/mcp.rb
|
70
87
|
- lib/ruby_llm/mcp/attachment.rb
|
@@ -73,6 +90,7 @@ files:
|
|
73
90
|
- lib/ruby_llm/mcp/configuration.rb
|
74
91
|
- lib/ruby_llm/mcp/content.rb
|
75
92
|
- lib/ruby_llm/mcp/coordinator.rb
|
93
|
+
- lib/ruby_llm/mcp/elicitation.rb
|
76
94
|
- lib/ruby_llm/mcp/error.rb
|
77
95
|
- lib/ruby_llm/mcp/errors.rb
|
78
96
|
- lib/ruby_llm/mcp/logging.rb
|
@@ -83,6 +101,7 @@ files:
|
|
83
101
|
- lib/ruby_llm/mcp/parameter.rb
|
84
102
|
- lib/ruby_llm/mcp/progress.rb
|
85
103
|
- lib/ruby_llm/mcp/prompt.rb
|
104
|
+
- lib/ruby_llm/mcp/protocol.rb
|
86
105
|
- lib/ruby_llm/mcp/providers/anthropic/complex_parameter_support.rb
|
87
106
|
- lib/ruby_llm/mcp/providers/gemini/complex_parameter_support.rb
|
88
107
|
- lib/ruby_llm/mcp/providers/openai/complex_parameter_support.rb
|
@@ -105,6 +124,7 @@ files:
|
|
105
124
|
- lib/ruby_llm/mcp/resource.rb
|
106
125
|
- lib/ruby_llm/mcp/resource_template.rb
|
107
126
|
- lib/ruby_llm/mcp/response_handler.rb
|
127
|
+
- lib/ruby_llm/mcp/responses/elicitation.rb
|
108
128
|
- lib/ruby_llm/mcp/responses/error.rb
|
109
129
|
- lib/ruby_llm/mcp/responses/ping.rb
|
110
130
|
- lib/ruby_llm/mcp/responses/roots_list.rb
|
@@ -115,12 +135,14 @@ files:
|
|
115
135
|
- lib/ruby_llm/mcp/server_capabilities.rb
|
116
136
|
- lib/ruby_llm/mcp/tool.rb
|
117
137
|
- lib/ruby_llm/mcp/transport.rb
|
118
|
-
- lib/ruby_llm/mcp/transports/http_client.rb
|
119
138
|
- lib/ruby_llm/mcp/transports/sse.rb
|
120
139
|
- lib/ruby_llm/mcp/transports/stdio.rb
|
121
140
|
- lib/ruby_llm/mcp/transports/streamable_http.rb
|
122
|
-
- lib/ruby_llm/mcp/transports/
|
141
|
+
- lib/ruby_llm/mcp/transports/support/http_client.rb
|
142
|
+
- lib/ruby_llm/mcp/transports/support/rate_limit.rb
|
143
|
+
- lib/ruby_llm/mcp/transports/support/timeout.rb
|
123
144
|
- lib/ruby_llm/mcp/version.rb
|
145
|
+
- lib/tasks/release.rake
|
124
146
|
homepage: https://github.com/patvice/ruby_llm-mcp
|
125
147
|
licenses:
|
126
148
|
- MIT
|
@@ -132,7 +154,6 @@ metadata:
|
|
132
154
|
bug_tracker_uri: https://github.com/patvice/ruby_llm-mcp/issues
|
133
155
|
rubygems_mfa_required: 'true'
|
134
156
|
allowed_push_host: https://rubygems.org
|
135
|
-
post_install_message:
|
136
157
|
rdoc_options: []
|
137
158
|
require_paths:
|
138
159
|
- lib
|
@@ -147,8 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
147
168
|
- !ruby/object:Gem::Version
|
148
169
|
version: '0'
|
149
170
|
requirements: []
|
150
|
-
rubygems_version: 3.
|
151
|
-
signing_key:
|
171
|
+
rubygems_version: 3.6.7
|
152
172
|
specification_version: 4
|
153
173
|
summary: A RubyLLM MCP Client
|
154
174
|
test_files: []
|
@@ -1,26 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "httpx"
|
4
|
-
|
5
|
-
module RubyLLM
|
6
|
-
module MCP
|
7
|
-
module Transports
|
8
|
-
class HTTPClient
|
9
|
-
CONNECTION_KEY = :ruby_llm_mcp_client_connection
|
10
|
-
|
11
|
-
def self.connection
|
12
|
-
Thread.current[CONNECTION_KEY] ||= build_connection
|
13
|
-
end
|
14
|
-
|
15
|
-
def self.build_connection
|
16
|
-
HTTPX.with(
|
17
|
-
pool_options: {
|
18
|
-
max_connections: RubyLLM::MCP.config.max_connections,
|
19
|
-
pool_timeout: RubyLLM::MCP.config.pool_timeout
|
20
|
-
}
|
21
|
-
)
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
@@ -1,32 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module RubyLLM
|
4
|
-
module MCP
|
5
|
-
module Transports
|
6
|
-
module Timeout
|
7
|
-
def with_timeout(seconds, request_id: nil)
|
8
|
-
result = nil
|
9
|
-
exception = nil
|
10
|
-
|
11
|
-
worker = Thread.new do
|
12
|
-
result = yield
|
13
|
-
rescue StandardError => e
|
14
|
-
exception = e
|
15
|
-
end
|
16
|
-
|
17
|
-
if worker.join(seconds)
|
18
|
-
raise exception if exception
|
19
|
-
|
20
|
-
result
|
21
|
-
else
|
22
|
-
worker.kill # stop the thread (can still have some risk if shared resources)
|
23
|
-
raise RubyLLM::MCP::Errors::TimeoutError.new(
|
24
|
-
message: "Request timed out after #{seconds} seconds",
|
25
|
-
request_id: request_id
|
26
|
-
)
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|