how to set a WP Plugin’s url

This is a perfect use case for WordPress’ REST API.

It probably makes sense, to create a custom endpoint, where you can in detail define what results you need. Something along the lines of

<?php
add_action( 'rest_api_init', function () {
  register_rest_route( 'kostas_calendar/v1', '/feed/', array(
    'methods' => 'GET',
    'callback' => 'kostas_calendar_endpoint_feed',
  ) );
} );

function kostas_calendar_endpoint_feed( WP_REST_Request $request ) {
  // your code
}