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
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
#manifest ⇒ Object (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
44 45 46 |
# File 'lib/riffer/mcp/registration.rb', line 44 def retired? @mutex.synchronize { @cancelled } end |
#tools ⇒ Object
Generated Riffer::Tool subclasses.
– : () -> Array
17 18 19 |
# File 'lib/riffer/mcp/registration.rb', line 17 def tools @mutex.synchronize { @tools } end |