Class: Riffer::Mcp::Registration
- Inherits:
-
Object
- Object
- Riffer::Mcp::Registration
- 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
-
#manifest ⇒ Object
readonly
The manifest that describes this server.
Instance Method Summary collapse
-
#initialize(manifest) ⇒ Registration
constructor
– : (Riffer::Mcp::Manifest) -> void.
-
#retire! ⇒ Object
Retires this registration, preventing in-flight discovery from publishing state.
-
#retired? ⇒ Boolean
Returns true if this registration has been retired.
-
#tools ⇒ Object
Generated Riffer::Tool subclasses.
Constructor Details
#initialize(manifest) ⇒ Registration
– : (Riffer::Mcp::Manifest) -> void
27 28 29 30 31 32 33 |
# File 'lib/riffer/mcp/registration.rb', line 27 def initialize(manifest) @manifest = manifest @cancelled = false @tools = [] #: Array[singleton(Riffer::Tool)] @mutex = Mutex.new run_discovery end |
Instance Attribute Details
#manifest ⇒ Object (readonly)
The manifest that describes this server.
15 16 17 |
# File 'lib/riffer/mcp/registration.rb', line 15 def manifest @manifest end |
Instance Method Details
#retire! ⇒ Object
Retires this registration, preventing in-flight discovery from publishing state.
– : () -> void
40 41 42 |
# File 'lib/riffer/mcp/registration.rb', line 40 def retire! @mutex.synchronize { @cancelled = true } end |
#retired? ⇒ Boolean
Returns true if this registration has been retired.
– : () -> bool
48 49 50 |
# File 'lib/riffer/mcp/registration.rb', line 48 def retired? @mutex.synchronize { @cancelled } end |
#tools ⇒ Object
Generated Riffer::Tool subclasses.
– : () -> Array
21 22 23 |
# File 'lib/riffer/mcp/registration.rb', line 21 def tools @mutex.synchronize { @tools } end |