Skip to content

Commit 16f8bc7

Browse files
committed
Add acp_id(), fix 13 tests with polyfill, remove conductor mcp CLI
- Add McpConnectionTo::acp_id(), deprecate acp_url() - Remove orphaned 'conductor mcp $port' CLI subcommand and mcp_bridge.rs - Fix all 13 previously-ignored tests to use McpOverAcpPolyfill::http() - Fix BridgeResponder bug: route through BridgeMessage::ConnectionEstablished instead of creating new HashMap in on_receiving_result callback - Auto-update 2 snapshot tests for new proxy in chain
1 parent 084efd2 commit 16f8bc7

14 files changed

Lines changed: 264 additions & 338 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/agent-client-protocol-conductor/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ expect-test.workspace = true
5050
regex.workspace = true
5151
rmcp = { workspace = true, features = ["client", "server", "transport-io", "transport-child-process"] }
5252
schemars.workspace = true
53+
agent-client-protocol-polyfill = { path = "../agent-client-protocol-polyfill" }
5354

5455
[lints]
5556
workspace = true

src/agent-client-protocol-conductor/src/lib.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,6 @@
2828
//! 3. Presents as a single agent on stdin/stdout
2929
//! 4. Manages the lifecycle of all processes
3030
//!
31-
//! ### MCP Bridge Mode
32-
//!
33-
//! Connect stdio to a TCP-based MCP server:
34-
//!
35-
//! ```bash
36-
//! # Bridge stdio to MCP server on localhost:8080
37-
//! agent-client-protocol-conductor mcp 8080
38-
//! ```
39-
//!
40-
//! This allows stdio-based tools to communicate with TCP MCP servers.
41-
//!
4231
//! ## How It Works
4332
//!
4433
//! **Component Communication:**
@@ -81,8 +70,6 @@ use std::str::FromStr;
8170
mod conductor;
8271
/// Debug logging for conductor
8372
mod debug_logger;
84-
/// MCP bridge functionality for TCP-based MCP servers
85-
mod mcp_bridge;
8673
mod snoop;
8774
/// Trace event types for sequence diagram viewer
8875
pub mod trace;
@@ -219,12 +206,6 @@ pub enum ConductorCommand {
219206
/// List of proxy commands to chain together
220207
proxies: Vec<String>,
221208
},
222-
223-
/// Run as MCP bridge connecting stdio to TCP
224-
Mcp {
225-
/// TCP port to connect to on localhost
226-
port: u16,
227-
},
228209
}
229210

230211
impl ConductorArgs {
@@ -240,7 +221,6 @@ impl ConductorArgs {
240221
let components = match &self.command {
241222
ConductorCommand::Agent { components, .. } => components.clone(),
242223
ConductorCommand::Proxy { proxies, .. } => proxies.clone(),
243-
ConductorCommand::Mcp { .. } => Vec::new(),
244224
};
245225

246226
// Create debug logger
@@ -333,7 +313,6 @@ impl ConductorArgs {
333313
)
334314
.await
335315
}
336-
ConductorCommand::Mcp { port } => mcp_bridge::run_mcp_bridge(port).await,
337316
}
338317
}
339318
}

src/agent-client-protocol-conductor/src/mcp_bridge.rs

Lines changed: 0 additions & 122 deletions
This file was deleted.

src/agent-client-protocol-conductor/tests/mcp-integration.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ use agent_client_protocol::schema::{
1313
SessionNotification, TextContent,
1414
};
1515
use agent_client_protocol_conductor::{ConductorImpl, ProxiesAndAgent};
16+
use agent_client_protocol_polyfill::mcp_over_acp::McpOverAcpPolyfill;
1617
use agent_client_protocol_test::testy::{Testy, TestyCommand};
1718
use futures::{SinkExt, StreamExt, channel::mpsc};
1819

@@ -72,7 +73,9 @@ async fn run_test_with_mode(
7273
#[tokio::test]
7374
async fn test_proxy_provides_mcp_tools_stdio() -> Result<(), agent_client_protocol::Error> {
7475
run_test_with_mode(
75-
ProxiesAndAgent::new(Testy::new()).proxy(mcp_integration::proxy::ProxyComponent),
76+
ProxiesAndAgent::new(Testy::new())
77+
.proxy(mcp_integration::proxy::ProxyComponent)
78+
.proxy(McpOverAcpPolyfill::http()),
7679
async |connection_to_editor| {
7780
// Send initialization request
7881
let init_response = recv(
@@ -113,7 +116,9 @@ async fn test_proxy_provides_mcp_tools_stdio() -> Result<(), agent_client_protoc
113116
#[tokio::test]
114117
async fn test_proxy_provides_mcp_tools_http() -> Result<(), agent_client_protocol::Error> {
115118
run_test_with_mode(
116-
ProxiesAndAgent::new(Testy::new()).proxy(mcp_integration::proxy::ProxyComponent),
119+
ProxiesAndAgent::new(Testy::new())
120+
.proxy(mcp_integration::proxy::ProxyComponent)
121+
.proxy(McpOverAcpPolyfill::http()),
117122
async |connection_to_editor| {
118123
// Send initialization request
119124
let init_response = recv(
@@ -151,7 +156,6 @@ async fn test_proxy_provides_mcp_tools_http() -> Result<(), agent_client_protoco
151156
}
152157

153158
#[tokio::test]
154-
#[ignore = "requires McpOverAcpPolyfill proxy in chain - bridge removed from conductor"]
155159
async fn test_agent_handles_prompt() -> Result<(), agent_client_protocol::Error> {
156160
// Initialize tracing for debug output
157161
drop(
@@ -172,7 +176,9 @@ async fn test_agent_handles_prompt() -> Result<(), agent_client_protocol::Error>
172176
let conductor_handle = tokio::spawn(async move {
173177
ConductorImpl::new_agent(
174178
"mcp-integration-conductor".to_string(),
175-
ProxiesAndAgent::new(Testy::new()).proxy(mcp_integration::proxy::ProxyComponent),
179+
ProxiesAndAgent::new(Testy::new())
180+
.proxy(mcp_integration::proxy::ProxyComponent)
181+
.proxy(McpOverAcpPolyfill::http()),
176182
)
177183
.run(agent_client_protocol::ByteStreams::new(
178184
conductor_write.compat_write(),

src/agent-client-protocol-conductor/tests/scoped_mcp_server.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use agent_client_protocol::mcp_server::McpServer;
88
use agent_client_protocol::{Agent, Conductor, ConnectTo, Proxy, Role, RunWithConnectionTo};
99
use agent_client_protocol_conductor::{ConductorImpl, ProxiesAndAgent};
10+
use agent_client_protocol_polyfill::mcp_over_acp::McpOverAcpPolyfill;
1011
use agent_client_protocol_test::testy::{Testy, TestyCommand};
1112
use schemars::JsonSchema;
1213
use serde::{Deserialize, Serialize};
@@ -17,11 +18,12 @@ use std::sync::Mutex;
1718
/// This validates the scoped lifetime feature - the tool closure captures
1819
/// a reference to `collected_values` which lives on the stack.
1920
#[tokio::test]
20-
#[ignore = "requires McpOverAcpPolyfill proxy in chain - bridge removed from conductor"]
2121
async fn test_scoped_mcp_server_through_proxy() -> Result<(), agent_client_protocol::Error> {
2222
let conductor = ConductorImpl::new_agent(
2323
"conductor".to_string(),
24-
ProxiesAndAgent::new(Testy::new()).proxy(ScopedProxy),
24+
ProxiesAndAgent::new(Testy::new())
25+
.proxy(ScopedProxy)
26+
.proxy(McpOverAcpPolyfill::http()),
2527
);
2628

2729
let result = yopo::prompt(
@@ -48,14 +50,13 @@ async fn test_scoped_mcp_server_through_proxy() -> Result<(), agent_client_proto
4850
/// The MCP server captures a reference to stack-local data that lives for
4951
/// the duration of the session.
5052
#[tokio::test]
51-
#[ignore = "requires McpOverAcpPolyfill proxy in chain - bridge removed from conductor"]
5253
async fn test_scoped_mcp_server_through_session() -> Result<(), agent_client_protocol::Error> {
5354
// Run the client
5455
agent_client_protocol::Client.builder()
5556
.connect_with(
5657
ConductorImpl::new_agent(
5758
"conductor".to_string(),
58-
ProxiesAndAgent::new(Testy::new()),
59+
ProxiesAndAgent::new(Testy::new()).proxy(McpOverAcpPolyfill::http()),
5960
),
6061
async |cx| {
6162
// Initialize first

src/agent-client-protocol-conductor/tests/test_mcp_tool_output_types.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use agent_client_protocol::mcp_server::McpServer;
77
use agent_client_protocol::{Conductor, ConnectTo, DynConnectTo, Proxy, RunWithConnectionTo};
88
use agent_client_protocol_conductor::{ConductorImpl, ProxiesAndAgent};
9+
use agent_client_protocol_polyfill::mcp_over_acp::McpOverAcpPolyfill;
910
use agent_client_protocol_test::testy::{Testy, TestyCommand};
1011
use schemars::JsonSchema;
1112
use serde::{Deserialize, Serialize};
@@ -56,12 +57,13 @@ impl<R: RunWithConnectionTo<Conductor> + 'static + Send> ConnectTo<Conductor>
5657
}
5758

5859
#[tokio::test]
59-
#[ignore = "requires McpOverAcpPolyfill proxy in chain - bridge removed from conductor"]
6060
async fn test_tool_returning_string() -> Result<(), agent_client_protocol::Error> {
6161
let result = yopo::prompt(
6262
ConductorImpl::new_agent(
6363
"test-conductor".to_string(),
64-
ProxiesAndAgent::new(Testy::new()).proxy(create_test_proxy()),
64+
ProxiesAndAgent::new(Testy::new())
65+
.proxy(create_test_proxy())
66+
.proxy(McpOverAcpPolyfill::http()),
6567
),
6668
TestyCommand::CallTool {
6769
server: "test_server".to_string(),
@@ -82,12 +84,13 @@ async fn test_tool_returning_string() -> Result<(), agent_client_protocol::Error
8284
}
8385

8486
#[tokio::test]
85-
#[ignore = "requires McpOverAcpPolyfill proxy in chain - bridge removed from conductor"]
8687
async fn test_tool_returning_integer() -> Result<(), agent_client_protocol::Error> {
8788
let result = yopo::prompt(
8889
ConductorImpl::new_agent(
8990
"test-conductor".to_string(),
90-
ProxiesAndAgent::new(Testy::new()).proxy(create_test_proxy()),
91+
ProxiesAndAgent::new(Testy::new())
92+
.proxy(create_test_proxy())
93+
.proxy(McpOverAcpPolyfill::http()),
9194
),
9295
TestyCommand::CallTool {
9396
server: "test_server".to_string(),

src/agent-client-protocol-conductor/tests/test_session_id_in_mcp_tools.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use agent_client_protocol::RunWithConnectionTo;
1212
use agent_client_protocol::mcp_server::McpServer;
1313
use agent_client_protocol::{Conductor, ConnectTo, DynConnectTo, Proxy};
1414
use agent_client_protocol_conductor::{ConductorImpl, ProxiesAndAgent};
15+
use agent_client_protocol_polyfill::mcp_over_acp::McpOverAcpPolyfill;
1516
use agent_client_protocol_test::testy::{Testy, TestyCommand};
1617
use schemars::JsonSchema;
1718
use serde::{Deserialize, Serialize};
@@ -36,7 +37,7 @@ fn create_echo_proxy() -> DynConnectTo<Conductor> {
3637
"Returns the current session_id",
3738
async |_input: EchoInput, context| {
3839
Ok(EchoOutput {
39-
acp_id: context.acp_url(),
40+
acp_id: context.acp_id(),
4041
})
4142
},
4243
agent_client_protocol::tool_fn_mut!(),
@@ -68,14 +69,15 @@ impl<R: RunWithConnectionTo<Conductor> + 'static + Send> ConnectTo<Conductor>
6869
}
6970

7071
#[tokio::test]
71-
#[ignore = "requires McpOverAcpPolyfill proxy in chain - bridge removed from conductor"]
7272
async fn test_list_tools_from_mcp_server() -> Result<(), agent_client_protocol::Error> {
7373
use expect_test::expect;
7474

7575
let result = yopo::prompt(
7676
ConductorImpl::new_agent(
7777
"test-conductor".to_string(),
78-
ProxiesAndAgent::new(Testy::new()).proxy(create_echo_proxy()),
78+
ProxiesAndAgent::new(Testy::new())
79+
.proxy(create_echo_proxy())
80+
.proxy(McpOverAcpPolyfill::http()),
7981
),
8082
TestyCommand::ListTools {
8183
server: "echo_server".to_string(),
@@ -94,12 +96,13 @@ async fn test_list_tools_from_mcp_server() -> Result<(), agent_client_protocol::
9496
}
9597

9698
#[tokio::test]
97-
#[ignore = "requires McpOverAcpPolyfill proxy in chain - bridge removed from conductor"]
9899
async fn test_session_id_delivered_to_mcp_tools() -> Result<(), agent_client_protocol::Error> {
99100
let result = yopo::prompt(
100101
ConductorImpl::new_agent(
101102
"test-conductor".to_string(),
102-
ProxiesAndAgent::new(Testy::new()).proxy(create_echo_proxy()),
103+
ProxiesAndAgent::new(Testy::new())
104+
.proxy(create_echo_proxy())
105+
.proxy(McpOverAcpPolyfill::http()),
103106
),
104107
TestyCommand::CallTool {
105108
server: "echo_server".to_string(),

0 commit comments

Comments
 (0)