Class: Iron::Api::McpController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/iron/api/mcp_controller.rb

Instance Method Summary collapse

Methods included from BoundedRequestBody

#process_action

Instance Method Details

#handleObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'app/controllers/iron/api/mcp_controller.rb', line 13

def handle
  return head :method_not_allowed unless request.post?

  body = bounded_body
  return head :content_too_large unless body
  return reject_batch if batch?(body)

  reply = server.handle_json(body)

  if reply.nil?
    head :accepted
  else
    render json: reply
  end
end