//! MCP Streamable HTTP transport implementation
//!
//! Implements HTTP transport per MCP specification 2025-03-26:
//! https://modelcontextprotocol.io/specification/2025-03-26/basic/transports
//!
//! ## Features
//!
//! - **POST /mcp**: Client sends JSON-RPC requests
//! - **GET /mcp**: Client opens SSE stream for server→client messages
//! - **DELETE /mcp**: Client terminates session
//! - **Session Management**: Session IDs in `Mcp-Session-Id` header
//! - **Resumability**: SSE event replay via `Last-Event-ID` header
//! - **Security**: Origin validation per MCP spec (prevents DNS rebinding)
//!
//! ## Architecture
//!
//! The HTTP transport uses an **adapter pattern** rather than implementing the `Transport` trait.
//! This is because HTTP has a request/response model with multiple concurrent connections per
//! session, which doesn't map well to the streaming model of the Transport trait.
//!
//! Instead, the HTTP transport:
//! 1. Manages HTTP-level sessions (separate from MCP protocol sessions)
//! 2. Routes JSON-RPC messages to `Server.handle_request()` directly
//! 3. Uses SSE (Server-Sent Events) for server→client push messages
//!
//! ## Example
//!
//! ```rust,no_run
//! use mcp_host::Server;
//! use mcp_host::transport::http::{HttpTransport, HttpTransportConfig};
//!
//! #[tokio::main]
//! async fn main() {
//!     // Create MCP server
//!     let server = Server::builder("my-server", "1.0.0")
//!         .with_tool(/* ... */)
//!         .build();
//!
//!     // Configure HTTP transport
//!     let config = HttpTransportConfig {
//!         bind_addr: "127.0.0.1:62770".to_string(),
//!         endpoint: "/mcp".to_string(),
//!         localhost_only: true,
//!         ..Default::default()
//!     };
//!
//!     // Run HTTP server
//!     let transport = HttpTransport::new(server, config);
//!     transport.run().await.unwrap();
//! }
//! ```
//!
//! ## Testing with MCP Inspector
//!
//! ```bash
//! npx @modelcontextprotocol/inspector --url http://localhost:62770/mcp
//! ```

mod handlers;
mod security;
mod server;
mod session;
mod sse;
mod types;

// Public exports
pub use server::HttpTransport;
pub use session::{HttpSession, HttpSessionManager};
pub use types::{HttpTransportConfig, HttpTransportError, SseEvent};

// Re-export for convenience
pub use sse::{format_sse_event, send_jsonrpc_via_sse};
