use crate::service::ApiMcpService;
use rmcp::ServiceExt;
pub struct McpServer {
service: ApiMcpService,
}
impl McpServer {
pub fn new(service: ApiMcpService) -> Self {
Self { service }
}
pub async fn run(self) -> Result<(), Box<dyn std::error::Error>> {
let stdin = tokio::io::stdin();
let stdout = tokio::io::stdout();
let server = self.service.serve((stdin, stdout)).await?;
server.waiting().await?;
Ok(())
}
}