actionmcp 0.53.0 → 0.55.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 +36 -8
- data/app/models/action_mcp/session/message.rb +1 -1
- data/app/models/action_mcp/session.rb +8 -8
- data/db/migrate/20250512154359_consolidated_migration.rb +15 -12
- data/db/migrate/20250608112101_add_oauth_to_sessions.rb +2 -2
- data/lib/action_mcp/client/session_store_factory.rb +1 -10
- data/lib/action_mcp/configuration.rb +23 -0
- data/lib/action_mcp/server/session_store_factory.rb +1 -7
- data/lib/action_mcp/server.rb +1 -1
- data/lib/action_mcp/version.rb +1 -1
- data/lib/generators/action_mcp/install/install_generator.rb +32 -1
- data/lib/generators/action_mcp/install/templates/mcp.yml +123 -19
- metadata +1 -3
- data/lib/generators/action_mcp/config/config_generator.rb +0 -28
- data/lib/generators/action_mcp/config/templates/mcp.yml +0 -104
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 24a0298e6a7ed25d658bdb17c2161911a1c8e8ac199a5bd0e2b553a47e1d809f
|
4
|
+
data.tar.gz: 2066c3f6af2375dee54736d44f67b022c791c5b85cb7022cc1abd3ae6e9627f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 896039f7d34cae5e00d8e5c01717b12e4d806c2502f5cd6bf8da0a4d1556f30e90f26a4cddd0e7817d72d70443b94054f1071ad3bf40ab48f64e8be3a96e1927
|
7
|
+
data.tar.gz: a5a65421f027c10abcb0015ac8339ef06010c25a25c95eb24b7aba4f52504a813ee4105a10071ac68a66355671e0ee7894ca42a6785d67ccdfdc9f82f53163cd
|
data/README.md
CHANGED
@@ -357,7 +357,7 @@ ActionMCP includes three session store implementations:
|
|
357
357
|
|
358
358
|
### Configuration
|
359
359
|
|
360
|
-
You can configure the session store type in your Rails configuration
|
360
|
+
You can configure the session store type in your Rails configuration or `config/mcp.yml`:
|
361
361
|
|
362
362
|
```ruby
|
363
363
|
# config/application.rb or environment files
|
@@ -366,11 +366,34 @@ Rails.application.configure do
|
|
366
366
|
end
|
367
367
|
```
|
368
368
|
|
369
|
+
Or in `config/mcp.yml`:
|
370
|
+
|
371
|
+
```yaml
|
372
|
+
# Global session store type (used by both client and server)
|
373
|
+
session_store_type: volatile
|
374
|
+
|
375
|
+
# Client-specific session store type (falls back to session_store_type if not specified)
|
376
|
+
client_session_store_type: volatile
|
377
|
+
|
378
|
+
# Server-specific session store type (falls back to session_store_type if not specified)
|
379
|
+
server_session_store_type: active_record
|
380
|
+
```
|
381
|
+
|
369
382
|
The defaults are:
|
370
383
|
- Production: `:active_record`
|
371
384
|
- Development: `:volatile`
|
372
385
|
- Test: `:volatile` (or `:test` when using TestHelper)
|
373
386
|
|
387
|
+
### Separate Client and Server Session Stores
|
388
|
+
|
389
|
+
You can configure different session store types for client and server operations:
|
390
|
+
|
391
|
+
- **`session_store_type`**: Global setting used by both client and server when specific types aren't set
|
392
|
+
- **`client_session_store_type`**: Session store used by ActionMCP client connections (falls back to global setting)
|
393
|
+
- **`server_session_store_type`**: Session store used by ActionMCP server sessions (falls back to global setting)
|
394
|
+
|
395
|
+
This allows you to optimize each component separately. For example, you might use volatile storage for client sessions (faster, temporary) while using persistent storage for server sessions (maintains state across restarts).
|
396
|
+
|
374
397
|
### Using Different Session Stores
|
375
398
|
|
376
399
|
```ruby
|
@@ -476,16 +499,21 @@ This ensures all thread pools are properly terminated and tasks are completed.
|
|
476
499
|
|
477
500
|
**ActionMCP** runs as a standalone Rack application. **Do not attempt to mount it in your application's `routes.rb`**—it is not designed to be mounted as an engine at a custom path. When you use `run ActionMCP::Engine` in your `mcp.ru`, the MCP endpoint is always available at the root path (`/`).
|
478
501
|
|
479
|
-
### Installing
|
502
|
+
### Installing ActionMCP
|
480
503
|
|
481
|
-
ActionMCP includes
|
504
|
+
ActionMCP includes generators to help you set up your project quickly. The install generator creates all necessary base classes and configuration files:
|
482
505
|
|
483
506
|
```bash
|
484
|
-
#
|
485
|
-
bin/rails generate action_mcp:
|
507
|
+
# Install ActionMCP with base classes and configuration
|
508
|
+
bin/rails generate action_mcp:install
|
486
509
|
```
|
487
510
|
|
488
|
-
This will create
|
511
|
+
This will create:
|
512
|
+
- `app/mcp/prompts/application_mcp_prompt.rb` - Base prompt class
|
513
|
+
- `app/mcp/tools/application_mcp_tool.rb` - Base tool class
|
514
|
+
- `app/mcp/resource_templates/application_mcp_res_template.rb` - Base resource template class
|
515
|
+
- `app/mcp/application_gateway.rb` - Gateway for authentication
|
516
|
+
- `config/mcp.yml` - Configuration file with example settings for all environments
|
489
517
|
|
490
518
|
> **Note:** Authentication and authorization are not included. You are responsible for securing the endpoint.
|
491
519
|
|
@@ -647,14 +675,14 @@ location /mcp/ {
|
|
647
675
|
|
648
676
|
ActionMCP includes Rails generators to help you quickly set up your MCP server components.
|
649
677
|
|
650
|
-
|
678
|
+
First, install ActionMCP to create base classes and configuration:
|
651
679
|
|
652
680
|
```bash
|
653
681
|
bin/rails action_mcp:install:migrations # to copy the migrations
|
654
682
|
bin/rails generate action_mcp:install
|
655
683
|
```
|
656
684
|
|
657
|
-
This will create the base application classes in your app directory.
|
685
|
+
This will create the base application classes, configuration file, and authentication gateway in your app directory.
|
658
686
|
|
659
687
|
### Generate a New Prompt
|
660
688
|
|
@@ -7,7 +7,7 @@
|
|
7
7
|
# id :bigint not null, primary key
|
8
8
|
# direction(The message recipient) :string default("client"), not null
|
9
9
|
# is_ping(Whether the message is a ping) :boolean default(FALSE), not null
|
10
|
-
# message_json :
|
10
|
+
# message_json :json
|
11
11
|
# message_type(The type of the message) :string not null
|
12
12
|
# request_acknowledged :boolean default(FALSE), not null
|
13
13
|
# request_cancelled :boolean default(FALSE), not null
|
@@ -6,24 +6,24 @@
|
|
6
6
|
#
|
7
7
|
# id :string not null, primary key
|
8
8
|
# authentication_method :string default("none")
|
9
|
-
# client_capabilities(The capabilities of the client) :
|
10
|
-
# client_info(The information about the client) :
|
9
|
+
# client_capabilities(The capabilities of the client) :json
|
10
|
+
# client_info(The information about the client) :json
|
11
11
|
# ended_at(The time the session ended) :datetime
|
12
12
|
# initialized :boolean default(FALSE), not null
|
13
13
|
# messages_count :integer default(0), not null
|
14
14
|
# oauth_access_token :string
|
15
15
|
# oauth_refresh_token :string
|
16
16
|
# oauth_token_expires_at :datetime
|
17
|
-
# oauth_user_context :
|
18
|
-
# prompt_registry :
|
17
|
+
# oauth_user_context :json
|
18
|
+
# prompt_registry :json
|
19
19
|
# protocol_version :string
|
20
|
-
# resource_registry :
|
20
|
+
# resource_registry :json
|
21
21
|
# role(The role of the session) :string default("server"), not null
|
22
|
-
# server_capabilities(The capabilities of the server) :
|
23
|
-
# server_info(The information about the server) :
|
22
|
+
# server_capabilities(The capabilities of the server) :json
|
23
|
+
# server_info(The information about the server) :json
|
24
24
|
# sse_event_counter :integer default(0), not null
|
25
25
|
# status :string default("pre_initialize"), not null
|
26
|
-
# tool_registry :
|
26
|
+
# tool_registry :json
|
27
27
|
# created_at :datetime not null
|
28
28
|
# updated_at :datetime not null
|
29
29
|
#
|
@@ -11,16 +11,16 @@ class ConsolidatedMigration < ActiveRecord::Migration[8.0]
|
|
11
11
|
t.string :status, null: false, default: 'pre_initialize'
|
12
12
|
t.datetime :ended_at, comment: 'The time the session ended'
|
13
13
|
t.string :protocol_version
|
14
|
-
t.
|
15
|
-
t.
|
16
|
-
t.
|
17
|
-
t.
|
14
|
+
t.json :server_capabilities, comment: 'The capabilities of the server'
|
15
|
+
t.json :client_capabilities, comment: 'The capabilities of the client'
|
16
|
+
t.json :server_info, comment: 'The information about the server'
|
17
|
+
t.json :client_info, comment: 'The information about the client'
|
18
18
|
t.boolean :initialized, null: false, default: false
|
19
19
|
t.integer :messages_count, null: false, default: 0
|
20
20
|
t.integer :sse_event_counter, default: 0, null: false
|
21
|
-
t.
|
22
|
-
t.
|
23
|
-
t.
|
21
|
+
t.json :tool_registry, default: []
|
22
|
+
t.json :prompt_registry, default: []
|
23
|
+
t.json :resource_registry, default: []
|
24
24
|
t.timestamps
|
25
25
|
end
|
26
26
|
end
|
@@ -36,7 +36,7 @@ class ConsolidatedMigration < ActiveRecord::Migration[8.0]
|
|
36
36
|
t.string :direction, null: false, comment: 'The message recipient', default: 'client'
|
37
37
|
t.string :message_type, null: false, comment: 'The type of the message'
|
38
38
|
t.string :jsonrpc_id
|
39
|
-
t.
|
39
|
+
t.json :message_json
|
40
40
|
t.boolean :is_ping, default: false, null: false, comment: 'Whether the message is a ping'
|
41
41
|
t.boolean :request_acknowledged, default: false, null: false
|
42
42
|
t.boolean :request_cancelled, null: false, default: false
|
@@ -98,15 +98,15 @@ class ConsolidatedMigration < ActiveRecord::Migration[8.0]
|
|
98
98
|
end
|
99
99
|
|
100
100
|
unless column_exists?(:action_mcp_sessions, :tool_registry)
|
101
|
-
add_column :action_mcp_sessions, :tool_registry, :
|
101
|
+
add_column :action_mcp_sessions, :tool_registry, :json, default: []
|
102
102
|
end
|
103
103
|
|
104
104
|
unless column_exists?(:action_mcp_sessions, :prompt_registry)
|
105
|
-
add_column :action_mcp_sessions, :prompt_registry, :
|
105
|
+
add_column :action_mcp_sessions, :prompt_registry, :json, default: []
|
106
106
|
end
|
107
107
|
|
108
108
|
unless column_exists?(:action_mcp_sessions, :resource_registry)
|
109
|
-
add_column :action_mcp_sessions, :resource_registry, :
|
109
|
+
add_column :action_mcp_sessions, :resource_registry, :json, default: []
|
110
110
|
end
|
111
111
|
end
|
112
112
|
|
@@ -132,7 +132,10 @@ class ConsolidatedMigration < ActiveRecord::Migration[8.0]
|
|
132
132
|
|
133
133
|
return unless column_exists?(:action_mcp_session_messages, :direction)
|
134
134
|
|
135
|
-
|
135
|
+
# SQLite3 doesn't support changing column comments
|
136
|
+
if connection.adapter_name.downcase != 'sqlite'
|
137
|
+
change_column_comment :action_mcp_session_messages, :direction, 'The message recipient'
|
138
|
+
end
|
136
139
|
end
|
137
140
|
|
138
141
|
private
|
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
class AddOAuthToSessions < ActiveRecord::Migration[8.0]
|
4
4
|
def change
|
5
|
-
# Use
|
6
|
-
json_type =
|
5
|
+
# Use json for all databases (PostgreSQL, SQLite3, MySQL) for consistency
|
6
|
+
json_type = :json
|
7
7
|
|
8
8
|
add_column :action_mcp_sessions, :oauth_access_token, :string
|
9
9
|
add_column :action_mcp_sessions, :oauth_refresh_token, :string
|
@@ -20,16 +20,7 @@ module ActionMCP
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def self.default_type
|
23
|
-
|
24
|
-
# outside a Rails environment.
|
25
|
-
# Will refactor this soon
|
26
|
-
if defined?(Rails) && Rails.env.test?
|
27
|
-
:volatile # Use volatile for tests unless explicitly using :test
|
28
|
-
elsif defined?(Rails) && Rails.env.production?
|
29
|
-
:active_record
|
30
|
-
else
|
31
|
-
:volatile # Default for development or non-Rails environments
|
32
|
-
end
|
23
|
+
ActionMCP.configuration.client_session_store_type
|
33
24
|
end
|
34
25
|
end
|
35
26
|
end
|
@@ -41,6 +41,8 @@ module ActionMCP
|
|
41
41
|
:gateway_class,
|
42
42
|
# --- Session Store Options ---
|
43
43
|
:session_store_type,
|
44
|
+
:client_session_store_type,
|
45
|
+
:server_session_store_type,
|
44
46
|
# --- Pub/Sub and Thread Pool Options ---
|
45
47
|
:adapter,
|
46
48
|
:min_threads,
|
@@ -75,6 +77,8 @@ module ActionMCP
|
|
75
77
|
|
76
78
|
# Session Store
|
77
79
|
@session_store_type = Rails.env.production? ? :active_record : :volatile
|
80
|
+
@client_session_store_type = nil # defaults to session_store_type
|
81
|
+
@server_session_store_type = nil # defaults to session_store_type
|
78
82
|
end
|
79
83
|
|
80
84
|
def name
|
@@ -185,6 +189,16 @@ module ActionMCP
|
|
185
189
|
capabilities
|
186
190
|
end
|
187
191
|
|
192
|
+
# Get effective client session store type (falls back to global session_store_type)
|
193
|
+
def client_session_store_type
|
194
|
+
@client_session_store_type || @session_store_type
|
195
|
+
end
|
196
|
+
|
197
|
+
# Get effective server session store type (falls back to global session_store_type)
|
198
|
+
def server_session_store_type
|
199
|
+
@server_session_store_type || @session_store_type
|
200
|
+
end
|
201
|
+
|
188
202
|
def apply_profile_options
|
189
203
|
profile = @profiles[active_profile]
|
190
204
|
return unless profile && profile[:options]
|
@@ -254,6 +268,15 @@ module ActionMCP
|
|
254
268
|
if app_config["connects_to"]
|
255
269
|
@connects_to = app_config["connects_to"]
|
256
270
|
end
|
271
|
+
|
272
|
+
# Extract client and server session store types
|
273
|
+
if app_config["client_session_store_type"]
|
274
|
+
@client_session_store_type = app_config["client_session_store_type"].to_sym
|
275
|
+
end
|
276
|
+
|
277
|
+
if app_config["server_session_store_type"]
|
278
|
+
@server_session_store_type = app_config["server_session_store_type"].to_sym
|
279
|
+
end
|
257
280
|
end
|
258
281
|
|
259
282
|
def should_include_all?(type)
|
@@ -19,13 +19,7 @@ module ActionMCP
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def self.default_type
|
22
|
-
|
23
|
-
:volatile # Use volatile for tests unless explicitly using :test
|
24
|
-
elsif Rails.env.production?
|
25
|
-
:active_record
|
26
|
-
else
|
27
|
-
:volatile
|
28
|
-
end
|
22
|
+
ActionMCP.configuration.server_session_store_type
|
29
23
|
end
|
30
24
|
end
|
31
25
|
end
|
data/lib/action_mcp/server.rb
CHANGED
data/lib/action_mcp/version.rb
CHANGED
@@ -7,6 +7,8 @@ module ActionMcp
|
|
7
7
|
class InstallGenerator < Rails::Generators::Base
|
8
8
|
source_root File.expand_path("templates", __dir__)
|
9
9
|
|
10
|
+
desc "Install ActionMCP with base classes and configuration"
|
11
|
+
|
10
12
|
def create_application_prompt_file
|
11
13
|
template "application_mcp_prompt.rb", File.join("app/mcp/prompts", "application_mcp_prompt.rb")
|
12
14
|
end
|
@@ -20,13 +22,42 @@ module ActionMcp
|
|
20
22
|
File.join("app/mcp/resource_templates", "application_mcp_res_template.rb")
|
21
23
|
end
|
22
24
|
|
23
|
-
def
|
25
|
+
def create_mcp_configuration_file
|
24
26
|
template "mcp.yml", File.join("config", "mcp.yml")
|
25
27
|
end
|
26
28
|
|
27
29
|
def create_application_gateway_file
|
28
30
|
template "application_gateway.rb", File.join("app/mcp", "application_gateway.rb")
|
29
31
|
end
|
32
|
+
|
33
|
+
def show_instructions
|
34
|
+
say ""
|
35
|
+
say "ActionMCP has been installed successfully!"
|
36
|
+
say ""
|
37
|
+
say "Files created:"
|
38
|
+
say " - app/mcp/prompts/application_mcp_prompt.rb"
|
39
|
+
say " - app/mcp/tools/application_mcp_tool.rb"
|
40
|
+
say " - app/mcp/resource_templates/application_mcp_res_template.rb"
|
41
|
+
say " - app/mcp/application_gateway.rb"
|
42
|
+
say " - config/mcp.yml"
|
43
|
+
say ""
|
44
|
+
say "Configuration:"
|
45
|
+
say " The mcp.yml file contains authentication, profiles, and adapter settings."
|
46
|
+
say " You can customize authentication methods, OAuth settings, and PubSub adapters."
|
47
|
+
say ""
|
48
|
+
say "Available adapters:"
|
49
|
+
say " - simple : In-memory adapter for development"
|
50
|
+
say " - test : Test adapter for testing environments"
|
51
|
+
say " - solid_cable : Database-backed adapter (requires solid_cable gem)"
|
52
|
+
say " - redis : Redis-backed adapter (requires redis gem)"
|
53
|
+
say ""
|
54
|
+
say "Next steps:"
|
55
|
+
say " 1. Generate your first tool: rails generate action_mcp:tool MyTool"
|
56
|
+
say " 2. Generate your first prompt: rails generate action_mcp:prompt MyPrompt"
|
57
|
+
say " 3. Generate your first resource template: rails generate action_mcp:resource_template MyResource"
|
58
|
+
say " 4. Start the MCP server: bundle exec rails s -c mcp.ru -p 62770"
|
59
|
+
say ""
|
60
|
+
end
|
30
61
|
end
|
31
62
|
end
|
32
63
|
end
|
@@ -1,21 +1,125 @@
|
|
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
|
+
# Session store configuration
|
10
|
+
# Global session store type used by both client and server (default: volatile in dev/test, active_record in production)
|
11
|
+
# session_store_type: volatile
|
12
|
+
|
13
|
+
# Client-specific session store type (falls back to session_store_type if not specified)
|
14
|
+
# client_session_store_type: volatile
|
15
|
+
|
16
|
+
# Server-specific session store type (falls back to session_store_type if not specified)
|
17
|
+
# server_session_store_type: active_record
|
18
|
+
|
19
|
+
# OAuth configuration (if using OAuth authentication)
|
20
|
+
# oauth:
|
21
|
+
# provider: "demo_oauth_provider"
|
22
|
+
# scopes_supported: ["mcp:tools", "mcp:resources", "mcp:prompts"]
|
23
|
+
# enable_dynamic_registration: true
|
24
|
+
# enable_token_revocation: true
|
25
|
+
# pkce_required: true
|
26
|
+
# issuer_url: https://yourapp.com
|
27
|
+
|
28
|
+
# MCP capability profiles
|
29
|
+
profiles:
|
30
|
+
primary:
|
31
|
+
tools:
|
32
|
+
- all
|
33
|
+
prompts:
|
34
|
+
- all
|
35
|
+
resources:
|
36
|
+
- all
|
37
|
+
options:
|
38
|
+
list_changed: false
|
39
|
+
logging_enabled: true
|
40
|
+
resources_subscribe: false
|
41
|
+
|
42
|
+
minimal:
|
43
|
+
tools: []
|
44
|
+
prompts: []
|
45
|
+
resources: []
|
46
|
+
options:
|
47
|
+
list_changed: false
|
48
|
+
logging_enabled: false
|
49
|
+
logging_level: warn
|
50
|
+
resources_subscribe: false
|
51
|
+
|
52
|
+
# Development environment
|
53
|
+
development:
|
54
|
+
# Use simple pub/sub adapter for development
|
55
|
+
adapter: simple
|
56
|
+
|
57
|
+
# Session store examples for development
|
58
|
+
# Use volatile client sessions for faster development
|
59
|
+
# client_session_store_type: volatile
|
60
|
+
# Use persistent server sessions to maintain state across restarts
|
61
|
+
# server_session_store_type: active_record
|
62
|
+
|
63
|
+
# Thread pool configuration (optional)
|
64
|
+
# min_threads: 5 # Minimum number of threads in the pool
|
65
|
+
# max_threads: 10 # Maximum number of threads in the pool
|
66
|
+
# max_queue: 100 # Maximum number of tasks that can be queued
|
67
|
+
|
68
|
+
# Test environment
|
69
|
+
test:
|
70
|
+
# JWT authentication for testing environment
|
71
|
+
authentication: ["jwt"]
|
72
|
+
|
73
|
+
# Test adapter for testing
|
74
|
+
adapter: test
|
75
|
+
|
76
|
+
# Use volatile sessions for testing (fast cleanup)
|
77
|
+
# session_store_type: volatile
|
78
|
+
|
79
|
+
# Production environment
|
80
|
+
production:
|
81
|
+
# Multiple authentication methods - try OAuth first, fallback to JWT
|
82
|
+
authentication: ["oauth", "jwt"]
|
83
|
+
|
84
|
+
# OAuth configuration for production
|
85
|
+
oauth:
|
86
|
+
provider: "application_oauth_provider" # Your custom provider class
|
87
|
+
scopes_supported: ["mcp:tools", "mcp:resources", "mcp:prompts"]
|
88
|
+
enable_dynamic_registration: true
|
89
|
+
enable_token_revocation: true
|
90
|
+
pkce_required: true
|
91
|
+
issuer_url: https://yourapp.com
|
92
|
+
|
93
|
+
# Additional production profiles for external clients
|
94
|
+
profiles:
|
95
|
+
external_clients:
|
96
|
+
tools: ["WeatherForecastTool"] # Limited tool access for external clients
|
97
|
+
prompts: []
|
98
|
+
resources: []
|
99
|
+
|
100
|
+
# Production session store configuration
|
101
|
+
# Use persistent storage for production reliability
|
102
|
+
# session_store_type: active_record
|
103
|
+
# Or configure separately:
|
104
|
+
# client_session_store_type: active_record # Client connections persist across restarts
|
105
|
+
# server_session_store_type: active_record # Server state persists across deployments
|
106
|
+
|
107
|
+
# Choose one of the following adapters:
|
108
|
+
|
109
|
+
# 1. Database-backed adapter (recommended)
|
110
|
+
adapter: solid_cable
|
111
|
+
polling_interval: 0.5.seconds
|
112
|
+
# connects_to: cable # Optional: specify a different database connection
|
113
|
+
|
114
|
+
# Thread pool configuration (optional)
|
115
|
+
min_threads: 10 # Minimum number of threads in the pool
|
116
|
+
max_threads: 20 # Maximum number of threads in the pool
|
117
|
+
max_queue: 500 # Maximum number of tasks that can be queued
|
12
118
|
|
13
|
-
#
|
14
|
-
#
|
15
|
-
#
|
16
|
-
#
|
17
|
-
#
|
18
|
-
#
|
19
|
-
#
|
20
|
-
# logging_level: :warn
|
21
|
-
# resources_subscribe: false
|
119
|
+
# 2. Redis-backed adapter (alternative)
|
120
|
+
# adapter: redis
|
121
|
+
# url: redis://localhost:6379/1
|
122
|
+
# channel_prefix: my_mcp_app_production
|
123
|
+
# min_threads: 10 # Minimum number of threads in the pool
|
124
|
+
# max_threads: 20 # Maximum number of threads in the pool
|
125
|
+
# 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.55.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Abdelkader Boudih
|
@@ -312,8 +312,6 @@ files:
|
|
312
312
|
- lib/action_mcp/uri_ambiguity_checker.rb
|
313
313
|
- lib/action_mcp/version.rb
|
314
314
|
- lib/actionmcp.rb
|
315
|
-
- lib/generators/action_mcp/config/config_generator.rb
|
316
|
-
- lib/generators/action_mcp/config/templates/mcp.yml
|
317
315
|
- lib/generators/action_mcp/install/install_generator.rb
|
318
316
|
- lib/generators/action_mcp/install/templates/application_gateway.rb
|
319
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,104 +0,0 @@
|
|
1
|
-
# ActionMCP Configuration
|
2
|
-
# This file contains configuration for the ActionMCP server including
|
3
|
-
# authentication, profiles, and pub/sub system settings.
|
4
|
-
|
5
|
-
development:
|
6
|
-
# Authentication configuration - array of methods to try in order
|
7
|
-
authentication: ["none"] # No authentication required for development
|
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
|
-
|
17
|
-
# MCP capability profiles
|
18
|
-
profiles:
|
19
|
-
primary:
|
20
|
-
tools: ["all"]
|
21
|
-
prompts: ["all"]
|
22
|
-
resources: ["all"]
|
23
|
-
options:
|
24
|
-
list_changed: false
|
25
|
-
logging_enabled: true
|
26
|
-
resources_subscribe: false
|
27
|
-
|
28
|
-
minimal:
|
29
|
-
tools: []
|
30
|
-
prompts: []
|
31
|
-
resources: []
|
32
|
-
options:
|
33
|
-
list_changed: false
|
34
|
-
logging_enabled: false
|
35
|
-
logging_level: :warn
|
36
|
-
resources_subscribe: false
|
37
|
-
|
38
|
-
# Pub/sub adapter configuration
|
39
|
-
adapter: simple
|
40
|
-
# Thread pool configuration (optional)
|
41
|
-
# min_threads: 5 # Minimum number of threads in the pool
|
42
|
-
# max_threads: 10 # Maximum number of threads in the pool
|
43
|
-
# max_queue: 100 # Maximum number of tasks that can be queued
|
44
|
-
|
45
|
-
test:
|
46
|
-
# JWT authentication for testing
|
47
|
-
authentication: ["jwt"]
|
48
|
-
|
49
|
-
profiles:
|
50
|
-
primary:
|
51
|
-
tools: ["all"]
|
52
|
-
prompts: ["all"]
|
53
|
-
resources: ["all"]
|
54
|
-
|
55
|
-
# Test adapter for testing
|
56
|
-
adapter: test
|
57
|
-
|
58
|
-
production:
|
59
|
-
# Multiple authentication methods - try OAuth first, fallback to JWT
|
60
|
-
authentication: ["oauth", "jwt"]
|
61
|
-
|
62
|
-
# OAuth configuration for production
|
63
|
-
oauth:
|
64
|
-
provider: "application_oauth_provider" # Your custom provider class
|
65
|
-
scopes_supported: ["mcp:tools", "mcp:resources", "mcp:prompts"]
|
66
|
-
enable_dynamic_registration: true
|
67
|
-
enable_token_revocation: true
|
68
|
-
pkce_required: true
|
69
|
-
# issuer_url: <%= ENV.fetch("OAUTH_ISSUER_URL") { "https://yourapp.com" } %>
|
70
|
-
|
71
|
-
profiles:
|
72
|
-
primary:
|
73
|
-
tools: ["all"]
|
74
|
-
prompts: ["all"]
|
75
|
-
resources: ["all"]
|
76
|
-
options:
|
77
|
-
list_changed: false
|
78
|
-
logging_enabled: true
|
79
|
-
resources_subscribe: false
|
80
|
-
|
81
|
-
external_clients:
|
82
|
-
tools: ["WeatherForecastTool"] # Limited tool access for external clients
|
83
|
-
prompts: []
|
84
|
-
resources: []
|
85
|
-
|
86
|
-
# Choose one of the following adapters:
|
87
|
-
|
88
|
-
# 1. Database-backed adapter (recommended)
|
89
|
-
adapter: solid_cable
|
90
|
-
polling_interval: 0.5.seconds
|
91
|
-
# connects_to: cable # Optional: specify a different database connection
|
92
|
-
|
93
|
-
# Thread pool configuration (optional)
|
94
|
-
min_threads: 10 # Minimum number of threads in the pool
|
95
|
-
max_threads: 20 # Maximum number of threads in the pool
|
96
|
-
max_queue: 500 # Maximum number of tasks that can be queued
|
97
|
-
|
98
|
-
# 2. Redis-backed adapter (alternative)
|
99
|
-
# adapter: redis
|
100
|
-
# url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
|
101
|
-
# channel_prefix: <%= Rails.application.class.module_parent_name.underscore %>_production
|
102
|
-
# min_threads: 10 # Minimum number of threads in the pool
|
103
|
-
# max_threads: 20 # Maximum number of threads in the pool
|
104
|
-
# max_queue: 500 # Maximum number of tasks that can be queued
|