Method: ActionMCP::Configuration#capabilities

Defined in:
lib/action_mcp/configuration.rb

#capabilitiesObject

Returns capabilities based on active profile



207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
# File 'lib/action_mcp/configuration.rb', line 207

def capabilities
  capabilities = {}
  profile = @profiles[active_profile]

  # Check profile configuration instead of registry contents
  # If profile includes tools (either "all" or specific tools), advertise tools capability
  capabilities[:tools] = { listChanged: @list_changed } if profile && profile[:tools]&.any?

  # If profile includes prompts, advertise prompts capability
  capabilities[:prompts] = { listChanged: @list_changed } if profile && profile[:prompts]&.any?

  capabilities[:logging] = {} if @logging_enabled

  # If profile includes resources, advertise resources capability
  if profile && profile[:resources]&.any?
    capabilities[:resources] = { subscribe: @resources_subscribe, listChanged: @list_changed }
  end

  capabilities[:elicitation] = {} if @elicitation_enabled

  # Tasks capability (MCP 2025-11-25)
  if @tasks_enabled
    tasks_cap = {
      requests: {
        tools: { call: {} }
      }
    }
    tasks_cap[:list] = {} if @tasks_list_enabled
    tasks_cap[:cancel] = {} if @tasks_cancel_enabled
    capabilities[:tasks] = tasks_cap
  end

  capabilities
end