Class: Clacky::Mcp::SkillProvider

Inherits:
Object
  • Object
show all
Defined in:
lib/clacky/mcp/skill_provider.rb

Overview

Static, read-only provider that translates ~/.clacky/mcp.json (and the project-level override) into VirtualSkill instances for the SkillLoader.

Unlike Mcp::Registry, this class never spawns server processes, never talks JSON-RPC, and holds no mutable state. All actual MCP traffic flows through the local Clacky HTTP API (/api/mcp/:server/tools and /call), which subagents reach via curl. This keeps agents process-light and decouples skill discovery from server lifecycle.

Instance Method Summary collapse

Constructor Details

#initialize(working_dir: nil) ⇒ SkillProvider

Returns a new instance of SkillProvider.



18
19
20
# File 'lib/clacky/mcp/skill_provider.rb', line 18

def initialize(working_dir: nil)
  @working_dir = working_dir
end

Instance Method Details

#virtual_skillsObject



22
23
24
25
26
27
28
29
# File 'lib/clacky/mcp/skill_provider.rb', line 22

def virtual_skills
  load_servers.map do |name, spec|
    VirtualSkill.new(
      server_name: name,
      description: spec["description"] || default_description_for(name)
    )
  end
end