build: 将 rmcp 依赖从 git branch 迁移到 crates.io 版本
- Cargo.toml: rmcp 从 git="...rust-sdk", branch="main" 改为 version="1.7" (semver 解析为 1.8.0,最新兼容 1.x 版本) - src/mcp/client.rs: 适配 rmcp 1.8+ API 变更 peer_info() 返回类型从 Option<ServerInfo> 变为 Option<Arc<ServerInfo>>, 使用 .map(|arc| arc.as_ref().clone()) 替代 .cloned() 解决 git branch 依赖带来的问题:构建不可复现、供应链安全风险、 版本语义模糊、升级路径不清晰、CI 构建性能损耗。
This commit is contained in:
parent
ffc1f79de4
commit
6c393dca05
@ -50,7 +50,7 @@ windows-sys = { version = "0.59", features = [
|
|||||||
"Win32_System_Kernel",
|
"Win32_System_Kernel",
|
||||||
] }
|
] }
|
||||||
# MCP (Model Context Protocol) support
|
# MCP (Model Context Protocol) support
|
||||||
rmcp = { git = "https://github.com/modelcontextprotocol/rust-sdk", branch = "main", features = [
|
rmcp = { version = "1.7", features = [
|
||||||
"client",
|
"client",
|
||||||
"transport-child-process",
|
"transport-child-process",
|
||||||
"transport-streamable-http-client-reqwest",
|
"transport-streamable-http-client-reqwest",
|
||||||
|
|||||||
@ -252,8 +252,8 @@ impl McpClientManager {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Get server info (returns Option<&ServerInfo>)
|
// Get server info (returns Option<Arc<ServerInfo>> in rmcp 1.8+)
|
||||||
let info = client.peer_info().cloned();
|
let info = client.peer_info().map(|arc| arc.as_ref().clone());
|
||||||
|
|
||||||
// List available tools
|
// List available tools
|
||||||
let tools = client.list_all_tools().await?;
|
let tools = client.list_all_tools().await?;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user