actionmcp 0.52.2 → 0.54.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 +14 -7
- data/app/controllers/action_mcp/oauth/endpoints_controller.rb +264 -0
- data/app/controllers/action_mcp/oauth/metadata_controller.rb +129 -0
- data/app/models/action_mcp/session/message.rb +12 -12
- data/app/models/action_mcp/session.rb +116 -17
- data/config/routes.rb +10 -0
- data/db/migrate/20250512154359_consolidated_migration.rb +15 -12
- data/db/migrate/20250608112101_add_oauth_to_sessions.rb +19 -0
- data/lib/action_mcp/client/oauth_client_provider/memory_storage.rb +47 -0
- data/lib/action_mcp/client/oauth_client_provider.rb +234 -0
- data/lib/action_mcp/client/streamable_http_transport.rb +25 -1
- data/lib/action_mcp/client.rb +15 -2
- data/lib/action_mcp/configuration.rb +65 -6
- data/lib/action_mcp/engine.rb +8 -0
- data/lib/action_mcp/gateway.rb +95 -6
- data/lib/action_mcp/oauth/error.rb +79 -0
- data/lib/action_mcp/oauth/memory_storage.rb +112 -0
- data/lib/action_mcp/oauth/middleware.rb +100 -0
- data/lib/action_mcp/oauth/provider.rb +390 -0
- data/lib/action_mcp/omniauth/mcp_strategy.rb +176 -0
- data/lib/action_mcp/version.rb +1 -1
- data/lib/action_mcp.rb +6 -1
- data/lib/generators/action_mcp/install/install_generator.rb +32 -1
- data/lib/generators/action_mcp/install/templates/mcp.yml +96 -19
- metadata +81 -3
- data/lib/generators/action_mcp/config/config_generator.rb +0 -28
- data/lib/generators/action_mcp/config/templates/mcp.yml +0 -36
@@ -1,21 +1,98 @@
|
|
1
|
+
# ActionMCP Configuration
|
2
|
+
# This file contains configuration for the ActionMCP server including
|
3
|
+
# authentication, profiles, and pub/sub system settings.
|
4
|
+
|
1
5
|
shared:
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
6
|
+
# Authentication configuration - array of methods to try in order
|
7
|
+
authentication: ["none"] # No authentication required by default
|
8
|
+
|
9
|
+
# OAuth configuration (if using OAuth authentication)
|
10
|
+
# oauth:
|
11
|
+
# provider: "demo_oauth_provider"
|
12
|
+
# scopes_supported: ["mcp:tools", "mcp:resources", "mcp:prompts"]
|
13
|
+
# enable_dynamic_registration: true
|
14
|
+
# enable_token_revocation: true
|
15
|
+
# pkce_required: true
|
16
|
+
# issuer_url: <%= ENV.fetch("OAUTH_ISSUER_URL") { "https://yourapp.com" } %>
|
17
|
+
|
18
|
+
# MCP capability profiles
|
19
|
+
profiles:
|
20
|
+
primary:
|
21
|
+
tools:
|
22
|
+
- all
|
23
|
+
prompts:
|
24
|
+
- all
|
25
|
+
resources:
|
26
|
+
- all
|
27
|
+
options:
|
28
|
+
list_changed: false
|
29
|
+
logging_enabled: true
|
30
|
+
resources_subscribe: false
|
31
|
+
|
32
|
+
minimal:
|
33
|
+
tools: []
|
34
|
+
prompts: []
|
35
|
+
resources: []
|
36
|
+
options:
|
37
|
+
list_changed: false
|
38
|
+
logging_enabled: false
|
39
|
+
logging_level: :warn
|
40
|
+
resources_subscribe: false
|
41
|
+
|
42
|
+
# Development environment
|
43
|
+
development:
|
44
|
+
# Use simple pub/sub adapter for development
|
45
|
+
adapter: simple
|
46
|
+
# Thread pool configuration (optional)
|
47
|
+
# min_threads: 5 # Minimum number of threads in the pool
|
48
|
+
# max_threads: 10 # Maximum number of threads in the pool
|
49
|
+
# max_queue: 100 # Maximum number of tasks that can be queued
|
50
|
+
|
51
|
+
# Test environment
|
52
|
+
test:
|
53
|
+
# JWT authentication for testing environment
|
54
|
+
authentication: ["jwt"]
|
55
|
+
|
56
|
+
# Test adapter for testing
|
57
|
+
adapter: test
|
58
|
+
|
59
|
+
# Production environment
|
60
|
+
production:
|
61
|
+
# Multiple authentication methods - try OAuth first, fallback to JWT
|
62
|
+
authentication: ["oauth", "jwt"]
|
63
|
+
|
64
|
+
# OAuth configuration for production
|
65
|
+
oauth:
|
66
|
+
provider: "application_oauth_provider" # Your custom provider class
|
67
|
+
scopes_supported: ["mcp:tools", "mcp:resources", "mcp:prompts"]
|
68
|
+
enable_dynamic_registration: true
|
69
|
+
enable_token_revocation: true
|
70
|
+
pkce_required: true
|
71
|
+
issuer_url: <%= ENV.fetch("OAUTH_ISSUER_URL") { "https://yourapp.com" } %>
|
72
|
+
|
73
|
+
# Additional production profiles for external clients
|
74
|
+
profiles:
|
75
|
+
external_clients:
|
76
|
+
tools: ["WeatherForecastTool"] # Limited tool access for external clients
|
77
|
+
prompts: []
|
78
|
+
resources: []
|
79
|
+
|
80
|
+
# Choose one of the following adapters:
|
81
|
+
|
82
|
+
# 1. Database-backed adapter (recommended)
|
83
|
+
adapter: solid_cable
|
84
|
+
polling_interval: 0.5.seconds
|
85
|
+
# connects_to: cable # Optional: specify a different database connection
|
86
|
+
|
87
|
+
# Thread pool configuration (optional)
|
88
|
+
min_threads: 10 # Minimum number of threads in the pool
|
89
|
+
max_threads: 20 # Maximum number of threads in the pool
|
90
|
+
max_queue: 500 # Maximum number of tasks that can be queued
|
12
91
|
|
13
|
-
#
|
14
|
-
#
|
15
|
-
#
|
16
|
-
#
|
17
|
-
#
|
18
|
-
#
|
19
|
-
#
|
20
|
-
# logging_level: :warn
|
21
|
-
# resources_subscribe: false
|
92
|
+
# 2. Redis-backed adapter (alternative)
|
93
|
+
# adapter: redis
|
94
|
+
# url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
|
95
|
+
# channel_prefix: <%= Rails.application.class.module_parent_name.underscore %>_production
|
96
|
+
# min_threads: 10 # Minimum number of threads in the pool
|
97
|
+
# max_threads: 20 # Maximum number of threads in the pool
|
98
|
+
# max_queue: 500 # Maximum number of tasks that can be queued
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: actionmcp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.54.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Abdelkader Boudih
|
@@ -107,6 +107,76 @@ dependencies:
|
|
107
107
|
- - "~>"
|
108
108
|
- !ruby/object:Gem::Version
|
109
109
|
version: '2.10'
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: omniauth
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - "~>"
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '2.1'
|
117
|
+
type: :runtime
|
118
|
+
prerelease: false
|
119
|
+
version_requirements: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - "~>"
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: '2.1'
|
124
|
+
- !ruby/object:Gem::Dependency
|
125
|
+
name: omniauth-oauth2
|
126
|
+
requirement: !ruby/object:Gem::Requirement
|
127
|
+
requirements:
|
128
|
+
- - "~>"
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: '1.7'
|
131
|
+
type: :runtime
|
132
|
+
prerelease: false
|
133
|
+
version_requirements: !ruby/object:Gem::Requirement
|
134
|
+
requirements:
|
135
|
+
- - "~>"
|
136
|
+
- !ruby/object:Gem::Version
|
137
|
+
version: '1.7'
|
138
|
+
- !ruby/object:Gem::Dependency
|
139
|
+
name: ostruct
|
140
|
+
requirement: !ruby/object:Gem::Requirement
|
141
|
+
requirements:
|
142
|
+
- - ">="
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: '0'
|
145
|
+
type: :runtime
|
146
|
+
prerelease: false
|
147
|
+
version_requirements: !ruby/object:Gem::Requirement
|
148
|
+
requirements:
|
149
|
+
- - ">="
|
150
|
+
- !ruby/object:Gem::Version
|
151
|
+
version: '0'
|
152
|
+
- !ruby/object:Gem::Dependency
|
153
|
+
name: faraday
|
154
|
+
requirement: !ruby/object:Gem::Requirement
|
155
|
+
requirements:
|
156
|
+
- - "~>"
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
version: '2.7'
|
159
|
+
type: :runtime
|
160
|
+
prerelease: false
|
161
|
+
version_requirements: !ruby/object:Gem::Requirement
|
162
|
+
requirements:
|
163
|
+
- - "~>"
|
164
|
+
- !ruby/object:Gem::Version
|
165
|
+
version: '2.7'
|
166
|
+
- !ruby/object:Gem::Dependency
|
167
|
+
name: pkce_challenge
|
168
|
+
requirement: !ruby/object:Gem::Requirement
|
169
|
+
requirements:
|
170
|
+
- - "~>"
|
171
|
+
- !ruby/object:Gem::Version
|
172
|
+
version: '1.0'
|
173
|
+
type: :runtime
|
174
|
+
prerelease: false
|
175
|
+
version_requirements: !ruby/object:Gem::Requirement
|
176
|
+
requirements:
|
177
|
+
- - "~>"
|
178
|
+
- !ruby/object:Gem::Version
|
179
|
+
version: '1.0'
|
110
180
|
description: It offers base classes and helpers for creating MCP applications, making
|
111
181
|
it easier to integrate your Ruby/Rails application with the MCP standard
|
112
182
|
email:
|
@@ -120,6 +190,8 @@ files:
|
|
120
190
|
- README.md
|
121
191
|
- Rakefile
|
122
192
|
- app/controllers/action_mcp/application_controller.rb
|
193
|
+
- app/controllers/action_mcp/oauth/endpoints_controller.rb
|
194
|
+
- app/controllers/action_mcp/oauth/metadata_controller.rb
|
123
195
|
- app/models/action_mcp.rb
|
124
196
|
- app/models/action_mcp/application_record.rb
|
125
197
|
- app/models/action_mcp/session.rb
|
@@ -131,6 +203,7 @@ files:
|
|
131
203
|
- app/models/concerns/mcp_message_inspect.rb
|
132
204
|
- config/routes.rb
|
133
205
|
- db/migrate/20250512154359_consolidated_migration.rb
|
206
|
+
- db/migrate/20250608112101_add_oauth_to_sessions.rb
|
134
207
|
- exe/actionmcp_cli
|
135
208
|
- lib/action_mcp.rb
|
136
209
|
- lib/action_mcp/base_response.rb
|
@@ -145,6 +218,8 @@ files:
|
|
145
218
|
- lib/action_mcp/client/json_rpc_handler.rb
|
146
219
|
- lib/action_mcp/client/logging.rb
|
147
220
|
- lib/action_mcp/client/messaging.rb
|
221
|
+
- lib/action_mcp/client/oauth_client_provider.rb
|
222
|
+
- lib/action_mcp/client/oauth_client_provider/memory_storage.rb
|
148
223
|
- lib/action_mcp/client/prompt_book.rb
|
149
224
|
- lib/action_mcp/client/prompts.rb
|
150
225
|
- lib/action_mcp/client/request_timeouts.rb
|
@@ -181,6 +256,11 @@ files:
|
|
181
256
|
- lib/action_mcp/jwt_decoder.rb
|
182
257
|
- lib/action_mcp/log_subscriber.rb
|
183
258
|
- lib/action_mcp/logging.rb
|
259
|
+
- lib/action_mcp/oauth/error.rb
|
260
|
+
- lib/action_mcp/oauth/memory_storage.rb
|
261
|
+
- lib/action_mcp/oauth/middleware.rb
|
262
|
+
- lib/action_mcp/oauth/provider.rb
|
263
|
+
- lib/action_mcp/omniauth/mcp_strategy.rb
|
184
264
|
- lib/action_mcp/prompt.rb
|
185
265
|
- lib/action_mcp/prompt_response.rb
|
186
266
|
- lib/action_mcp/prompts_registry.rb
|
@@ -232,8 +312,6 @@ files:
|
|
232
312
|
- lib/action_mcp/uri_ambiguity_checker.rb
|
233
313
|
- lib/action_mcp/version.rb
|
234
314
|
- lib/actionmcp.rb
|
235
|
-
- lib/generators/action_mcp/config/config_generator.rb
|
236
|
-
- lib/generators/action_mcp/config/templates/mcp.yml
|
237
315
|
- lib/generators/action_mcp/install/install_generator.rb
|
238
316
|
- lib/generators/action_mcp/install/templates/application_gateway.rb
|
239
317
|
- lib/generators/action_mcp/install/templates/application_mcp_prompt.rb
|
@@ -1,28 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module ActionMCP
|
4
|
-
module Generators
|
5
|
-
class ConfigGenerator < Rails::Generators::Base
|
6
|
-
namespace "action_mcp:config"
|
7
|
-
source_root File.expand_path("templates", __dir__)
|
8
|
-
|
9
|
-
desc "Creates ActionMCP configuration file (config/mcp.yml)"
|
10
|
-
|
11
|
-
def create_mcp_yml
|
12
|
-
template "mcp.yml", "config/mcp.yml"
|
13
|
-
end
|
14
|
-
|
15
|
-
def show_instructions
|
16
|
-
say "ActionMCP configuration file created at config/mcp.yml"
|
17
|
-
say "You can customize your PubSub adapters and other settings in this file."
|
18
|
-
say ""
|
19
|
-
say "Available adapters:"
|
20
|
-
say " - simple : In-memory adapter for development"
|
21
|
-
say " - test : Test adapter"
|
22
|
-
say " - solid_cable : Database-backed adapter (requires solid_cable gem)"
|
23
|
-
say " - redis : Redis-backed adapter (requires redis gem)"
|
24
|
-
say ""
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
@@ -1,36 +0,0 @@
|
|
1
|
-
# ActionMCP Configuration
|
2
|
-
# This file contains configuration for the ActionMCP pub/sub system.
|
3
|
-
# Different environments can use different adapters.
|
4
|
-
|
5
|
-
development:
|
6
|
-
# In-memory adapter for development
|
7
|
-
adapter: simple
|
8
|
-
# Thread pool configuration (optional)
|
9
|
-
# min_threads: 5 # Minimum number of threads in the pool
|
10
|
-
# max_threads: 10 # Maximum number of threads in the pool
|
11
|
-
# max_queue: 100 # Maximum number of tasks that can be queued
|
12
|
-
|
13
|
-
test:
|
14
|
-
# Test adapter for testing
|
15
|
-
adapter: test
|
16
|
-
|
17
|
-
production:
|
18
|
-
# Choose one of the following adapters:
|
19
|
-
|
20
|
-
# 1. Database-backed adapter (recommended)
|
21
|
-
adapter: solid_cable
|
22
|
-
polling_interval: 0.5.seconds
|
23
|
-
# connects_to: cable # Optional: specify a different database connection
|
24
|
-
|
25
|
-
# Thread pool configuration (optional)
|
26
|
-
min_threads: 10 # Minimum number of threads in the pool
|
27
|
-
max_threads: 20 # Maximum number of threads in the pool
|
28
|
-
max_queue: 500 # Maximum number of tasks that can be queued
|
29
|
-
|
30
|
-
# 2. Redis-backed adapter (alternative)
|
31
|
-
# adapter: redis
|
32
|
-
# url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
|
33
|
-
# channel_prefix: <%= Rails.application.class.module_parent_name.underscore %>_production
|
34
|
-
# min_threads: 10 # Minimum number of threads in the pool
|
35
|
-
# max_threads: 20 # Maximum number of threads in the pool
|
36
|
-
# max_queue: 500 # Maximum number of tasks that can be queued
|