actionmcp 0.80.0 → 0.80.1
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/app/models/concerns/{mcp_console_helpers.rb → action_mcp/mcp_console_helpers.rb} +4 -3
- data/app/models/concerns/{mcp_message_inspect.rb → action_mcp/mcp_message_inspect.rb} +4 -3
- data/lib/action_mcp/resource_template.rb +1 -0
- data/lib/action_mcp/server/resources.rb +8 -7
- data/lib/action_mcp/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6251e9ce3e87878bf86bb3ca1bbfd3363fb4fedccd9567a0b9b6c42fbc87241a
|
4
|
+
data.tar.gz: ee8f4bdd5ad42c611f7f652f836e40ce0477510e9c0e856a0a32eaa447b77718
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80712d1d14d91fb087bf8bd35c4cedb61ea22015a958dc5c66df64dfa7872d0755ea08a4ecbe02c1b577bb14eff8bcd30aaaa78ffba61c4b6e16ea37c336c313
|
7
|
+
data.tar.gz: '0920ffdcb46a86910789282365a7ff6391ec4a1bf424be3dee7b8174497953df4aa73098e89a58559bb59d8157791d7620045339e763b3b27c885037b5e420fd'
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
module MCPConsoleHelpers
|
5
|
-
|
3
|
+
module ActionMCP
|
4
|
+
module MCPConsoleHelpers
|
5
|
+
extend ActiveSupport::Concern
|
6
6
|
|
7
7
|
class_methods do
|
8
8
|
def pretty_messages(session_or_messages, limit: 10)
|
@@ -65,4 +65,5 @@ module MCPConsoleHelpers
|
|
65
65
|
def message_flow(limit: 50)
|
66
66
|
self.class.message_flow(self, limit: limit)
|
67
67
|
end
|
68
|
+
end
|
68
69
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
module MCPMessageInspect
|
5
|
-
|
3
|
+
module ActionMCP
|
4
|
+
module MCPMessageInspect
|
5
|
+
extend ActiveSupport::Concern
|
6
6
|
|
7
7
|
def inspect(show_data: false)
|
8
8
|
if show_data
|
@@ -70,4 +70,5 @@ module MCPMessageInspect
|
|
70
70
|
|
71
71
|
"#{colors[color]}#{text}\e[0m"
|
72
72
|
end
|
73
|
+
end
|
73
74
|
end
|
@@ -45,10 +45,11 @@ module ActionMCP
|
|
45
45
|
# @example Output:
|
46
46
|
# # Sends: {"jsonrpc":"2.0","id":"req-789","result":{"contents":[{"uri":"file:///example.txt","text":"Example content"}]}}
|
47
47
|
def send_resource_read(id, params)
|
48
|
-
|
48
|
+
uri = params["uri"]
|
49
|
+
template = ResourceTemplatesRegistry.find_template_for_uri(uri)
|
49
50
|
|
50
51
|
unless template
|
51
|
-
send_jsonrpc_error(id, :
|
52
|
+
send_jsonrpc_error(id, :method_not_found, "No resource template found for URI: '#{uri}'")
|
52
53
|
return
|
53
54
|
end
|
54
55
|
|
@@ -65,21 +66,21 @@ module ActionMCP
|
|
65
66
|
|
66
67
|
begin
|
67
68
|
# Create template instance and set execution context
|
68
|
-
record = template.process(
|
69
|
+
record = template.process(uri)
|
69
70
|
record.with_context({ session: session })
|
70
71
|
|
71
72
|
response = record.call
|
72
73
|
|
73
74
|
if response.error?
|
74
|
-
#
|
75
|
-
|
76
|
-
send_jsonrpc_error(id, error_info[:code], error_info[:message], error_info[:data])
|
75
|
+
# response.to_h works properly when error? is true:
|
76
|
+
send_jsonrpc_response(id, error: response.to_h)
|
77
77
|
else
|
78
78
|
# Handle successful response - ResourceResponse.contents is already an array
|
79
79
|
send_jsonrpc_response(id, result: { contents: response.contents.map(&:to_h) })
|
80
80
|
end
|
81
81
|
rescue StandardError => e
|
82
|
-
|
82
|
+
# Should rather `ErrorHandling` module be included here? Then we could use `log_error(e)` directly.
|
83
|
+
Rails.logger.error "[MCP Error] #{e.class}: #{e.message}"
|
83
84
|
send_jsonrpc_error(id, :internal_error, "Failed to read resource: #{e.message}")
|
84
85
|
end
|
85
86
|
end
|
data/lib/action_mcp/version.rb
CHANGED
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.80.
|
4
|
+
version: 0.80.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Abdelkader Boudih
|
@@ -142,8 +142,8 @@ files:
|
|
142
142
|
- app/models/action_mcp/session/resource.rb
|
143
143
|
- app/models/action_mcp/session/sse_event.rb
|
144
144
|
- app/models/action_mcp/session/subscription.rb
|
145
|
-
- app/models/concerns/mcp_console_helpers.rb
|
146
|
-
- app/models/concerns/mcp_message_inspect.rb
|
145
|
+
- app/models/concerns/action_mcp/mcp_console_helpers.rb
|
146
|
+
- app/models/concerns/action_mcp/mcp_message_inspect.rb
|
147
147
|
- config/routes.rb
|
148
148
|
- db/migrate/20250512154359_consolidated_migration.rb
|
149
149
|
- db/migrate/20250715070713_add_consents_to_action_mcp_sess.rb
|