use strict;
use warnings;
use Test::More;
use IO::Async::Loop;
use JSON::MaybeXS qw( encode_json decode_json );

use Net::Async::MCP::Server;

my $loop = IO::Async::Loop->new;

subtest 'run_stdio - can be called with new server' => sub {
    # Test that run_stdio exists and can be called
    can_ok( 'Net::Async::MCP::Server', 'run_stdio' );
};

subtest 'Transport::Stdio - instantiation and basic properties' => sub {
    require Net::Async::MCP::Server::Transport::Stdio;

    my $server = Net::Async::MCP::Server->new(
        name => 'test-server',
    );
    $loop->add($server);

    my $transport = Net::Async::MCP::Server::Transport::Stdio->new(
        server => $server,
    );

    ok( $transport, 'transport created' );
    is( $transport->server, $server, 'server accessor works' );
};

done_testing;