Class: RailsMcpInsight::Tools::CheckSecurity

Inherits:
MCP::Tool
  • Object
show all
Defined in:
lib/rails_mcp_insight/tools/check_security.rb

Class Method Summary collapse

Class Method Details

.call(server_context:, focus: nil) ⇒ Object



25
26
27
28
29
30
31
# File 'lib/rails_mcp_insight/tools/check_security.rb', line 25

def self.call(server_context:, focus: nil)
  config = Configuration.new(project_path: server_context&.dig(:project_path) || Dir.pwd)
  analyzer = Analyzers::SecurityAnalyzer.new(config)
  result = analyzer.analyze(focus: focus)

  MCP::Tool::Response.new([{ type: "text", text: JSON.pretty_generate(result) }])
end