1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//! Backend Bridge trait for cross-protocol MCP proxy
//!
//! This trait provides a protocol-agnostic interface for backend MCP connections,
//! enabling `mcp-sse-proxy` to communicate with any backend implementation
//! (e.g., `mcp-streamable-proxy`) without direct dependencies.
//!
//! All method parameters and return values use `serde_json::Value` to avoid
//! coupling to specific rmcp version types.
use Future;
use Pin;
use Value;
/// Protocol-agnostic backend bridge for MCP proxy
///
/// Implementations of this trait wrap a concrete MCP client (e.g., rmcp 1.4.0's
/// `ProxyHandler`) and expose its functionality through a version-independent
/// JSON-based interface.
///
/// # Design
///
/// This trait uses `Pin<Box<dyn Future>>` for async methods instead of `async_trait`
/// to maintain object safety (`dyn BackendBridge`) without additional macro dependencies.