mod convert;
#[cfg(feature = "mcp-http")]
pub mod http;
#[cfg(feature = "mcp-oauth")]
pub mod oauth;
pub mod policy;
mod server;
pub use server::AingleMcp;
use crate::state::AppState;
pub const MCP_ORIGIN: &str = "mcp";
pub async fn serve_stdio(state: AppState) -> crate::error::Result<()> {
use rmcp::transport::stdio;
use rmcp::ServiceExt;
let service = AingleMcp::new(state)
.serve(stdio())
.await
.map_err(|e| crate::error::Error::Internal(format!("MCP serve error: {e}")))?;
service
.waiting()
.await
.map_err(|e| crate::error::Error::Internal(format!("MCP wait error: {e}")))?;
Ok(())
}