<?php

declare(strict_types=1);

myronSendMcpOAuthNoStoreHeaders();
header('Content-Type: application/json; charset=utf-8');
header('X-Content-Type-Options: nosniff');

if (strtoupper((string) ($_SERVER['REQUEST_METHOD'] ?? 'GET')) !== 'GET') {
    http_response_code(405);
    header('Allow: GET');
    echo json_encode(['error' => 'method_not_allowed'], JSON_UNESCAPED_SLASHES);
    return;
}

$metadata = myronMcpOAuthMetadataService();
echo json_encode([
    'resource' => $metadata->resource(),
    'authorization_servers' => [$metadata->issuer()],
    'protected_resource_metadata' => $metadata->protectedResourceMetadataUrl(),
], JSON_UNESCAPED_SLASHES);

