ruby_llm_swarm-mcp 0.8.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.
Files changed (92) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +21 -0
  3. data/README.md +277 -0
  4. data/lib/generators/ruby_llm/mcp/install/install_generator.rb +42 -0
  5. data/lib/generators/ruby_llm/mcp/install/templates/initializer.rb +56 -0
  6. data/lib/generators/ruby_llm/mcp/install/templates/mcps.yml +29 -0
  7. data/lib/generators/ruby_llm/mcp/oauth/install_generator.rb +354 -0
  8. data/lib/generators/ruby_llm/mcp/oauth/templates/concerns/mcp_token_storage.rb.tt +114 -0
  9. data/lib/generators/ruby_llm/mcp/oauth/templates/concerns/user_mcp_oauth_concern.rb.tt +90 -0
  10. data/lib/generators/ruby_llm/mcp/oauth/templates/controllers/mcp_connections_controller.rb.tt +239 -0
  11. data/lib/generators/ruby_llm/mcp/oauth/templates/jobs/cleanup_expired_oauth_states_job.rb.tt +27 -0
  12. data/lib/generators/ruby_llm/mcp/oauth/templates/jobs/example_job.rb.tt +78 -0
  13. data/lib/generators/ruby_llm/mcp/oauth/templates/lib/mcp_client.rb.tt +68 -0
  14. data/lib/generators/ruby_llm/mcp/oauth/templates/migrations/create_mcp_oauth_credentials.rb.tt +19 -0
  15. data/lib/generators/ruby_llm/mcp/oauth/templates/migrations/create_mcp_oauth_states.rb.tt +21 -0
  16. data/lib/generators/ruby_llm/mcp/oauth/templates/models/mcp_oauth_credential.rb.tt +54 -0
  17. data/lib/generators/ruby_llm/mcp/oauth/templates/models/mcp_oauth_state.rb.tt +30 -0
  18. data/lib/generators/ruby_llm/mcp/oauth/templates/views/index.html.erb +646 -0
  19. data/lib/generators/ruby_llm/mcp/oauth/templates/views/show.html.erb +560 -0
  20. data/lib/ruby_llm/chat.rb +34 -0
  21. data/lib/ruby_llm/mcp/adapters/base_adapter.rb +179 -0
  22. data/lib/ruby_llm/mcp/adapters/mcp_sdk_adapter.rb +292 -0
  23. data/lib/ruby_llm/mcp/adapters/mcp_transports/coordinator_stub.rb +33 -0
  24. data/lib/ruby_llm/mcp/adapters/mcp_transports/sse.rb +52 -0
  25. data/lib/ruby_llm/mcp/adapters/mcp_transports/stdio.rb +52 -0
  26. data/lib/ruby_llm/mcp/adapters/mcp_transports/streamable_http.rb +86 -0
  27. data/lib/ruby_llm/mcp/adapters/ruby_llm_adapter.rb +92 -0
  28. data/lib/ruby_llm/mcp/attachment.rb +18 -0
  29. data/lib/ruby_llm/mcp/auth/browser/callback_handler.rb +71 -0
  30. data/lib/ruby_llm/mcp/auth/browser/callback_server.rb +30 -0
  31. data/lib/ruby_llm/mcp/auth/browser/http_server.rb +112 -0
  32. data/lib/ruby_llm/mcp/auth/browser/opener.rb +39 -0
  33. data/lib/ruby_llm/mcp/auth/browser/pages.rb +607 -0
  34. data/lib/ruby_llm/mcp/auth/browser_oauth_provider.rb +280 -0
  35. data/lib/ruby_llm/mcp/auth/client_registrar.rb +170 -0
  36. data/lib/ruby_llm/mcp/auth/discoverer.rb +124 -0
  37. data/lib/ruby_llm/mcp/auth/flows/authorization_code_flow.rb +105 -0
  38. data/lib/ruby_llm/mcp/auth/flows/client_credentials_flow.rb +66 -0
  39. data/lib/ruby_llm/mcp/auth/grant_strategies/authorization_code.rb +31 -0
  40. data/lib/ruby_llm/mcp/auth/grant_strategies/base.rb +31 -0
  41. data/lib/ruby_llm/mcp/auth/grant_strategies/client_credentials.rb +31 -0
  42. data/lib/ruby_llm/mcp/auth/http_response_handler.rb +63 -0
  43. data/lib/ruby_llm/mcp/auth/memory_storage.rb +90 -0
  44. data/lib/ruby_llm/mcp/auth/oauth_provider.rb +305 -0
  45. data/lib/ruby_llm/mcp/auth/security.rb +44 -0
  46. data/lib/ruby_llm/mcp/auth/session_manager.rb +54 -0
  47. data/lib/ruby_llm/mcp/auth/token_manager.rb +236 -0
  48. data/lib/ruby_llm/mcp/auth/transport_oauth_helper.rb +107 -0
  49. data/lib/ruby_llm/mcp/auth/url_builder.rb +76 -0
  50. data/lib/ruby_llm/mcp/auth.rb +359 -0
  51. data/lib/ruby_llm/mcp/client.rb +401 -0
  52. data/lib/ruby_llm/mcp/completion.rb +16 -0
  53. data/lib/ruby_llm/mcp/configuration.rb +310 -0
  54. data/lib/ruby_llm/mcp/content.rb +28 -0
  55. data/lib/ruby_llm/mcp/elicitation.rb +48 -0
  56. data/lib/ruby_llm/mcp/error.rb +34 -0
  57. data/lib/ruby_llm/mcp/errors.rb +91 -0
  58. data/lib/ruby_llm/mcp/logging.rb +16 -0
  59. data/lib/ruby_llm/mcp/native/cancellable_operation.rb +57 -0
  60. data/lib/ruby_llm/mcp/native/client.rb +387 -0
  61. data/lib/ruby_llm/mcp/native/json_rpc.rb +170 -0
  62. data/lib/ruby_llm/mcp/native/messages/helpers.rb +39 -0
  63. data/lib/ruby_llm/mcp/native/messages/notifications.rb +42 -0
  64. data/lib/ruby_llm/mcp/native/messages/requests.rb +206 -0
  65. data/lib/ruby_llm/mcp/native/messages/responses.rb +106 -0
  66. data/lib/ruby_llm/mcp/native/messages.rb +36 -0
  67. data/lib/ruby_llm/mcp/native/notification.rb +16 -0
  68. data/lib/ruby_llm/mcp/native/protocol.rb +36 -0
  69. data/lib/ruby_llm/mcp/native/response_handler.rb +110 -0
  70. data/lib/ruby_llm/mcp/native/transport.rb +88 -0
  71. data/lib/ruby_llm/mcp/native/transports/sse.rb +607 -0
  72. data/lib/ruby_llm/mcp/native/transports/stdio.rb +356 -0
  73. data/lib/ruby_llm/mcp/native/transports/streamable_http.rb +926 -0
  74. data/lib/ruby_llm/mcp/native/transports/support/http_client.rb +28 -0
  75. data/lib/ruby_llm/mcp/native/transports/support/rate_limit.rb +49 -0
  76. data/lib/ruby_llm/mcp/native/transports/support/timeout.rb +36 -0
  77. data/lib/ruby_llm/mcp/native.rb +12 -0
  78. data/lib/ruby_llm/mcp/notification_handler.rb +100 -0
  79. data/lib/ruby_llm/mcp/progress.rb +35 -0
  80. data/lib/ruby_llm/mcp/prompt.rb +132 -0
  81. data/lib/ruby_llm/mcp/railtie.rb +14 -0
  82. data/lib/ruby_llm/mcp/resource.rb +112 -0
  83. data/lib/ruby_llm/mcp/resource_template.rb +85 -0
  84. data/lib/ruby_llm/mcp/result.rb +108 -0
  85. data/lib/ruby_llm/mcp/roots.rb +45 -0
  86. data/lib/ruby_llm/mcp/sample.rb +152 -0
  87. data/lib/ruby_llm/mcp/server_capabilities.rb +49 -0
  88. data/lib/ruby_llm/mcp/tool.rb +228 -0
  89. data/lib/ruby_llm/mcp/version.rb +7 -0
  90. data/lib/ruby_llm/mcp.rb +125 -0
  91. data/lib/tasks/release.rake +23 -0
  92. metadata +184 -0
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ namespace :release do
4
+ desc "Release a new version of the gem"
5
+ task :version do
6
+ # Load the current version from version.rb
7
+ require_relative "../../lib/ruby_llm/mcp/version"
8
+ version = RubyLLM::MCP::VERSION
9
+
10
+ puts "Releasing version #{version}..."
11
+
12
+ # Make sure we are on the main branch
13
+ system "git checkout main"
14
+ system "git pull origin main"
15
+
16
+ # Create a new tag for the version
17
+ system "git tag -a v#{version} -m 'Release version #{version}'"
18
+ system "git push origin v#{version}"
19
+
20
+ system "gem build ruby_llm-mcp.gemspec"
21
+ system "gem push ruby_llm-mcp-#{version}.gem"
22
+ end
23
+ end
metadata ADDED
@@ -0,0 +1,184 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ruby_llm_swarm-mcp
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.8.0
5
+ platform: ruby
6
+ authors:
7
+ - Patrick Vice
8
+ bindir: bin
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: httpx
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - "~>"
17
+ - !ruby/object:Gem::Version
18
+ version: '1.4'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - "~>"
24
+ - !ruby/object:Gem::Version
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'
40
+ - !ruby/object:Gem::Dependency
41
+ name: zeitwerk
42
+ requirement: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '2'
47
+ type: :runtime
48
+ prerelease: false
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '2'
54
+ description: |
55
+ A Ruby client for the Model Context Protocol (MCP) that seamlessly integrates with RubyLLM.
56
+ Supports both native full-featured implementation and the official mcp-sdk gem.
57
+ Connect to MCP servers via SSE, stdio, or HTTP transports, automatically convert MCP tools into
58
+ RubyLLM-compatible tools, and enable AI models to interact with external data sources and
59
+ services. Makes using MCP with RubyLLM as easy as possible.
60
+ email:
61
+ - patrickgvice@gmail.com
62
+ executables: []
63
+ extensions: []
64
+ extra_rdoc_files: []
65
+ files:
66
+ - LICENSE
67
+ - README.md
68
+ - lib/generators/ruby_llm/mcp/install/install_generator.rb
69
+ - lib/generators/ruby_llm/mcp/install/templates/initializer.rb
70
+ - lib/generators/ruby_llm/mcp/install/templates/mcps.yml
71
+ - lib/generators/ruby_llm/mcp/oauth/install_generator.rb
72
+ - lib/generators/ruby_llm/mcp/oauth/templates/concerns/mcp_token_storage.rb.tt
73
+ - lib/generators/ruby_llm/mcp/oauth/templates/concerns/user_mcp_oauth_concern.rb.tt
74
+ - lib/generators/ruby_llm/mcp/oauth/templates/controllers/mcp_connections_controller.rb.tt
75
+ - lib/generators/ruby_llm/mcp/oauth/templates/jobs/cleanup_expired_oauth_states_job.rb.tt
76
+ - lib/generators/ruby_llm/mcp/oauth/templates/jobs/example_job.rb.tt
77
+ - lib/generators/ruby_llm/mcp/oauth/templates/lib/mcp_client.rb.tt
78
+ - lib/generators/ruby_llm/mcp/oauth/templates/migrations/create_mcp_oauth_credentials.rb.tt
79
+ - lib/generators/ruby_llm/mcp/oauth/templates/migrations/create_mcp_oauth_states.rb.tt
80
+ - lib/generators/ruby_llm/mcp/oauth/templates/models/mcp_oauth_credential.rb.tt
81
+ - lib/generators/ruby_llm/mcp/oauth/templates/models/mcp_oauth_state.rb.tt
82
+ - lib/generators/ruby_llm/mcp/oauth/templates/views/index.html.erb
83
+ - lib/generators/ruby_llm/mcp/oauth/templates/views/show.html.erb
84
+ - lib/ruby_llm/chat.rb
85
+ - lib/ruby_llm/mcp.rb
86
+ - lib/ruby_llm/mcp/adapters/base_adapter.rb
87
+ - lib/ruby_llm/mcp/adapters/mcp_sdk_adapter.rb
88
+ - lib/ruby_llm/mcp/adapters/mcp_transports/coordinator_stub.rb
89
+ - lib/ruby_llm/mcp/adapters/mcp_transports/sse.rb
90
+ - lib/ruby_llm/mcp/adapters/mcp_transports/stdio.rb
91
+ - lib/ruby_llm/mcp/adapters/mcp_transports/streamable_http.rb
92
+ - lib/ruby_llm/mcp/adapters/ruby_llm_adapter.rb
93
+ - lib/ruby_llm/mcp/attachment.rb
94
+ - lib/ruby_llm/mcp/auth.rb
95
+ - lib/ruby_llm/mcp/auth/browser/callback_handler.rb
96
+ - lib/ruby_llm/mcp/auth/browser/callback_server.rb
97
+ - lib/ruby_llm/mcp/auth/browser/http_server.rb
98
+ - lib/ruby_llm/mcp/auth/browser/opener.rb
99
+ - lib/ruby_llm/mcp/auth/browser/pages.rb
100
+ - lib/ruby_llm/mcp/auth/browser_oauth_provider.rb
101
+ - lib/ruby_llm/mcp/auth/client_registrar.rb
102
+ - lib/ruby_llm/mcp/auth/discoverer.rb
103
+ - lib/ruby_llm/mcp/auth/flows/authorization_code_flow.rb
104
+ - lib/ruby_llm/mcp/auth/flows/client_credentials_flow.rb
105
+ - lib/ruby_llm/mcp/auth/grant_strategies/authorization_code.rb
106
+ - lib/ruby_llm/mcp/auth/grant_strategies/base.rb
107
+ - lib/ruby_llm/mcp/auth/grant_strategies/client_credentials.rb
108
+ - lib/ruby_llm/mcp/auth/http_response_handler.rb
109
+ - lib/ruby_llm/mcp/auth/memory_storage.rb
110
+ - lib/ruby_llm/mcp/auth/oauth_provider.rb
111
+ - lib/ruby_llm/mcp/auth/security.rb
112
+ - lib/ruby_llm/mcp/auth/session_manager.rb
113
+ - lib/ruby_llm/mcp/auth/token_manager.rb
114
+ - lib/ruby_llm/mcp/auth/transport_oauth_helper.rb
115
+ - lib/ruby_llm/mcp/auth/url_builder.rb
116
+ - lib/ruby_llm/mcp/client.rb
117
+ - lib/ruby_llm/mcp/completion.rb
118
+ - lib/ruby_llm/mcp/configuration.rb
119
+ - lib/ruby_llm/mcp/content.rb
120
+ - lib/ruby_llm/mcp/elicitation.rb
121
+ - lib/ruby_llm/mcp/error.rb
122
+ - lib/ruby_llm/mcp/errors.rb
123
+ - lib/ruby_llm/mcp/logging.rb
124
+ - lib/ruby_llm/mcp/native.rb
125
+ - lib/ruby_llm/mcp/native/cancellable_operation.rb
126
+ - lib/ruby_llm/mcp/native/client.rb
127
+ - lib/ruby_llm/mcp/native/json_rpc.rb
128
+ - lib/ruby_llm/mcp/native/messages.rb
129
+ - lib/ruby_llm/mcp/native/messages/helpers.rb
130
+ - lib/ruby_llm/mcp/native/messages/notifications.rb
131
+ - lib/ruby_llm/mcp/native/messages/requests.rb
132
+ - lib/ruby_llm/mcp/native/messages/responses.rb
133
+ - lib/ruby_llm/mcp/native/notification.rb
134
+ - lib/ruby_llm/mcp/native/protocol.rb
135
+ - lib/ruby_llm/mcp/native/response_handler.rb
136
+ - lib/ruby_llm/mcp/native/transport.rb
137
+ - lib/ruby_llm/mcp/native/transports/sse.rb
138
+ - lib/ruby_llm/mcp/native/transports/stdio.rb
139
+ - lib/ruby_llm/mcp/native/transports/streamable_http.rb
140
+ - lib/ruby_llm/mcp/native/transports/support/http_client.rb
141
+ - lib/ruby_llm/mcp/native/transports/support/rate_limit.rb
142
+ - lib/ruby_llm/mcp/native/transports/support/timeout.rb
143
+ - lib/ruby_llm/mcp/notification_handler.rb
144
+ - lib/ruby_llm/mcp/progress.rb
145
+ - lib/ruby_llm/mcp/prompt.rb
146
+ - lib/ruby_llm/mcp/railtie.rb
147
+ - lib/ruby_llm/mcp/resource.rb
148
+ - lib/ruby_llm/mcp/resource_template.rb
149
+ - lib/ruby_llm/mcp/result.rb
150
+ - lib/ruby_llm/mcp/roots.rb
151
+ - lib/ruby_llm/mcp/sample.rb
152
+ - lib/ruby_llm/mcp/server_capabilities.rb
153
+ - lib/ruby_llm/mcp/tool.rb
154
+ - lib/ruby_llm/mcp/version.rb
155
+ - lib/tasks/release.rake
156
+ homepage: https://www.rubyllm-mcp.com
157
+ licenses:
158
+ - MIT
159
+ metadata:
160
+ homepage_uri: https://www.rubyllm-mcp.com
161
+ source_code_uri: https://github.com/parruda/ruby_llm-mcp
162
+ changelog_uri: https://github.com/parruda/ruby_llm-mcp/commits/main
163
+ documentation_uri: https://www.rubyllm-mcp.com/guides/
164
+ bug_tracker_uri: https://github.com/parruda/ruby_llm-mcp/issues
165
+ rubygems_mfa_required: 'true'
166
+ allowed_push_host: https://rubygems.org
167
+ rdoc_options: []
168
+ require_paths:
169
+ - lib
170
+ required_ruby_version: !ruby/object:Gem::Requirement
171
+ requirements:
172
+ - - ">="
173
+ - !ruby/object:Gem::Version
174
+ version: 3.1.3
175
+ required_rubygems_version: !ruby/object:Gem::Requirement
176
+ requirements:
177
+ - - ">="
178
+ - !ruby/object:Gem::Version
179
+ version: '0'
180
+ requirements: []
181
+ rubygems_version: 3.6.9
182
+ specification_version: 4
183
+ summary: A RubyLLM MCP Client
184
+ test_files: []