Class: StimulusPlumbers::MCP::Plugins::Icons

Inherits:
Base
  • Object
show all
Defined in:
lib/stimulus_plumbers/mcp/plugins/icons.rb

Class Method Summary collapse

Methods inherited from Base

dynamic_resource_templates, json_resource, not_found, text_resource, text_tool

Class Method Details

.loaderObject



10
# File 'lib/stimulus_plumbers/mcp/plugins/icons.rb', line 10

def loader = IconsLoader

.loader_keyObject



8
# File 'lib/stimulus_plumbers/mcp/plugins/icons.rb', line 8

def loader_key = :icons

.read(uri, store) ⇒ Object



23
24
25
26
27
# File 'lib/stimulus_plumbers/mcp/plugins/icons.rb', line 23

def read(uri, store)
  return unless uri == "component://icons"

  json_resource(uri, store[:icons])
end

.register_tools(server, store) ⇒ Object



29
30
31
32
33
34
35
36
37
# File 'lib/stimulus_plumbers/mcp/plugins/icons.rb', line 29

def register_tools(server, store)
  text_tool(
    server,
    name:        "list_icons",
    description: "Lists all available icon names bundled with the Tailwind theme"
  ) do
    JSON.generate(store[:icons])
  end
end

.static_resourcesObject



12
13
14
15
16
17
18
19
20
21
# File 'lib/stimulus_plumbers/mcp/plugins/icons.rb', line 12

def static_resources
  [
    ::MCP::Resource.new(
      uri:         "component://icons",
      name:        "icons",
      description: "All available icon names bundled with the Tailwind theme",
      mime_type:   "application/json"
    )
  ].freeze
end