Class: Riffer::Mcp::Registration

Inherits:
Object
  • Object
show all
Defined in:
lib/riffer/mcp/registration.rb

Overview

Per-server state managed by Riffer::Mcp::Registry.

Created when a server is registered. Discovers tools via the MCP tools/list call, then generates tool classes.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(manifest) ⇒ Registration

– : (Riffer::Mcp::Manifest) -> void



23
24
25
26
27
28
29
# File 'lib/riffer/mcp/registration.rb', line 23

def initialize(manifest)
  @manifest = manifest
  @cancelled = false
  @tools = []
  @mutex = Mutex.new
  run_discovery
end

Instance Attribute Details

#manifestObject (readonly)

The manifest that describes this server.



11
12
13
# File 'lib/riffer/mcp/registration.rb', line 11

def manifest
  @manifest
end

Instance Method Details

#retire!Object

Retires this registration, preventing in-flight discovery from publishing state.

– : () -> void



36
37
38
# File 'lib/riffer/mcp/registration.rb', line 36

def retire!
  @mutex.synchronize { @cancelled = true }
end

#retired?Boolean

Returns true if this registration has been retired.

– : () -> bool

Returns:



44
45
46
# File 'lib/riffer/mcp/registration.rb', line 44

def retired?
  @mutex.synchronize { @cancelled }
end

#toolsObject

Generated Riffer::Tool subclasses.

– : () -> Array



17
18
19
# File 'lib/riffer/mcp/registration.rb', line 17

def tools
  @mutex.synchronize { @tools }
end