Class: Relay::Forms::MCP::Forgejo

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

Overview

The Forgejo class represents form state for Relay’s Forgejo 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(url: "", token: "", **attributes) ⇒ Relay::Forms::MCP::Forgejo

Parameters:

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

    The Forgejo instance URL

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

    The Forgejo access token

  • attributes (Hash)


23
24
25
26
27
# File 'app/forms/mcp/forgejo.rb', line 23

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

Instance Attribute Details

#tokenString (readonly)

Returns the Forgejo access token

Returns:

  • (String)

    Returns the Forgejo access token



16
17
18
# File 'app/forms/mcp/forgejo.rb', line 16

def token
  @token
end

#urlString (readonly)

Returns the Forgejo instance URL

Returns:

  • (String)

    Returns the Forgejo instance URL



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

def url
  @url
end

Instance Method Details

#dataHash

Returns the preset-specific MCP data overrides

Returns:

  • (Hash)

    Returns the preset-specific MCP data overrides



46
47
48
49
50
51
52
53
# File 'app/forms/mcp/forgejo.rb', line 46

def data
  {
    "env" => {
      "FORGEJO_URL" => url,
      "FORGEJO_TOKEN" => token
    }
  }
end

#presetString

Returns the preset id

Returns:

  • (String)

    Returns the preset id



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

def preset
  "forgejo"
end

#transportString

Returns the backing MCP transport

Returns:

  • (String)

    Returns the backing MCP transport



39
40
41
# File 'app/forms/mcp/forgejo.rb', line 39

def transport
  "stdio"
end