actionmcp 0.103.0 → 0.104.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0b98e5c438f85bfe710dbe07d1b9cc2a12d7347b4fc200c66a0492f380615599
4
- data.tar.gz: 921adb81f040f14533248ce6c52b142a85d8445299e19a83501171b344601c11
3
+ metadata.gz: 3f008e25bbf68f4c85a29052acb37e59324d302fe5b53c209f7370e80c62e21e
4
+ data.tar.gz: 8d436c6029b33e6e46b43689ea9ab063b7e8474146263d72bbbfc888fffb4b56
5
5
  SHA512:
6
- metadata.gz: 9aee10304fc9e926a34805c760545adb565b5a19dd7fe59e445ed938d82b2e92e9e7d8e5762db2a5dfc12a844fdbbfb9b84ed7a15f2879703fe7c83b6eb29ec2
7
- data.tar.gz: 4b35888139f56c100415e64f495e61efcd43eac2652bf99b1dfbf1ae269fb317d19fad9f0a1ee99b8a19d1e2a36dd3d1818d4ff76a67456f7e9c7edc21457fb7
6
+ metadata.gz: 2f3bf909be5df38c2ca0377ac0773d6b61bfd776f25b2148aae0d218241ee80879ab43fd49dbc6b206985cf9e96a6ffe421ff0158dec48f9d9368690342b6419
7
+ data.tar.gz: 75ad95eb4c7bd7b309e2db5ae7f47722c620e1d585aed0c30f186eaec55bfa4637b99865fe7613e01b7eb217e7e6d28555b8b8ef4695c14c21a97fbbd8e94c52
data/README.md CHANGED
@@ -470,6 +470,12 @@ module Tron
470
470
  config.action_mcp.version = "1.2.3" # defaults to "0.0.1"
471
471
  config.action_mcp.logging_enabled = true # defaults to true
472
472
  config.action_mcp.logging_level = :info # defaults to :info, can be :debug, :info, :warn, :error, :fatal
473
+
474
+ # Server instructions - helps LLMs understand the server's purpose
475
+ config.action_mcp.server_instructions = [
476
+ "Use this server to access and control Tron system programs",
477
+ "Helpful for managing system processes and user data"
478
+ ]
473
479
  end
474
480
  end
475
481
  ```
@@ -521,6 +527,35 @@ production:
521
527
  max_queue: 500 # Maximum number of tasks that can be queued
522
528
  ```
523
529
 
530
+ ### Server Instructions
531
+
532
+ Server instructions help LLMs understand **what your server is for** and **when to use it**. They describe the server's purpose and goal, not technical details like rate limits or authentication (tools are self-documented via their own descriptions).
533
+
534
+ Instructions are returned at the top level of the MCP initialization response.
535
+
536
+ You can configure server instructions in your `config/mcp.yml` file:
537
+
538
+ ```yaml
539
+ shared:
540
+ # Describe the server's purpose - helps LLMs know when to use this server
541
+ server_instructions:
542
+ - "Use this server to manage Fizzy project tickets and workflows"
543
+ - "Helpful for tracking bugs, features, and sprint planning"
544
+
545
+ development:
546
+ # Development-specific purpose description
547
+ server_instructions:
548
+ - "Development server for testing Fizzy integration"
549
+ - "Use for prototyping ticket management workflows"
550
+
551
+ production:
552
+ # Production-specific purpose description
553
+ server_instructions:
554
+ - "Production Fizzy server for managing live project data"
555
+ ```
556
+
557
+ Instructions are sent as a single string (joined by newlines) at the top level of the initialization response, helping LLMs understand your server's purpose.
558
+
524
559
  #### SolidMCP (Database-backed, Recommended)
525
560
 
526
561
  For SolidMCP, add it to your Gemfile:
@@ -140,11 +140,15 @@ module ActionMCP
140
140
  end
141
141
 
142
142
  def server_capabilities_payload
143
- {
143
+ payload = {
144
144
  protocolVersion: protocol_version || ActionMCP::DEFAULT_PROTOCOL_VERSION,
145
145
  serverInfo: server_info,
146
146
  capabilities: server_capabilities
147
147
  }
148
+ # Add instructions at top level if configured
149
+ instructions = ActionMCP.configuration.instructions
150
+ payload[:instructions] = instructions if instructions
151
+ payload
148
152
  end
149
153
 
150
154
  def server_capabilities
@@ -359,10 +363,7 @@ module ActionMCP
359
363
 
360
364
  # This will keep the version and name of the server when this session was created
361
365
  def set_server_info
362
- self.server_info = {
363
- name: ActionMCP.configuration.name,
364
- version: ActionMCP.configuration.version
365
- }
366
+ self.server_info = ActionMCP.configuration.server_info
366
367
  end
367
368
 
368
369
  # This can be overridden by the application in future versions
@@ -44,12 +44,12 @@ module ActionMCP
44
44
  :max_queue,
45
45
  :polling_interval,
46
46
  :connects_to,
47
- # --- Tasks Options (MCP 2025-11-25) ---
48
- :tasks_enabled,
49
- :tasks_list_enabled,
50
- :tasks_cancel_enabled,
51
- # --- Schema Validation Options ---
52
- :validate_structured_content
47
+ # --- Tasks Options (MCP 2025-11-25) ---
48
+ :tasks_enabled,
49
+ :tasks_list_enabled,
50
+ :tasks_cancel_enabled,
51
+ # --- Schema Validation Options ---
52
+ :validate_structured_content
53
53
 
54
54
  def initialize
55
55
  @logging_enabled = false
@@ -74,6 +74,9 @@ module ActionMCP
74
74
  # Schema validation - disabled by default for backward compatibility
75
75
  @validate_structured_content = false
76
76
 
77
+ # Server instructions - empty by default
78
+ @server_instructions = []
79
+
77
80
  # Gateway - resolved lazily to account for Zeitwerk autoloading
78
81
  @gateway_class_name = nil
79
82
 
@@ -91,6 +94,30 @@ module ActionMCP
91
94
  @version || (has_rails_version ? Rails.application.version.to_s : "0.0.1")
92
95
  end
93
96
 
97
+ # Server information (name and version only)
98
+ def server_info
99
+ {
100
+ name: name,
101
+ version: version
102
+ }
103
+ end
104
+
105
+ # Instructions for LLMs about the server's purpose (joined as string for MCP payload)
106
+ def instructions
107
+ return nil if server_instructions.nil? || server_instructions.empty?
108
+
109
+ server_instructions.join("\n")
110
+ end
111
+
112
+ # Custom getter/setter to ensure array elements are strings
113
+ def server_instructions
114
+ @server_instructions
115
+ end
116
+
117
+ def server_instructions=(value)
118
+ @server_instructions = parse_instructions(value)
119
+ end
120
+
94
121
  def gateway_class
95
122
  # Resolve gateway class lazily to account for Zeitwerk autoloading
96
123
  # This allows ApplicationGateway to be loaded from app/mcp even if the
@@ -343,9 +370,14 @@ module ActionMCP
343
370
  @client_session_store_type = config["client_session_store_type"].to_sym
344
371
  end
345
372
 
346
- return unless config["server_session_store_type"]
373
+ if config["server_session_store_type"]
374
+ @server_session_store_type = config["server_session_store_type"].to_sym
375
+ end
347
376
 
348
- @server_session_store_type = config["server_session_store_type"].to_sym
377
+ # Extract server instructions
378
+ if config["server_instructions"]
379
+ @server_instructions = parse_instructions(config["server_instructions"])
380
+ end
349
381
  end
350
382
 
351
383
  def should_include_all?(type)
@@ -364,6 +396,10 @@ module ActionMCP
364
396
  false
365
397
  end
366
398
 
399
+ def parse_instructions(instructions)
400
+ Array(instructions).map(&:to_s)
401
+ end
402
+
367
403
  def ensure_mcp_components_loaded
368
404
  # Only load if we haven't loaded yet - but in development, always reload
369
405
  return if @mcp_components_loaded && !Rails.env.development?
@@ -128,11 +128,15 @@ module ActionMCP
128
128
 
129
129
  # Capability methods
130
130
  def server_capabilities_payload
131
- {
131
+ payload = {
132
132
  protocolVersion: ActionMCP::LATEST_VERSION,
133
133
  serverInfo: server_info,
134
134
  capabilities: server_capabilities
135
135
  }
136
+ # Add instructions at top level if configured
137
+ instructions = ActionMCP.configuration.instructions
138
+ payload[:instructions] = instructions if instructions
139
+ payload
136
140
  end
137
141
 
138
142
  def set_protocol_version(version)
@@ -2,7 +2,7 @@
2
2
 
3
3
  require_relative "gem_version"
4
4
  module ActionMCP
5
- VERSION = "0.103.0"
5
+ VERSION = "0.104.0"
6
6
 
7
7
  class << self
8
8
  alias version gem_version
@@ -22,14 +22,14 @@ class <%= class_name %> < ActionMCP::GatewayIdentifier
22
22
  private
23
23
 
24
24
  # Add any custom helper methods here
25
- #
25
+ #
26
26
  # Example helper methods:
27
- #
27
+ #
28
28
  # def extract_credentials_from_request
29
29
  # # Custom extraction logic
30
30
  # end
31
- #
31
+ #
32
32
  # def validate_credentials(credentials)
33
33
  # # Custom validation logic
34
34
  # end
35
- end
35
+ end
@@ -16,6 +16,11 @@ shared:
16
16
  # Server-specific session store type (falls back to session_store_type if not specified)
17
17
  # server_session_store_type: active_record
18
18
 
19
+ # Server instructions - helps LLMs understand the server's purpose
20
+ # Describe what the server is for, not technical details (tools are self-documented)
21
+ # server_instructions:
22
+ # - "Use this server to manage project tickets and workflows"
23
+ # - "Helpful for tracking bugs, features, and sprint planning"
19
24
 
20
25
  # MCP capability profiles
21
26
  profiles:
@@ -46,6 +51,11 @@ development:
46
51
  # Use simple pub/sub adapter for development
47
52
  adapter: simple
48
53
 
54
+ # Development-specific purpose description
55
+ # server_instructions:
56
+ # - "Development server for testing your MCP integration"
57
+ # - "Use for prototyping and experimenting with tools"
58
+
49
59
  # Session store examples for development
50
60
  # Use volatile client sessions for faster development
51
61
  # client_session_store_type: volatile
@@ -106,4 +116,4 @@ production:
106
116
  # channel_prefix: my_mcp_app_production
107
117
  # min_threads: 10 # Minimum number of threads in the pool
108
118
  # max_threads: 20 # Maximum number of threads in the pool
109
- # max_queue: 500 # Maximum number of tasks that can be queued
119
+ # max_queue: 500 # Maximum number of tasks that can be queued
@@ -34,12 +34,12 @@ class <%= class_name %> < ApplicationMCPTool
34
34
 
35
35
  # Uncomment to allow additional properties beyond those defined above:
36
36
  # additional_properties true # Allow any additional properties
37
- # additional_properties false # Explicitly disallow additional properties
37
+ # additional_properties false # Explicitly disallow additional properties
38
38
  # additional_properties({"type" => "string"}) # Allow additional properties but restrict to strings
39
39
 
40
40
  def perform
41
41
  render(text: "Processing <%= properties.map { |p| p[:name] }.join(', ') %>")
42
-
42
+
43
43
  # If additional_properties is enabled, you can access extra parameters:
44
44
  # extra_params = additional_params
45
45
  # extra_params.each do |key, value|
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.103.0
4
+ version: 0.104.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Abdelkader Boudih
@@ -302,7 +302,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
302
302
  - !ruby/object:Gem::Version
303
303
  version: '0'
304
304
  requirements: []
305
- rubygems_version: 4.0.3
305
+ rubygems_version: 4.0.1
306
306
  specification_version: 4
307
307
  summary: Lightweight Model Context Protocol (MCP) server toolkit for Ruby/Rails
308
308
  test_files: []