actionmcp 0.22.0 → 0.25.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 (33) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +113 -2
  3. data/app/controllers/action_mcp/messages_controller.rb +2 -14
  4. data/app/controllers/action_mcp/sse_controller.rb +113 -45
  5. data/app/models/action_mcp/session/message.rb +21 -16
  6. data/app/models/action_mcp/session.rb +3 -2
  7. data/config/routes.rb +1 -1
  8. data/db/migrate/20250324203409_remove_session_message_text.rb +7 -0
  9. data/lib/action_mcp/client/base.rb +12 -14
  10. data/lib/action_mcp/client/blueprint.rb +5 -71
  11. data/lib/action_mcp/client/catalog.rb +10 -74
  12. data/lib/action_mcp/client/collection.rb +93 -0
  13. data/lib/action_mcp/client/json_rpc_handler.rb +12 -7
  14. data/lib/action_mcp/client/logging.rb +1 -2
  15. data/lib/action_mcp/client/prompt_book.rb +5 -71
  16. data/lib/action_mcp/client/prompts.rb +9 -4
  17. data/lib/action_mcp/client/request_timeouts.rb +74 -0
  18. data/lib/action_mcp/client/resources.rb +23 -11
  19. data/lib/action_mcp/client/server.rb +3 -3
  20. data/lib/action_mcp/client/toolbox.rb +12 -54
  21. data/lib/action_mcp/client/tools.rb +9 -4
  22. data/lib/action_mcp/configuration.rb +134 -24
  23. data/lib/action_mcp/engine.rb +6 -0
  24. data/lib/action_mcp/json_rpc_handler_base.rb +1 -0
  25. data/lib/action_mcp/registry_base.rb +3 -1
  26. data/lib/action_mcp/server/capabilities.rb +1 -1
  27. data/lib/action_mcp/server/json_rpc_handler.rb +1 -1
  28. data/lib/action_mcp/server/messaging.rb +32 -9
  29. data/lib/action_mcp/version.rb +1 -1
  30. data/lib/generators/action_mcp/install/install_generator.rb +4 -0
  31. data/lib/generators/action_mcp/install/templates/mcp.yml +11 -0
  32. data/lib/tasks/action_mcp_tasks.rake +77 -6
  33. metadata +6 -2
@@ -23,12 +23,12 @@ namespace :action_mcp do
23
23
  # Ensure Rails eager loads all classes
24
24
  Rails.application.eager_load!
25
25
 
26
- puts "\e[32mACTION MCP PROMPTS\e[0m" # Red
27
- puts "\e[32m-----------------\e[0m" # Red
26
+ puts "\e[32mACTION MCP PROMPTS\e[0m" # Green
27
+ puts "\e[32m-----------------\e[0m" # Green
28
28
  ActionMCP::Prompt.descendants.each do |prompt|
29
29
  next if prompt.abstract?
30
30
 
31
- puts "\e[32m#{prompt.capability_name}:\e[0m #{prompt.description}" # Red name
31
+ puts "\e[32m#{prompt.capability_name}:\e[0m #{prompt.description}" # Green name
32
32
  end
33
33
  puts "\n"
34
34
  end
@@ -49,8 +49,79 @@ namespace :action_mcp do
49
49
  puts "\n"
50
50
  end
51
51
 
52
- desc "List all tools and prompts with their names and descriptions"
53
- task list: %i[list_tools list_prompts list_resources] do
54
- # This task lists all tools, prompts, and resources
52
+ # bin/rails action_mcp:show_profile[profile_name]
53
+ desc "Show configuration for a specific profile"
54
+ task :show_profile, [ :profile_name ] => :environment do |t, args|
55
+ # Ensure Rails eager loads all classes
56
+ Rails.application.eager_load!
57
+
58
+ profile_name = (args[:profile_name] || "primary").to_sym
59
+ profiles = ActionMCP.configuration.profiles
60
+
61
+ unless profiles.key?(profile_name)
62
+ puts "\e[31mProfile '#{profile_name}' not found!\e[0m"
63
+ puts "Available profiles: #{profiles.keys.join(', ')}"
64
+ next
65
+ end
66
+
67
+ # Temporarily activate this profile to show what would be included
68
+ ActionMCP.with_profile(profile_name) do
69
+ profile_config = profiles[profile_name]
70
+
71
+ puts "\e[35mPROFILE: #{profile_name.to_s.upcase}\e[0m" # Purple
72
+ puts "\e[35m#{'-' * (profile_name.to_s.length + 9)}\e[0m"
73
+
74
+ # Show options
75
+ if profile_config[:options]
76
+ puts "\n\e[36mOptions:\e[0m" # Cyan
77
+ profile_config[:options].each do |key, value|
78
+ puts " #{key}: #{value}"
79
+ end
80
+ end
81
+
82
+ # Show Tools
83
+ puts "\n\e[34mIncluded Tools:\e[0m" # Blue
84
+ if ActionMCP.configuration.filtered_tools.any?
85
+ ActionMCP.configuration.filtered_tools.each do |tool|
86
+ puts " \e[34m#{tool.name}:\e[0m #{tool.description}"
87
+ end
88
+ else
89
+ puts " None"
90
+ end
91
+
92
+ # Show Prompts
93
+ puts "\n\e[32mIncluded Prompts:\e[0m" # Green
94
+ if ActionMCP.configuration.filtered_prompts.any?
95
+ ActionMCP.configuration.filtered_prompts.each do |prompt|
96
+ puts " \e[32m#{prompt.name}:\e[0m #{prompt.description}"
97
+ end
98
+ else
99
+ puts " None"
100
+ end
101
+
102
+ # Show Resources
103
+ puts "\n\e[33mIncluded Resources:\e[0m" # Yellow
104
+ if ActionMCP.configuration.filtered_resources.any?
105
+ ActionMCP.configuration.filtered_resources.each do |resource|
106
+ puts " \e[33m#{resource.name}:\e[0m #{resource.description}"
107
+ end
108
+ else
109
+ puts " None"
110
+ end
111
+
112
+ # Show Capabilities
113
+ puts "\n\e[36mActive Capabilities:\e[0m" # Cyan
114
+ capabilities = ActionMCP.configuration.capabilities
115
+ capabilities.each do |cap_name, cap_config|
116
+ puts " #{cap_name}: #{cap_config.inspect}"
117
+ end
118
+ end
119
+
120
+ puts "\n"
121
+ end
122
+
123
+ desc "List all tools, prompts, resources and available profiles"
124
+ task list: %i[list_tools list_prompts list_resources list_profiles] do
125
+ # This task lists all tools, prompts, resources and profiles
55
126
  end
56
127
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: actionmcp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.22.0
4
+ version: 0.25.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Abdelkader Boudih
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-03-24 00:00:00.000000000 Z
11
+ date: 2025-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actioncable
@@ -106,6 +106,7 @@ files:
106
106
  - db/migrate/20250314230152_add_is_ping_to_session_message.rb
107
107
  - db/migrate/20250316005021_create_action_mcp_session_subscriptions.rb
108
108
  - db/migrate/20250316005649_create_action_mcp_session_resources.rb
109
+ - db/migrate/20250324203409_remove_session_message_text.rb
109
110
  - exe/actionmcp_cli
110
111
  - lib/action_mcp.rb
111
112
  - lib/action_mcp/base_response.rb
@@ -115,11 +116,13 @@ files:
115
116
  - lib/action_mcp/client/base.rb
116
117
  - lib/action_mcp/client/blueprint.rb
117
118
  - lib/action_mcp/client/catalog.rb
119
+ - lib/action_mcp/client/collection.rb
118
120
  - lib/action_mcp/client/json_rpc_handler.rb
119
121
  - lib/action_mcp/client/logging.rb
120
122
  - lib/action_mcp/client/messaging.rb
121
123
  - lib/action_mcp/client/prompt_book.rb
122
124
  - lib/action_mcp/client/prompts.rb
125
+ - lib/action_mcp/client/request_timeouts.rb
123
126
  - lib/action_mcp/client/resources.rb
124
127
  - lib/action_mcp/client/roots.rb
125
128
  - lib/action_mcp/client/server.rb
@@ -181,6 +184,7 @@ files:
181
184
  - lib/generators/action_mcp/install/templates/application_mcp_prompt.rb
182
185
  - lib/generators/action_mcp/install/templates/application_mcp_res_template.rb
183
186
  - lib/generators/action_mcp/install/templates/application_mcp_tool.rb
187
+ - lib/generators/action_mcp/install/templates/mcp.yml
184
188
  - lib/generators/action_mcp/prompt/prompt_generator.rb
185
189
  - lib/generators/action_mcp/prompt/templates/prompt.rb.erb
186
190
  - lib/generators/action_mcp/resource_template/resource_template_generator.rb