diff --git a/examples/http_client.rb b/examples/http_client.rb index 3efbff9..4ef95c7 100644 --- a/examples/http_client.rb +++ b/examples/http_client.rb @@ -137,8 +137,7 @@ class MCPHTTPClient end end -# Main script -if __FILE__ == $PROGRAM_NAME +def main puts <<~MESSAGE MCP HTTP Client Example Make sure the HTTP server is running (ruby examples/http_server.rb) @@ -182,3 +181,5 @@ if __FILE__ == $PROGRAM_NAME client.close_session end end + +main diff --git a/examples/streamable_http_client.rb b/examples/streamable_http_client.rb index 7cca9ac..79e3f38 100644 --- a/examples/streamable_http_client.rb +++ b/examples/streamable_http_client.rb @@ -176,4 +176,4 @@ def main end end -main if __FILE__ == $PROGRAM_NAME +main