Class: Relay::Forms::MCP::GitHub

Inherits:
Relay::Forms::MCP show all
Defined in:
app/forms/mcp/github.rb

Overview

The GitHub class represents form state for Relay’s GitHub MCP preset.

Instance Attribute Summary collapse

Attributes inherited from Relay::Forms::MCP

#id

Instance Method Summary collapse

Methods inherited from Relay::Forms::MCP

build, from_model, from_params, #persisted?

Constructor Details

#initialize(token: "", **attributes) ⇒ Relay::Forms::MCP::GitHub

Parameters:

  • token (String) (defaults to: "")

    The GitHub bearer token without the ‘Bearer ` prefix

  • attributes (Hash)


17
18
19
20
# File 'app/forms/mcp/github.rb', line 17

def initialize(token: "", **attributes)
  super(**attributes)
  @token = token.to_s.strip
end

Instance Attribute Details

#tokenString (readonly)

Returns the GitHub bearer token without the ‘Bearer ` prefix

Returns:

  • (String)

    Returns the GitHub bearer token without the ‘Bearer ` prefix



11
12
13
# File 'app/forms/mcp/github.rb', line 11

def token
  @token
end

Instance Method Details

#dataHash

Returns the preset-specific MCP data overrides

Returns:

  • (Hash)

    Returns the preset-specific MCP data overrides



39
40
41
42
43
44
45
# File 'app/forms/mcp/github.rb', line 39

def data
  {
    "headers" => {
      "Authorization" => "Bearer #{token}"
    }
  }
end

#presetString

Returns the preset id

Returns:

  • (String)

    Returns the preset id



25
26
27
# File 'app/forms/mcp/github.rb', line 25

def preset
  "github"
end

#transportString

Returns the backing MCP transport

Returns:

  • (String)

    Returns the backing MCP transport



32
33
34
# File 'app/forms/mcp/github.rb', line 32

def transport
  "http"
end