Class: RailsAiBridge::Config::Server

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_ai_bridge/config/server.rb

Overview

Holds MCP server transport and extensibility settings.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize ⇒ Server

Returns a new instance of Server.



37
38
39
40
41
42
43
44
45
46
47
# File 'lib/rails_ai_bridge/config/server.rb', line 37

def initialize
  @server_name        = 'rails-ai-bridge'
  @server_version     = RailsAiBridge::VERSION
  @http_path          = '/mcp'
  @http_bind          = '127.0.0.1'
  @http_port          = 6029
  @auto_mount         = false
  @enable_data_tools  = false
  @additional_tools   = []
  @additional_resources = {}
end

Instance Attribute Details

#additional_resources ⇒ Hash{String => Hash}

Returns additional MCP resources merged with built-in resources.

Returns:

  • (Hash{String => Hash}) —

    additional MCP resources merged with built-in resources



35
36
37
# File 'lib/rails_ai_bridge/config/server.rb', line 35

def additional_resources
  @additional_resources
end

#additional_tools ⇒ Array<Class>

Returns additional MCP tool classes appended to the built-in list.

Returns:

  • (Array<Class>) —

    additional MCP tool classes appended to the built-in list



32
33
34
# File 'lib/rails_ai_bridge/config/server.rb', line 32

def additional_tools
  @additional_tools
end

#auto_mount ⇒ Boolean

Returns auto-mount MCP HTTP endpoint via Rack middleware.

Returns:

  • (Boolean) —

    auto-mount MCP HTTP endpoint via Rack middleware



23
24
25
# File 'lib/rails_ai_bridge/config/server.rb', line 23

def auto_mount
  @auto_mount
end

#enable_data_tools ⇒ Boolean

:reek:Attribute -- configuration requires a public writer for initializer setup.

Returns:

  • (Boolean) —

    register the data-access tools (rails_query, rails_read_logs). Disabled by default: these tools reach live application data (database rows, log files) and bypass MCP introspection exclusions, so hosts must opt in.



29
30
31
# File 'lib/rails_ai_bridge/config/server.rb', line 29

def enable_data_tools
  @enable_data_tools
end

#http_bind ⇒ String

Returns bind address for the standalone HTTP transport.

Returns:

  • (String) —

    bind address for the standalone HTTP transport



17
18
19
# File 'lib/rails_ai_bridge/config/server.rb', line 17

def http_bind
  @http_bind
end

#http_path ⇒ String

Returns HTTP path for the MCP endpoint.

Returns:

  • (String) —

    HTTP path for the MCP endpoint



14
15
16
# File 'lib/rails_ai_bridge/config/server.rb', line 14

def http_path
  @http_path
end

#http_port ⇒ Integer

Returns port for the standalone HTTP transport.

Returns:

  • (Integer) —

    port for the standalone HTTP transport



20
21
22
# File 'lib/rails_ai_bridge/config/server.rb', line 20

def http_port
  @http_port
end

#server_name ⇒ String

Returns MCP server name advertised to clients.

Returns:

  • (String) —

    MCP server name advertised to clients



8
9
10
# File 'lib/rails_ai_bridge/config/server.rb', line 8

def server_name
  @server_name
end

#server_version ⇒ String

Returns MCP server version advertised to clients.

Returns:

  • (String) —

    MCP server version advertised to clients



11
12
13
# File 'lib/rails_ai_bridge/config/server.rb', line 11

def server_version
  @server_version
end