Class: Riffer::Mcp::Manifest

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

Overview

Riffer::Mcp::Manifest holds the configuration for a single MCP server.

name - String identifier used as the registration key and generated-agent identifier. tags - Array; normalized to symbols at construction time. endpoint - String HTTPS URL passed to the MCP transport. discovery_headers - Hash or Proc; resolved once when building the discovery client for tools/list. credentials_scope - Optional symbol hint: :global, :tenant, :user — documents whether

invocation credentials are expected to depend on tenant and/or user keys in +context+ (no ids stored).
Apps may treat +:user+ as "user in tenant" and pass both keys in +context+.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, endpoint:, tags: nil, discovery_headers: nil, credentials_scope: nil) ⇒ Manifest

– : (name: String, endpoint: String, ?tags: Array?, ?discovery_headers: (Hash[String, untyped] | ::Proc)?, ?credentials_scope: (String | Symbol)?) -> void



25
26
27
28
29
30
31
32
33
34
35
# File 'lib/riffer/mcp/manifest.rb', line 25

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(tags).map(&:to_sym)
  @discovery_headers = discovery_headers
  @credentials_scope = credentials_scope&.to_sym
end

Instance Attribute Details

#credentials_scopeObject (readonly)

: Symbol?



21
22
23
# File 'lib/riffer/mcp/manifest.rb', line 21

def credentials_scope
  @credentials_scope
end

#discovery_headersObject (readonly)

: (Hash[String, untyped] | ::Proc)?



20
21
22
# File 'lib/riffer/mcp/manifest.rb', line 20

def discovery_headers
  @discovery_headers
end

#endpointObject (readonly)

: String



19
20
21
# File 'lib/riffer/mcp/manifest.rb', line 19

def endpoint
  @endpoint
end

#nameObject (readonly)

: String



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

def name
  @name
end

#tagsObject (readonly)

: Array



18
19
20
# File 'lib/riffer/mcp/manifest.rb', line 18

def tags
  @tags
end