Class: ActionMCP::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- ActionMCP::Generators::InstallGenerator
- Defined in:
- lib/generators/action_mcp/install/install_generator.rb
Instance Method Summary collapse
- #create_application_gateway_file ⇒ Object
- #create_application_prompt_file ⇒ Object
- #create_application_tool_file ⇒ Object
- #create_mcp_binstub ⇒ Object
- #create_mcp_configuration_file ⇒ Object
- #create_mcp_rackup_file ⇒ Object
- #create_mcp_resource_template_file ⇒ Object
- #show_instructions ⇒ Object
Instance Method Details
#create_application_gateway_file ⇒ Object
30 31 32 |
# File 'lib/generators/action_mcp/install/install_generator.rb', line 30 def create_application_gateway_file template "application_gateway.rb", File.join("app/mcp", "application_gateway.rb") end |
#create_application_prompt_file ⇒ Object
13 14 15 |
# File 'lib/generators/action_mcp/install/install_generator.rb', line 13 def create_application_prompt_file template "application_mcp_prompt.rb", File.join("app/mcp/prompts", "application_mcp_prompt.rb") end |
#create_application_tool_file ⇒ Object
17 18 19 |
# File 'lib/generators/action_mcp/install/install_generator.rb', line 17 def create_application_tool_file template "application_mcp_tool.rb", File.join("app/mcp/tools", "application_mcp_tool.rb") end |
#create_mcp_binstub ⇒ Object
38 39 40 41 |
# File 'lib/generators/action_mcp/install/install_generator.rb', line 38 def create_mcp_binstub copy_file "bin/mcp", "bin/mcp" chmod "bin/mcp", 0o755 end |
#create_mcp_configuration_file ⇒ Object
26 27 28 |
# File 'lib/generators/action_mcp/install/install_generator.rb', line 26 def create_mcp_configuration_file template "mcp.yml", File.join("config", "mcp.yml") end |
#create_mcp_rackup_file ⇒ Object
34 35 36 |
# File 'lib/generators/action_mcp/install/install_generator.rb', line 34 def create_mcp_rackup_file template "mcp/config.ru.tt", "mcp/config.ru" end |
#create_mcp_resource_template_file ⇒ Object
21 22 23 24 |
# File 'lib/generators/action_mcp/install/install_generator.rb', line 21 def create_mcp_resource_template_file template "application_mcp_res_template.rb", File.join("app/mcp/resource_templates", "application_mcp_res_template.rb") end |
#show_instructions ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/generators/action_mcp/install/install_generator.rb', line 43 def show_instructions say "" say "ActionMCP has been installed successfully!" say "" say "Files created:" say " - app/mcp/prompts/application_mcp_prompt.rb" say " - app/mcp/tools/application_mcp_tool.rb" say " - app/mcp/resource_templates/application_mcp_res_template.rb" say " - app/mcp/application_gateway.rb" say " - config/mcp.yml" say " - mcp/config.ru (standalone Rack server config)" say " - bin/mcp (server binstub — Falcon preferred, Puma fallback)" say "" say " IMPORTANT: Do NOT mount ActionMCP::Engine in your routes.rb." say " ActionMCP runs as a standalone server via mcp/config.ru on its own port." say "" say "Configuration:" say " The mcp.yml file contains authentication, profiles, and adapter settings." say " You can customize authentication methods and PubSub adapters." say "" say "Available adapters:" say " - simple : In-memory adapter for development" say " - test : Test adapter for testing environments" say " - solid_mcp : Database-backed adapter optimized for MCP (requires solid_mcp gem)" say " - redis : Redis-backed adapter (requires redis gem)" say "" say "Next steps:" say " 1. Generate your first tool: rails generate action_mcp:tool MyTool" say " 2. Generate your first prompt: rails generate action_mcp:prompt MyPrompt" say " 3. Generate your first resource template: rails generate action_mcp:resource_template MyResource" say " 4. Start the MCP server: bin/mcp" say "" end |