Class: Riffer::Mcp::Manifest
- Inherits:
-
Object
- Object
- Riffer::Mcp::Manifest
- Defined in:
- lib/riffer/mcp/manifest.rb,
sig/generated/riffer/mcp/manifest.rbs
Overview
Holds the configuration for a single MCP server.
Instance Attribute Summary collapse
-
#credentials_scope ⇒ Symbol?
readonly
Optional hint (+:global+/+:tenant+/+:user+) for whether invocation credentials depend on tenant/user keys in
context. -
#discovery_headers ⇒ Hash[String, untyped], ...
readonly
Headers (or a Proc) resolved once when building the discovery client.
-
#endpoint ⇒ String
readonly
HTTPS URL passed to the MCP transport.
-
#name ⇒ String
readonly
Identifier used as the registration key and generated-agent identifier.
-
#tags ⇒ Array[Symbol]
readonly
Tags for matching
use_mcp.
Instance Method Summary collapse
-
#initialize(name:, endpoint:, tags: nil, discovery_headers: nil, credentials_scope: nil) ⇒ Manifest
constructor
Raises Riffer::ArgumentError unless
nameis present andendpointis a valid HTTPS URL. - #valid_endpoint? ⇒ Boolean
Constructor Details
#initialize(name:, endpoint:, tags: nil, discovery_headers: nil, credentials_scope: nil) ⇒ Manifest
Raises Riffer::ArgumentError unless name is present and endpoint is a
valid HTTPS URL.
: (name: String, endpoint: String, ?tags: Array?, ?discovery_headers: (Hash[String, untyped] | ::Proc)?, ?credentials_scope: (String | Symbol)?) -> void
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/riffer/mcp/manifest.rb', line 28 def initialize(name:, endpoint:, tags: nil, discovery_headers: nil, credentials_scope: nil) @name = name.to_s.strip raise Riffer::ArgumentError, "MCP manifest name is required" if @name.empty? @endpoint = endpoint.to_s.strip raise Riffer::ArgumentError, "MCP manifest endpoint must be a valid HTTPS URL" unless valid_endpoint? @tags = Array().map(&:to_sym) @discovery_headers = discovery_headers @credentials_scope = credentials_scope&.to_sym end |
Instance Attribute Details
#credentials_scope ⇒ Symbol? (readonly)
Optional hint (+:global+/+:tenant+/+:user+) for whether invocation
credentials depend on tenant/user keys in context.
22 23 24 |
# File 'lib/riffer/mcp/manifest.rb', line 22 def credentials_scope @credentials_scope end |
#discovery_headers ⇒ Hash[String, untyped], ... (readonly)
Headers (or a Proc) resolved once when building the discovery client.
18 19 20 |
# File 'lib/riffer/mcp/manifest.rb', line 18 def discovery_headers @discovery_headers end |
#endpoint ⇒ String (readonly)
HTTPS URL passed to the MCP transport.
15 16 17 |
# File 'lib/riffer/mcp/manifest.rb', line 15 def endpoint @endpoint end |
#name ⇒ String (readonly)
Identifier used as the registration key and generated-agent identifier.
9 10 11 |
# File 'lib/riffer/mcp/manifest.rb', line 9 def name @name end |
#tags ⇒ Array[Symbol] (readonly)
Tags for matching use_mcp.
12 13 14 |
# File 'lib/riffer/mcp/manifest.rb', line 12 def @tags end |
Instance Method Details
#valid_endpoint? ⇒ Boolean
42 43 44 45 46 47 |
# File 'lib/riffer/mcp/manifest.rb', line 42 def valid_endpoint? uri = URI.parse(@endpoint) uri.is_a?(URI::HTTPS) && uri.host rescue URI::InvalidURIError false end |