actionmcp 0.2.6 → 0.3.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 +4 -4
 - data/lib/action_mcp/engine.rb +11 -0
 - data/lib/action_mcp/transport/resources.rb +19 -0
 - data/lib/action_mcp/transport_handler.rb +1 -0
 - data/lib/action_mcp/version.rb +1 -1
 - data/lib/generators/action_mcp/install/install_generator.rb +2 -2
 - data/lib/generators/action_mcp/prompt/prompt_generator.rb +2 -2
 - data/lib/generators/action_mcp/tool/tool_generator.rb +2 -2
 - metadata +3 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 42a6f6ad112f762c4721ee472efd560bc3d67ccba63e0c738ef8fa34389dd98d
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 9d095dad87a5275cb42faa802a839da3d21c435ba4c6f6222579c2db5cb09523
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 39b63323aa753e1fd8acaa31654fae037fef84a41810d85c9a759d9b8a78b1e93de66e4a8cc170652bfefde726c73bbdb3f42c34d2c611ed589b6e16d8d66bbd
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 471eb542dfb0516b4cccd50a9c50de1346da2b5b0365f50ecaa77aaf1a0670f1982c5ddda218a844bcc3446e2d26cc0e8cb64dc4a144d47eeee04d9c81692d10
         
     | 
    
        data/README.md
    CHANGED
    
    | 
         @@ -91,8 +91,8 @@ bin/rails generate action_mcp:install 
     | 
|
| 
       91 
91 
     | 
    
         
             
            ```
         
     | 
| 
       92 
92 
     | 
    
         | 
| 
       93 
93 
     | 
    
         
             
            This command will create:
         
     | 
| 
       94 
     | 
    
         
            -
            - `app/prompts/application_prompt.rb`
         
     | 
| 
       95 
     | 
    
         
            -
            - `app/tools/application_tool.rb`
         
     | 
| 
      
 94 
     | 
    
         
            +
            - `app/mcp/prompts/application_prompt.rb`
         
     | 
| 
      
 95 
     | 
    
         
            +
            - `app/mcp/tools/application_tool.rb`
         
     | 
| 
       96 
96 
     | 
    
         | 
| 
       97 
97 
     | 
    
         
             
            #### Generate a New Prompt
         
     | 
| 
       98 
98 
     | 
    
         | 
| 
         @@ -102,7 +102,7 @@ Run the following command to generate a new prompt class: 
     | 
|
| 
       102 
102 
     | 
    
         
             
            bin/rails generate action_mcp:prompt AnalyzeCode
         
     | 
| 
       103 
103 
     | 
    
         
             
            ```
         
     | 
| 
       104 
104 
     | 
    
         | 
| 
       105 
     | 
    
         
            -
            This command will create a file at `app/prompts/analyze_code_prompt.rb` with content similar to:
         
     | 
| 
      
 105 
     | 
    
         
            +
            This command will create a file at `app/mcp/prompts/analyze_code_prompt.rb` with content similar to:
         
     | 
| 
       106 
106 
     | 
    
         | 
| 
       107 
107 
     | 
    
         
             
            ```ruby
         
     | 
| 
       108 
108 
     | 
    
         
             
            class AnalyzeCodePrompt < ApplicationPrompt
         
     | 
| 
         @@ -134,7 +134,7 @@ Similarly, run the following command to generate a new tool class: 
     | 
|
| 
       134 
134 
     | 
    
         
             
            bin/rails generate action_mcp:tool CalculateSum
         
     | 
| 
       135 
135 
     | 
    
         
             
            ```
         
     | 
| 
       136 
136 
     | 
    
         | 
| 
       137 
     | 
    
         
            -
            This command will create a file at `app/tools/calculate_sum_tool.rb` with content similar to:
         
     | 
| 
      
 137 
     | 
    
         
            +
            This command will create a file at `app/mcp/tools/calculate_sum_tool.rb` with content similar to:
         
     | 
| 
       138 
138 
     | 
    
         | 
| 
       139 
139 
     | 
    
         
             
            ```ruby
         
     | 
| 
       140 
140 
     | 
    
         
             
            class CalculateSumTool < ApplicationTool
         
     | 
    
        data/lib/action_mcp/engine.rb
    CHANGED
    
    | 
         @@ -30,5 +30,16 @@ module ActionMCP 
     | 
|
| 
       30 
30 
     | 
    
         
             
                    self.logger = ::Rails.logger
         
     | 
| 
       31 
31 
     | 
    
         
             
                  end
         
     | 
| 
       32 
32 
     | 
    
         
             
                end
         
     | 
| 
      
 33 
     | 
    
         
            +
             
     | 
| 
      
 34 
     | 
    
         
            +
                # Configure autoloading for the mcp/tools directory
         
     | 
| 
      
 35 
     | 
    
         
            +
                initializer "action_mcp.autoloading" do |app|
         
     | 
| 
      
 36 
     | 
    
         
            +
                  mcp_path = Rails.root.join("app/mcp")
         
     | 
| 
      
 37 
     | 
    
         
            +
             
     | 
| 
      
 38 
     | 
    
         
            +
                  if Dir.exist?(mcp_path)
         
     | 
| 
      
 39 
     | 
    
         
            +
                    Dir.glob(mcp_path.join("*")).select { |f| File.directory?(f) }.each do |dir|
         
     | 
| 
      
 40 
     | 
    
         
            +
                      Rails.autoloaders.main.push_dir(dir, namespace: Object)
         
     | 
| 
      
 41 
     | 
    
         
            +
                    end
         
     | 
| 
      
 42 
     | 
    
         
            +
                  end
         
     | 
| 
      
 43 
     | 
    
         
            +
                end
         
     | 
| 
       33 
44 
     | 
    
         
             
              end
         
     | 
| 
       34 
45 
     | 
    
         
             
            end
         
     | 
| 
         @@ -0,0 +1,19 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # frozen_string_literal: true
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            module ActionMCP
         
     | 
| 
      
 4 
     | 
    
         
            +
              module Transport
         
     | 
| 
      
 5 
     | 
    
         
            +
                module Resources
         
     | 
| 
      
 6 
     | 
    
         
            +
                  def send_resources_list(request_id)
         
     | 
| 
      
 7 
     | 
    
         
            +
                    send_jsonrpc_response(request_id, result: {  resources: [] })
         
     | 
| 
      
 8 
     | 
    
         
            +
                  end
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
                  def send_resource_templates_list(request_id)
         
     | 
| 
      
 11 
     | 
    
         
            +
                    send_jsonrpc_response(request_id, result: { templates: [] })
         
     | 
| 
      
 12 
     | 
    
         
            +
                  end
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
                  def send_resource_read(id, params)
         
     | 
| 
      
 15 
     | 
    
         
            +
                    send_jsonrpc_response(id, result: {})
         
     | 
| 
      
 16 
     | 
    
         
            +
                  end
         
     | 
| 
      
 17 
     | 
    
         
            +
                end
         
     | 
| 
      
 18 
     | 
    
         
            +
              end
         
     | 
| 
      
 19 
     | 
    
         
            +
            end
         
     | 
    
        data/lib/action_mcp/version.rb
    CHANGED
    
    
| 
         @@ -7,11 +7,11 @@ module ActionMCP 
     | 
|
| 
       7 
7 
     | 
    
         
             
                  source_root File.expand_path("templates", __dir__)
         
     | 
| 
       8 
8 
     | 
    
         
             
                  desc "Installs both ApplicationPrompt and ApplicationTool"
         
     | 
| 
       9 
9 
     | 
    
         
             
                  def create_application_prompt
         
     | 
| 
       10 
     | 
    
         
            -
                    template "application_prompt.rb", "app/prompts/application_prompt.rb"
         
     | 
| 
      
 10 
     | 
    
         
            +
                    template "application_prompt.rb", "app/mcp/prompts/application_prompt.rb"
         
     | 
| 
       11 
11 
     | 
    
         
             
                  end
         
     | 
| 
       12 
12 
     | 
    
         | 
| 
       13 
13 
     | 
    
         
             
                  def create_application_tool
         
     | 
| 
       14 
     | 
    
         
            -
                    template "application_tool.rb", "app/tools/application_tool.rb"
         
     | 
| 
      
 14 
     | 
    
         
            +
                    template "application_tool.rb", "app/mcp/tools/application_tool.rb"
         
     | 
| 
       15 
15 
     | 
    
         
             
                  end
         
     | 
| 
       16 
16 
     | 
    
         
             
                end
         
     | 
| 
       17 
17 
     | 
    
         
             
              end
         
     | 
| 
         @@ -5,13 +5,13 @@ module ActionMCP 
     | 
|
| 
       5 
5 
     | 
    
         
             
                class PromptGenerator < Rails::Generators::Base
         
     | 
| 
       6 
6 
     | 
    
         
             
                  namespace "action_mcp:prompt"
         
     | 
| 
       7 
7 
     | 
    
         
             
                  source_root File.expand_path("templates", __dir__)
         
     | 
| 
       8 
     | 
    
         
            -
                  desc "Creates a Prompt (in app/prompts) that inherits from ApplicationPrompt"
         
     | 
| 
      
 8 
     | 
    
         
            +
                  desc "Creates a Prompt (in app/mcp/prompts) that inherits from ApplicationPrompt"
         
     | 
| 
       9 
9 
     | 
    
         | 
| 
       10 
10 
     | 
    
         
             
                  # The generator takes one argument, e.g. "AnalyzeCode"
         
     | 
| 
       11 
11 
     | 
    
         
             
                  argument :name, type: :string, required: true, banner: "PromptName"
         
     | 
| 
       12 
12 
     | 
    
         | 
| 
       13 
13 
     | 
    
         
             
                  def create_prompt_file
         
     | 
| 
       14 
     | 
    
         
            -
                    template "prompt.rb.erb", "app/prompts/#{file_name}.rb"
         
     | 
| 
      
 14 
     | 
    
         
            +
                    template "prompt.rb.erb", "app/mcp/prompts/#{file_name}.rb"
         
     | 
| 
       15 
15 
     | 
    
         
             
                  end
         
     | 
| 
       16 
16 
     | 
    
         | 
| 
       17 
17 
     | 
    
         
             
                  private
         
     | 
| 
         @@ -5,13 +5,13 @@ module ActionMCP 
     | 
|
| 
       5 
5 
     | 
    
         
             
                class ToolGenerator < Rails::Generators::Base
         
     | 
| 
       6 
6 
     | 
    
         
             
                  namespace "action_mcp:tool"
         
     | 
| 
       7 
7 
     | 
    
         
             
                  source_root File.expand_path("templates", __dir__)
         
     | 
| 
       8 
     | 
    
         
            -
                  desc "Creates a Tool (in app/tools) that inherits from ApplicationTool"
         
     | 
| 
      
 8 
     | 
    
         
            +
                  desc "Creates a Tool (in app/mcp/tools) that inherits from ApplicationTool"
         
     | 
| 
       9 
9 
     | 
    
         | 
| 
       10 
10 
     | 
    
         
             
                  # The generator takes one argument, e.g. "CalculateSum"
         
     | 
| 
       11 
11 
     | 
    
         
             
                  argument :name, type: :string, required: true, banner: "ToolName"
         
     | 
| 
       12 
12 
     | 
    
         | 
| 
       13 
13 
     | 
    
         
             
                  def create_tool_file
         
     | 
| 
       14 
     | 
    
         
            -
                    template "tool.rb.erb", "app/tools/#{file_name}.rb"
         
     | 
| 
      
 14 
     | 
    
         
            +
                    template "tool.rb.erb", "app/mcp/tools/#{file_name}.rb"
         
     | 
| 
       15 
15 
     | 
    
         
             
                  end
         
     | 
| 
       16 
16 
     | 
    
         | 
| 
       17 
17 
     | 
    
         
             
                  private
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,13 +1,13 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: actionmcp
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.3.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Abdelkader Boudih
         
     | 
| 
       8 
8 
     | 
    
         
             
            bindir: exe
         
     | 
| 
       9 
9 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       10 
     | 
    
         
            -
            date: 2025-03- 
     | 
| 
      
 10 
     | 
    
         
            +
            date: 2025-03-13 00:00:00.000000000 Z
         
     | 
| 
       11 
11 
     | 
    
         
             
            dependencies:
         
     | 
| 
       12 
12 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       13 
13 
     | 
    
         
             
              name: railties
         
     | 
| 
         @@ -147,6 +147,7 @@ files: 
     | 
|
| 
       147 
147 
     | 
    
         
             
            - lib/action_mcp/transport/capabilities.rb
         
     | 
| 
       148 
148 
     | 
    
         
             
            - lib/action_mcp/transport/messaging.rb
         
     | 
| 
       149 
149 
     | 
    
         
             
            - lib/action_mcp/transport/prompts.rb
         
     | 
| 
      
 150 
     | 
    
         
            +
            - lib/action_mcp/transport/resources.rb
         
     | 
| 
       150 
151 
     | 
    
         
             
            - lib/action_mcp/transport/sse_client.rb
         
     | 
| 
       151 
152 
     | 
    
         
             
            - lib/action_mcp/transport/stdio_client.rb
         
     | 
| 
       152 
153 
     | 
    
         
             
            - lib/action_mcp/transport/tools.rb
         
     |