use solidmcp::McpServer;
use tracing::{error, info};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
tracing_subscriber::fmt().with_env_filter("debug").init();
info!("🌐 Starting SolidMCP HTTP-Only Server Example");
let mut server = McpServer::new().await?;
let port = 3032;
info!("🌐 HTTP server will be available at:");
info!(" http://localhost:{}/mcp", port);
info!("📋 Available tools: echo, read_file");
info!("💡 This example focuses on HTTP requests (JSON-RPC over HTTP)");
info!("🔗 Example curl request:");
info!(r#" curl -X POST http://localhost:{}/mcp \"#, port);
info!(r#" -H "Content-Type: application/json" \"#);
info!(
r#" -d '{{"jsonrpc":"2.0","id":1,"method":"initialize","params":{{"protocolVersion":"2025-06-18","capabilities":{{}},"clientInfo":{{"name":"curl-client","version":"1.0.0"}}}}}}"#
);
info!("Press Ctrl+C to stop the server");
if let Err(e) = server.start(port).await {
error!("❌ Server error: {}", e);
return Err(e.into());
}
Ok(())
}