pub mod http;
pub mod manager;
pub mod sse;
pub mod stdio;
pub use manager::Manager;
use std::future::Future;
use std::pin::Pin;
use std::sync::Arc;
use async_trait::async_trait;
use serde_json::Value;
use crate::error::McpzipError;
use crate::types::{ServerConfig, ToolEntry};
#[async_trait]
pub trait Upstream: Send + Sync {
async fn list_tools(&self) -> Result<Vec<ToolEntry>, McpzipError>;
async fn call_tool(&self, tool_name: &str, args: Value) -> Result<Value, McpzipError>;
async fn close(&self) -> Result<(), McpzipError>;
fn alive(&self) -> bool;
}
pub type ConnectFn = Arc<
dyn Fn(
String,
ServerConfig,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Upstream>, McpzipError>> + Send>>
+ Send
+ Sync,
>;