use oxicode_agent::mcp::client::McpClient;
use std::collections::HashMap;
use std::time::Duration;
const COLD_START: Duration = Duration::from_secs(120);
const ROUND_TRIP: Duration = Duration::from_secs(30);
#[tokio::test]
#[ignore]
async fn stdio_interop_with_server_everything() {
let mut client = tokio::time::timeout(
COLD_START,
McpClient::connect(
"npx",
&[
"-y".to_string(),
"@modelcontextprotocol/server-everything".to_string(),
"stdio".to_string(),
],
&HashMap::new(),
None,
false,
),
)
.await
.expect("initialize timed out (likely npx download on cold cache; retry)")
.expect("initialize handshake with server-everything should succeed (G1 fix)");
assert!(
!client.server_info.name.is_empty(),
"server name should be set after initialize"
);
let tools = tokio::time::timeout(ROUND_TRIP, client.list_tools())
.await
.expect("tools/list timed out")
.expect("tools/list should succeed");
assert!(
!tools.is_empty(),
"server-everything exposes tools; an empty list means the framing or handshake regressed"
);
tokio::time::timeout(ROUND_TRIP, client.ping())
.await
.expect("ping timed out")
.expect("ping should succeed");
client.close().await.ok();
}