aia 0.9.8 → 0.9.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/.version +1 -1
  3. data/CHANGELOG.md +15 -0
  4. data/README.md +62 -5
  5. data/Rakefile +16 -8
  6. data/examples/directives/ask.rb +21 -0
  7. data/examples/tools/edit_file.rb +2 -0
  8. data/examples/tools/incomplete/calculator_tool.rb +70 -0
  9. data/examples/tools/incomplete/composite_analysis_tool.rb +89 -0
  10. data/examples/tools/incomplete/data_science_kit.rb +128 -0
  11. data/examples/tools/incomplete/database_query_tool.rb +100 -0
  12. data/examples/tools/incomplete/devops_toolkit.rb +112 -0
  13. data/examples/tools/incomplete/error_handling_tool.rb +109 -0
  14. data/examples/tools/{pdf_page_reader.rb → incomplete/pdf_page_reader.rb} +2 -0
  15. data/examples/tools/incomplete/secure_tool_template.rb +117 -0
  16. data/examples/tools/incomplete/weather_tool.rb +110 -0
  17. data/examples/tools/incomplete/workflow_manager_tool.rb +145 -0
  18. data/examples/tools/list_files.rb +2 -0
  19. data/examples/tools/mcp/README.md +1 -0
  20. data/examples/tools/mcp/github_mcp_server.rb +41 -0
  21. data/examples/tools/mcp/imcp.rb +15 -0
  22. data/examples/tools/read_file.rb +2 -0
  23. data/examples/tools/run_shell_command.rb +2 -0
  24. data/justfile +3 -25
  25. data/lib/aia/chat_processor_service.rb +0 -3
  26. data/lib/aia/config.rb +542 -436
  27. data/lib/aia/context_manager.rb +3 -8
  28. data/lib/aia/directive_processor.rb +21 -10
  29. data/lib/aia/ruby_llm_adapter.rb +78 -10
  30. data/lib/aia/session.rb +187 -138
  31. data/lib/aia/ui_presenter.rb +7 -5
  32. data/lib/aia/utility.rb +26 -6
  33. data/lib/aia.rb +5 -1
  34. data/main.just +3 -25
  35. metadata +31 -12
  36. data/lib/aia/shell_command_executor.rb +0 -109
@@ -0,0 +1,112 @@
1
+ # devops_toolkit.rb - System administration tools
2
+ require 'ruby_llm/tool'
3
+ require 'securerandom'
4
+
5
+ module Tools
6
+ class DevOpsToolkit < RubyLLM::Tool
7
+ def self.name = "devops_toolkit"
8
+
9
+ description <<~DESCRIPTION
10
+ Comprehensive DevOps and system administration toolkit for managing application deployments,
11
+ monitoring system health, and performing operational tasks across different environments.
12
+ This tool provides secure, audited access to common DevOps operations including deployments,
13
+ rollbacks, health checks, log analysis, and metrics collection. It includes built-in safety
14
+ mechanisms for production environments, comprehensive logging for compliance, and support
15
+ for multiple deployment environments. All operations are logged and require appropriate
16
+ permissions and confirmations for sensitive environments.
17
+ DESCRIPTION
18
+
19
+ param :operation,
20
+ desc: <<~DESC,
21
+ Specific DevOps operation to perform:
22
+ - 'deploy': Deploy application code to the specified environment
23
+ - 'rollback': Revert to the previous stable deployment version
24
+ - 'health_check': Perform comprehensive health and status checks
25
+ - 'log_analysis': Analyze application and system logs for issues
26
+ - 'metric_collection': Gather and report system and application metrics
27
+ Each operation has specific requirements and safety checks.
28
+ DESC
29
+ type: :string,
30
+ required: true,
31
+ enum: ["deploy", "rollback", "health_check", "log_analysis", "metric_collection"]
32
+
33
+ param :environment,
34
+ desc: <<~DESC,
35
+ Target environment for the DevOps operation:
36
+ - 'development': Local or shared development environment (minimal restrictions)
37
+ - 'staging': Pre-production environment for testing (moderate restrictions)
38
+ - 'production': Live production environment (maximum restrictions and confirmations)
39
+ Production operations require explicit confirmation via the 'production_confirmed' option.
40
+ DESC
41
+ type: :string,
42
+ default: "staging",
43
+ enum: ["development", "staging", "production"]
44
+
45
+ param :options,
46
+ desc: <<~DESC,
47
+ Hash of operation-specific options and parameters:
48
+ - For deploy: version, branch, rollback_on_failure, notification_channels
49
+ - For rollback: target_version, confirmation_required
50
+ - For health_check: services_to_check, timeout_seconds
51
+ - For log_analysis: time_range, log_level, search_patterns
52
+ - For metric_collection: metric_types, time_window, output_format
53
+ Production operations require 'production_confirmed: true' for safety.
54
+ DESC
55
+ type: :hash,
56
+ default: {}
57
+
58
+ def execute(operation:, environment: "staging", options: {})
59
+ # Security: Require explicit production confirmation
60
+ if environment == "production" && !options[:production_confirmed]
61
+ return {
62
+ success: false,
63
+ error: "Production operations require explicit confirmation",
64
+ required_option: "production_confirmed: true"
65
+ }
66
+ end
67
+
68
+ case operation
69
+ when "deploy"
70
+ perform_deployment(environment, options)
71
+ when "rollback"
72
+ perform_rollback(environment, options)
73
+ when "health_check"
74
+ perform_health_check(environment, options)
75
+ when "log_analysis"
76
+ analyze_logs(environment, options)
77
+ when "metric_collection"
78
+ collect_metrics(environment, options)
79
+ end
80
+ end
81
+
82
+ private
83
+
84
+ def perform_deployment(environment, options)
85
+ # Implementation for deployment logic
86
+ {
87
+ success: true,
88
+ operation: "deploy",
89
+ environment: environment,
90
+ deployed_at: Time.now.iso8601,
91
+ deployment_id: SecureRandom.uuid,
92
+ details: "Deployment completed successfully"
93
+ }
94
+ end
95
+
96
+ def perform_rollback(environment, options)
97
+ # TODO: Implementation for rollback logic
98
+ end
99
+
100
+ def perform_health_check(environment, options)
101
+ # TODO: Implementation for health check logic
102
+ end
103
+
104
+ def analyze_logs(environment, options)
105
+ # TODO: Implementation for log analysis logic
106
+ end
107
+
108
+ def collect_metrics(environment, options)
109
+ # TODO: Implementation for metric collection logic
110
+ end
111
+ end
112
+ end
@@ -0,0 +1,109 @@
1
+ # error_handling_tool.rb - Comprehensive error handling
2
+ require 'ruby_llm/tool'
3
+ require 'securerandom'
4
+
5
+ module Tools
6
+ class RobustTool < RubyLLM::Tool
7
+ def self.name = 'robust_tool'
8
+
9
+ description <<~DESCRIPTION
10
+ Reference tool demonstrating comprehensive error handling patterns and resilience strategies
11
+ for robust tool development. This tool showcases best practices for handling different
12
+ types of errors including validation errors, network failures, authorization issues,
13
+ and general exceptions. It implements retry mechanisms with exponential backoff,
14
+ proper resource cleanup, detailed error categorization, and user-friendly error messages.
15
+ Perfect as a template for building production-ready tools that need to handle
16
+ various failure scenarios gracefully.
17
+ DESCRIPTION
18
+
19
+ def execute(**params)
20
+ begin
21
+ validate_preconditions(params)
22
+ result = perform_operation(params)
23
+ validate_postconditions(result)
24
+
25
+ {
26
+ success: true,
27
+ result: result,
28
+ metadata: operation_metadata
29
+ }
30
+ rescue ValidationError => e
31
+ handle_validation_error(e, params)
32
+ rescue NetworkError => e
33
+ handle_network_error(e, params)
34
+ rescue AuthorizationError => e
35
+ handle_authorization_error(e, params)
36
+ rescue StandardError => e
37
+ handle_general_error(e, params)
38
+ ensure
39
+ cleanup_resources
40
+ end
41
+ end
42
+
43
+ private
44
+
45
+ def validate_preconditions(params)
46
+ # TODO: Check all preconditions before execution
47
+ end
48
+
49
+ def perform_operation(params)
50
+ # TODO: Main operation logic with retry mechanism
51
+ retry_count = 0
52
+ max_retries = 3
53
+
54
+ begin
55
+ # TODO: Operation implementation
56
+ rescue RetryableError => e
57
+ retry_count += 1
58
+ if retry_count <= max_retries
59
+ sleep(2 ** retry_count) # Exponential backoff
60
+ retry
61
+ else
62
+ raise e
63
+ end
64
+ end
65
+ end
66
+
67
+ def handle_validation_error(error, params)
68
+ {
69
+ success: false,
70
+ error_type: "validation",
71
+ error: error.message,
72
+ suggestions: error.suggestions,
73
+ provided_params: params.keys
74
+ }
75
+ end
76
+
77
+ def handle_network_error(error, params)
78
+ {
79
+ success: false,
80
+ error_type: "network",
81
+ error: "Network operation failed",
82
+ retry_suggested: true,
83
+ retry_after: 30
84
+ }
85
+ end
86
+
87
+ def handle_authorization_error(error, params)
88
+ {
89
+ success: false,
90
+ error_type: "authorization",
91
+ error: "Access denied",
92
+ documentation_url: "https://docs.example.com/auth"
93
+ }
94
+ end
95
+
96
+ def handle_general_error(error, params)
97
+ {
98
+ success: false,
99
+ error_type: "general",
100
+ error: error.message,
101
+ support_reference: SecureRandom.uuid
102
+ }
103
+ end
104
+
105
+ def cleanup_resources
106
+ # TODO: Clean up any allocated resources
107
+ end
108
+ end
109
+ end
@@ -6,6 +6,8 @@ require 'pdf-reader'
6
6
 
7
7
 
8
8
  class PdfPageReader < RubyLLM::Tool
9
+ def self.name = 'pdf_page_reader'
10
+
9
11
  # TODO: make the path to the pdf document a parameter
10
12
  DOC = PDF::Reader.new('docs/big-doc.pdf')
11
13
 
@@ -0,0 +1,117 @@
1
+ # secure_tool_template.rb - Security best practices
2
+ require 'ruby_llm/tool'
3
+ require 'timeout'
4
+
5
+ module Tools
6
+ class SecureTool < RubyLLM::Tool
7
+ def self.name = 'secure_tool'
8
+
9
+ description <<~DESCRIPTION
10
+ Template tool demonstrating comprehensive security best practices for safe tool development.
11
+ This tool serves as a reference implementation for secure tool design, including input
12
+ validation, output sanitization, permission checks, rate limiting, audit logging,
13
+ timeout mechanisms, and proper error handling. It provides a complete security framework
14
+ that can be adapted for other tools that handle sensitive data or perform privileged
15
+ operations. All security violations are logged for monitoring and compliance purposes.
16
+ DESCRIPTION
17
+
18
+ # Input validation
19
+ param :user_input,
20
+ desc: <<~DESC,
21
+ User-provided input string that will be processed with comprehensive security validation.
22
+ Input is automatically sanitized and validated against multiple security criteria:
23
+ - Maximum length of 1000 characters to prevent buffer overflow attacks
24
+ - Character whitelist allowing only alphanumeric, spaces, hyphens, underscores, and dots
25
+ - Automatic removal of potentially dangerous characters and sequences
26
+ - Rate limiting to prevent abuse and denial-of-service attacks
27
+ All input validation failures are logged for security monitoring.
28
+ DESC
29
+ type: :string,
30
+ required: true,
31
+ validator: ->(value) {
32
+ # Custom validation logic
33
+ raise "Input too long" if value.length > 1000
34
+ raise "Invalid characters" unless value.match?(/\A[a-zA-Z0-9\s\-_\.]+\z/)
35
+ true
36
+ }
37
+
38
+ def execute(user_input:)
39
+ begin
40
+ # 1. Sanitize inputs
41
+ sanitized_input = sanitize_input(user_input)
42
+
43
+ # 2. Validate permissions
44
+ validate_permissions
45
+
46
+ # 3. Rate limiting
47
+ check_rate_limits
48
+
49
+ # 4. Audit logging
50
+ log_tool_usage(sanitized_input)
51
+
52
+ # 5. Execute with timeout
53
+ result = execute_with_timeout(sanitized_input)
54
+
55
+ # 6. Sanitize outputs
56
+ sanitized_result = sanitize_output(result)
57
+
58
+ {
59
+ success: true,
60
+ result: sanitized_result,
61
+ executed_at: Time.now.iso8601
62
+ }
63
+ rescue SecurityError => e
64
+ log_security_violation(e, user_input)
65
+ {
66
+ success: false,
67
+ error: "Security violation: Access denied",
68
+ violation_logged: true
69
+ }
70
+ rescue => e
71
+ {
72
+ success: false,
73
+ error: "Tool execution failed: #{e.message}"
74
+ }
75
+ end
76
+ end
77
+
78
+ private
79
+
80
+ def sanitize_input(input)
81
+ # Remove potentially dangerous characters
82
+ # Validate against whitelist
83
+ input.gsub(/[^\w\s\-\.]/, '')
84
+ end
85
+
86
+ def validate_permissions
87
+ # TODO: Check user permissions
88
+ # Validate environment access
89
+ # Verify resource limits
90
+ end
91
+
92
+ def check_rate_limits
93
+ # TODO: Implement rate limiting logic
94
+ end
95
+
96
+ def log_tool_usage(input)
97
+ # TODO: Audit logging for compliance
98
+ end
99
+
100
+ def execute_with_timeout(input, timeout: 30)
101
+ # TODO: Implement timeout mechanism
102
+ Timeout::timeout(timeout) do
103
+ # TODO: Actual tool logic here
104
+ end
105
+ end
106
+
107
+ def sanitize_output(output)
108
+ # TODO: Remove sensitive information from output
109
+ # Validate output format
110
+ output
111
+ end
112
+
113
+ def log_security_violation(error, input)
114
+ # TODO: Log security violations for monitoring
115
+ end
116
+ end
117
+ end
@@ -0,0 +1,110 @@
1
+ # weather_tool.rb - API integration example
2
+ require 'ruby_llm/tool'
3
+ require 'net/http'
4
+ require 'json'
5
+
6
+ module Tools
7
+ class WeatherTool < RubyLLM::Tool
8
+ def self.name = 'weather_tool'
9
+
10
+ description <<~DESCRIPTION
11
+ Retrieve comprehensive current weather information for any city worldwide using the OpenWeatherMap API.
12
+ This tool provides real-time weather data including temperature, atmospheric conditions, humidity,
13
+ and wind information. It supports multiple temperature units and can optionally include extended
14
+ forecast data. The tool requires a valid OpenWeatherMap API key to be configured in the
15
+ OPENWEATHER_API_KEY environment variable. All weather data is fetched in real-time and includes
16
+ timestamps for accuracy verification.
17
+ DESCRIPTION
18
+
19
+ param :city,
20
+ desc: <<~DESC,
21
+ Name of the city for weather lookup. Can include city name only (e.g., 'London')
22
+ or city with country code for better accuracy (e.g., 'London,UK' or 'Paris,FR').
23
+ For cities with common names in multiple countries, including the country code
24
+ is recommended to ensure accurate results. The API will attempt to find the
25
+ closest match if an exact match is not found.
26
+ DESC
27
+ type: :string,
28
+ required: true
29
+
30
+ param :units,
31
+ desc: <<~DESC,
32
+ Temperature unit system for the weather data. Options are:
33
+ - 'metric': Temperature in Celsius, wind speed in m/s, pressure in hPa
34
+ - 'imperial': Temperature in Fahrenheit, wind speed in mph, pressure in hPa
35
+ - 'kelvin': Temperature in Kelvin (scientific standard), wind speed in m/s
36
+ Default is 'metric' which is most commonly used internationally.
37
+ DESC
38
+ type: :string,
39
+ default: "metric",
40
+ enum: ["metric", "imperial", "kelvin"]
41
+
42
+ param :include_forecast,
43
+ desc: <<~DESC,
44
+ Boolean flag to include a 3-day weather forecast in addition to current conditions.
45
+ When set to true, the response will include forecast data with daily high/low temperatures,
46
+ precipitation probability, and general weather conditions for the next three days.
47
+ This requires additional API calls and may increase response time slightly.
48
+ DESC
49
+ type: :boolean,
50
+ default: false
51
+
52
+ def execute(city:, units: "metric", include_forecast: false)
53
+ begin
54
+ api_key = ENV['OPENWEATHER_API_KEY']
55
+ raise "OpenWeather API key not configured" unless api_key
56
+
57
+ current_weather = fetch_current_weather(city, units, api_key)
58
+ result = {
59
+ success: true,
60
+ city: city,
61
+ current: current_weather,
62
+ units: units,
63
+ timestamp: Time.now.iso8601
64
+ }
65
+
66
+ if include_forecast
67
+ forecast_data = fetch_forecast(city, units, api_key)
68
+ result[:forecast] = forecast_data
69
+ end
70
+
71
+ result
72
+ rescue => e
73
+ {
74
+ success: false,
75
+ error: e.message,
76
+ city: city,
77
+ suggestion: "Verify city name and API key configuration"
78
+ }
79
+ end
80
+ end
81
+
82
+ private
83
+
84
+ def fetch_current_weather(city, units, api_key)
85
+ uri = URI("https://api.openweathermap.org/data/2.5/weather")
86
+ params = {
87
+ q: city,
88
+ appid: api_key,
89
+ units: units
90
+ }
91
+ uri.query = URI.encode_www_form(params)
92
+
93
+ response = Net::HTTP.get_response(uri)
94
+ raise "Weather API error: #{response.code}" unless response.code == '200'
95
+
96
+ data = JSON.parse(response.body)
97
+ {
98
+ temperature: data['main']['temp'],
99
+ description: data['weather'][0]['description'],
100
+ humidity: data['main']['humidity'],
101
+ wind_speed: data['wind']['speed']
102
+ }
103
+ end
104
+
105
+ def fetch_forecast(city, units, api_key)
106
+ # TODO: Implementation for forecast data
107
+ # Similar pattern to current weather
108
+ end
109
+ end
110
+ end
@@ -0,0 +1,145 @@
1
+ # workflow_manager_tool.rb - Managing state across tool invocations
2
+ require 'ruby_llm/tool'
3
+ require 'securerandom'
4
+ require 'json'
5
+
6
+ module Tools
7
+ class WorkflowManager < RubyLLM::Tool
8
+ def self.name = 'workflow_manager'
9
+
10
+ description <<~DESCRIPTION
11
+ Manage complex multi-step workflows with persistent state tracking across tool invocations.
12
+ This tool enables the creation and management of stateful workflows that can span multiple
13
+ AI interactions and tool calls. It provides workflow initialization, step-by-step execution,
14
+ status monitoring, and completion tracking. Each workflow maintains its state in persistent
15
+ storage, allowing for resumption of long-running processes and coordination between
16
+ multiple tools and AI interactions. Perfect for complex automation tasks that require
17
+ multiple stages and decision points.
18
+ DESCRIPTION
19
+
20
+ param :action,
21
+ desc: <<~DESC,
22
+ Workflow management action to perform:
23
+ - 'start': Initialize a new workflow with initial data and return workflow ID
24
+ - 'step': Execute the next step in an existing workflow using provided step data
25
+ - 'status': Check the current status and progress of an existing workflow
26
+ - 'complete': Mark a workflow as finished and clean up associated resources
27
+ Each action requires different combinations of the other parameters.
28
+ DESC
29
+ type: :string,
30
+ required: true,
31
+ enum: ["start", "step", "status", "complete"]
32
+
33
+ param :workflow_id,
34
+ desc: <<~DESC,
35
+ Unique identifier for an existing workflow. Required for 'step', 'status', and 'complete'
36
+ actions. This ID is returned when starting a new workflow and should be used for all
37
+ subsequent operations on that workflow. The ID is a UUID string that ensures
38
+ uniqueness across all workflow instances.
39
+ DESC
40
+ type: :string
41
+
42
+ param :step_data,
43
+ desc: <<~DESC,
44
+ Hash containing data and parameters specific to the current workflow step.
45
+ For 'start' action: Initial configuration and parameters for the workflow.
46
+ For 'step' action: Input data, parameters, and context needed for the next step.
47
+ The structure depends on the specific workflow type and current step requirements.
48
+ Can include nested hashes, arrays, and any JSON-serializable data types.
49
+ DESC
50
+ type: :hash,
51
+ default: {}
52
+
53
+ def execute(action:, workflow_id: nil, step_data: {})
54
+ case action
55
+ when "start"
56
+ start_workflow(step_data)
57
+ when "step"
58
+ process_workflow_step(workflow_id, step_data)
59
+ when "status"
60
+ get_workflow_status(workflow_id)
61
+ when "complete"
62
+ complete_workflow(workflow_id)
63
+ else
64
+ { success: false, error: "Unknown action: #{action}" }
65
+ end
66
+ end
67
+
68
+ private
69
+
70
+ def start_workflow(initial_data)
71
+ workflow_id = SecureRandom.uuid
72
+ workflow_state = {
73
+ id: workflow_id,
74
+ status: "active",
75
+ steps: [],
76
+ created_at: Time.now.iso8601,
77
+ data: initial_data
78
+ }
79
+
80
+ save_workflow_state(workflow_id, workflow_state)
81
+
82
+ {
83
+ success: true,
84
+ workflow_id: workflow_id,
85
+ status: "started",
86
+ next_actions: suggested_next_actions(initial_data)
87
+ }
88
+ end
89
+
90
+ def process_workflow_step(workflow_id, step_data)
91
+ workflow_state = load_workflow_state(workflow_id)
92
+ return { success: false, error: "Workflow not found" } unless workflow_state
93
+
94
+ step = {
95
+ step_number: workflow_state[:steps].length + 1,
96
+ data: step_data,
97
+ processed_at: Time.now.iso8601,
98
+ result: process_step_logic(step_data, workflow_state)
99
+ }
100
+
101
+ workflow_state[:steps] << step
102
+ workflow_state[:updated_at] = Time.now.iso8601
103
+
104
+ save_workflow_state(workflow_id, workflow_state)
105
+
106
+ {
107
+ success: true,
108
+ workflow_id: workflow_id,
109
+ step_completed: step,
110
+ workflow_status: workflow_state[:status],
111
+ next_actions: suggested_next_actions(workflow_state)
112
+ }
113
+ end
114
+
115
+ def save_workflow_state(workflow_id, state)
116
+ # TODO: Implementation for state persistence
117
+ # Could use files, database, or memory store
118
+ File.write(".workflow_#{workflow_id}.json", state.to_json)
119
+ end
120
+
121
+ def load_workflow_state(workflow_id)
122
+ # TODO: Implementation for state loading
123
+ file_path = ".workflow_#{workflow_id}.json"
124
+ return nil unless File.exist?(file_path)
125
+
126
+ JSON.parse(File.read(file_path), symbolize_names: true)
127
+ end
128
+
129
+ def get_workflow_status(workflow_id)
130
+ # TODO: Implementation for status retrieval
131
+ end
132
+
133
+ def complete_workflow(workflow_id)
134
+ # TODO: Implementation for workflow completion
135
+ end
136
+
137
+ def suggested_next_actions(workflow_state)
138
+ # TODO: Implementation for suggesting next actions
139
+ end
140
+
141
+ def process_step_logic(step_data, workflow_state)
142
+ # TODO: Implementation for processing step logic
143
+ end
144
+ end
145
+ end
@@ -5,6 +5,8 @@ require "ruby_llm/tool"
5
5
 
6
6
  module Tools
7
7
  class ListFiles < RubyLLM::Tool
8
+ def self.name = "list_files"
9
+
8
10
  description "List files and directories at a given path. If no path is provided, lists files in the current directory."
9
11
  param :path, desc: "Optional relative path to list files from. Defaults to current directory if not provided."
10
12
 
@@ -0,0 +1 @@
1
+ These tools require the ruby_llm-mcp version 0.5.0+ gem
@@ -0,0 +1,41 @@
1
+ # shared_tools/ruby_llm/mcp/github_mcp_server.rb
2
+ # brew install github_mcp_server
3
+
4
+ require "ruby_llm/mcp"
5
+
6
+ RubyLLM::MCP.add_client(
7
+ name: "github-mcp-server",
8
+ transport_type: :stdio,
9
+ config: {
10
+ command: "/opt/homebrew/bin/github-mcp-server", # brew install github-mcp-server
11
+ args: %w[stdio],
12
+ env: { "GITHUB_PERSONAL_ACCESS_TOKEN" => ENV.fetch("GITHUB_PERSONAL_ACCESS_TOKEN") },
13
+ },
14
+ )
15
+
16
+
17
+ __END__
18
+
19
+
20
+ A GitHub MCP server that handles various tools and resources.
21
+
22
+ Usage:
23
+ server [command]
24
+
25
+ Available Commands:
26
+ completion Generate the autocompletion script for the specified shell
27
+ help Help about any command
28
+ stdio Start stdio server
29
+
30
+ Flags:
31
+ --dynamic-toolsets Enable dynamic toolsets
32
+ --enable-command-logging When enabled, the server will log all command requests and responses to the log file
33
+ --export-translations Save translations to a JSON file
34
+ --gh-host string Specify the GitHub hostname (for GitHub Enterprise etc.)
35
+ -h, --help help for server
36
+ --log-file string Path to log file
37
+ --read-only Restrict the server to read-only operations
38
+ --toolsets strings An optional comma separated list of groups of tools to allow, defaults to enabling all (default [all])
39
+ -v, --version version for server
40
+
41
+ Use "server [command] --help" for more information about a command.
@@ -0,0 +1,15 @@
1
+ # shared_tools/ruby_llm/mcp/imcp.rb
2
+ # iMCP is a MacOS program that provides access to notes,calendar,contacts, etc.
3
+ # See: https://github.com/loopwork/iMCP
4
+ # brew install --cask loopwork/tap/iMCP
5
+ #
6
+
7
+ require 'ruby_llm/mcp'
8
+
9
+ RubyLLM::MCP.add_client(
10
+ name: "imcp-server",
11
+ transport_type: :stdio,
12
+ config: {
13
+ command: "/Applications/iMCP.app/Contents/MacOS/imcp-server 2> /dev/null"
14
+ }
15
+ )
@@ -4,6 +4,8 @@
4
4
 
5
5
  module Tools
6
6
  class ReadFile < RubyLLM::Tool
7
+ def self.name = 'read_file'
8
+
7
9
  description "Read the contents of a given relative file path. Use this when you want to see what's inside a file. Do not use this with directory names."
8
10
  param :path, desc: "The relative path of a file in the working directory."
9
11
 
@@ -5,6 +5,8 @@ require "ruby_llm/tool"
5
5
 
6
6
  module Tools
7
7
  class RunShellCommand < RubyLLM::Tool
8
+ def self.name = 'run_shell_command'
9
+
8
10
  description "Execute a linux shell command"
9
11
  param :command, desc: "The command to execute"
10
12