Class: Riffer::Mcp::Manifest

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

Overview

Holds the configuration for a single MCP server.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

Instance Attribute Details

#credentials_scopeObject (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_headersObject (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

#endpointObject (readonly)

HTTPS URL passed to the MCP transport.



15
16
17
# File 'lib/riffer/mcp/manifest.rb', line 15

def endpoint
  @endpoint
end

#nameObject (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

#tagsObject (readonly)

Tags for matching use_mcp.



12
13
14
# File 'lib/riffer/mcp/manifest.rb', line 12

def tags
  @tags
end