Class: McpInspector::Web::ServersController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- McpInspector::Web::ServersController
- Defined in:
- lib/mcp_inspector/web/app/controllers/mcp_inspector/web/servers_controller.rb
Instance Method Summary collapse
Instance Method Details
#index ⇒ Object
8 9 10 |
# File 'lib/mcp_inspector/web/app/controllers/mcp_inspector/web/servers_controller.rb', line 8 def index @servers = config_manager.servers end |
#info ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/mcp_inspector/web/app/controllers/mcp_inspector/web/servers_controller.rb', line 12 def info connect_to_server do |client| @info = client.server_info respond_to do |format| format.turbo_stream format.html { render partial: "mcp_inspector/web/servers/info", locals: { info: @info } } end end end |
#prompts ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'lib/mcp_inspector/web/app/controllers/mcp_inspector/web/servers_controller.rb', line 32 def prompts connect_to_server do |client| @prompts = client.list_prompts respond_to do |format| format.turbo_stream format.html { render partial: "mcp_inspector/web/servers/prompts", locals: { prompts: @prompts, server_name: params[:id] } } end end end |
#resources ⇒ Object
42 43 44 45 46 47 48 49 50 |
# File 'lib/mcp_inspector/web/app/controllers/mcp_inspector/web/servers_controller.rb', line 42 def resources connect_to_server do |client| @resources = client.list_resources respond_to do |format| format.turbo_stream format.html { render partial: "mcp_inspector/web/servers/resources", locals: { resources: @resources, server_name: params[:id] } } end end end |
#tools ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/mcp_inspector/web/app/controllers/mcp_inspector/web/servers_controller.rb', line 22 def tools connect_to_server do |client| @tools = client.list_tools respond_to do |format| format.turbo_stream format.html { render partial: "mcp_inspector/web/servers/tools", locals: { tools: @tools, server_name: params[:id] } } end end end |