refactor: fix error introduced by merge, and reorganize feature (#185)

This commit is contained in:
4t145 2025-05-18 14:15:41 +08:00 • committed by GitHub
commit 5e4e77efa5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 67 additions and 55 deletions

View file

@ -9,7 +9,8 @@ publish = false
[dependencies]
rmcp = { path = "../../crates/rmcp", features = [
"client",
"transport-sse",
"transport-sse-client",
"reqwest",
"transport-streamable-http-client",
"transport-child-process",
"tower",

View file

@ -17,7 +17,7 @@ tokio = { version = "1", features = ["full"] }
rmcp = { path = "../../crates/rmcp", features = [
"client",
"transport-child-process",
"transport-sse",
"transport-sse-client",
] }
anyhow = "1.0"
serde_json = "1"

View file

@ -7,15 +7,16 @@ edition = "2021"
tokio = { version = "1", features = ["full"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
reqwest = { version = "0.11", features = ["json"] }
reqwest = { version = "0.12", features = ["json"] }
anyhow = "1.0"
thiserror = "1.0"
async-trait = "0.1"
futures = "0.3"
toml = "0.8"
rmcp = { git = "https://github.com/modelcontextprotocol/rust-sdk", features = [
rmcp = { workspace = true, features = [
"client",
"transport-child-process",
"transport-sse",
"transport-sse-client",
"reqwest"
], no-default-features = true }
clap = { version = "4.0", features = ["derive"] }
clap = { version = "4.0", features = ["derive"] }

View file

@ -45,7 +45,8 @@ impl McpServerTransportConfig {
pub async fn start(&self) -> Result<RunningService<RoleClient, ()>> {
let client = match self {
McpServerTransportConfig::Sse { url } => {
let transport = rmcp::transport::sse::SseTransport::start(url).await?;
let transport =
rmcp::transport::sse_client::SseClientTransport::start(url.to_owned()).await?;
().serve(transport).await?
}
McpServerTransportConfig::Stdio {