Module: Iron::Mcp::Server

Defined in:
app/mcp/iron/mcp/server.rb

Class Method Summary collapse

Class Method Details

.build(context:) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'app/mcp/iron/mcp/server.rb', line 6

def build(context:)
  ::MCP::Server.new(
    name: "iron-cms",
    title: "Iron CMS",
    version: Iron::VERSION,
    tools: tools,
    server_context: { iron: context },
    configuration: configuration
  )
end

.configurationObject



31
32
33
34
35
# File 'app/mcp/iron/mcp/server.rb', line 31

def configuration
  ::MCP::Configuration.new(
    exception_reporter: ->(exception, _server_context) { Rails.error.report(exception, handled: true, source: "iron.mcp") }
  )
end

.toolsObject



17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'app/mcp/iron/mcp/server.rb', line 17

def tools
  [
    Tools::ListContentTypes,
    Tools::DescribeSchema,
    Tools::ListEntries,
    Tools::GetEntry,
    Tools::CreateEntry,
    Tools::UpdateEntry,
    Tools::DeleteEntry,
    Tools::UploadAsset,
    Tools::Search
  ]
end