Module: MailCatcher::Integrations
- Extended by:
- Integrations
- Included in:
- Integrations
- Defined in:
- lib/mail_catcher/integrations.rb,
lib/mail_catcher/integrations/mcp_tools.rb,
lib/mail_catcher/integrations/mcp_server.rb
Overview
Integration manager for optional features like MCP and Claude Plugins
Defined Under Namespace
Modules: MCPTools Classes: MCPServer
Instance Attribute Summary collapse
-
#mcp_server ⇒ Object
Returns the value of attribute mcp_server.
Instance Method Summary collapse
-
#available_tools ⇒ Object
Get available tools.
- #initialize ⇒ Object
-
#mcp_running? ⇒ Boolean
Check if MCP server is running.
-
#start(options = {}) ⇒ Object
Start integrations based on options.
-
#start_mcp_server(options = {}) ⇒ Object
Start the MCP server.
-
#stop ⇒ Object
Stop all integrations.
Instance Attribute Details
#mcp_server ⇒ Object
Returns the value of attribute mcp_server.
11 12 13 |
# File 'lib/mail_catcher/integrations.rb', line 11 def mcp_server @mcp_server end |
Instance Method Details
#available_tools ⇒ Object
Get available tools
59 60 61 |
# File 'lib/mail_catcher/integrations.rb', line 59 def available_tools MCPTools.tool_names end |
#initialize ⇒ Object
13 14 15 |
# File 'lib/mail_catcher/integrations.rb', line 13 def initialize @mcp_server = nil end |
#mcp_running? ⇒ Boolean
Check if MCP server is running
54 55 56 |
# File 'lib/mail_catcher/integrations.rb', line 54 def mcp_running? @mcp_server&.running end |
#start(options = {}) ⇒ Object
Start integrations based on options
18 19 20 21 22 23 24 |
# File 'lib/mail_catcher/integrations.rb', line 18 def start( = {}) $stderr.puts "[Integrations] Starting integrations with options: #{.inspect}" if [:mcp_enabled] start_mcp_server() end end |
#start_mcp_server(options = {}) ⇒ Object
Start the MCP server
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/mail_catcher/integrations.rb', line 27 def start_mcp_server( = {}) $stderr.puts "[Integrations] Starting MCP server" @mcp_server = MCPServer.new() # Run MCP server in a separate thread Thread.new do begin @mcp_server.run rescue => e $stderr.puts "[Integrations] MCP server error: #{e.}" $stderr.puts e.backtrace end end # Give the server a moment to start sleep 0.1 $stderr.puts "[Integrations] MCP server started" end |
#stop ⇒ Object
Stop all integrations
47 48 49 50 51 |
# File 'lib/mail_catcher/integrations.rb', line 47 def stop $stderr.puts "[Integrations] Stopping integrations" @mcp_server&.stop @mcp_server = nil end |