Class: Crumb::MCP::Registry

Inherits:
Object
  • Object
show all
Defined in:
lib/crumb/mcp/registry.rb

Constant Summary collapse

CONFIG_PATH =
File.expand_path("~/.config/crumb/config.yml")

Class Method Summary collapse

Class Method Details

.all_slugsObject



9
10
11
# File 'lib/crumb/mcp/registry.rb', line 9

def all_slugs
  endpoints.keys
end

.endpoint_for(slug) ⇒ Object

Raises:

  • (ArgumentError)


13
14
15
16
17
18
19
20
21
# File 'lib/crumb/mcp/registry.rb', line 13

def endpoint_for(slug)
  ep = endpoints[slug]
  raise ArgumentError, "Unknown Crumb endpoint: #{slug}" unless ep
  {
    base_url:  ep["base_url"],
    token_env: ep["token_env"],
    repo_path: ep["repo_path"] && File.expand_path(ep["repo_path"])
  }
end