From 71824d44cc48b43437b96e3b55324f99a62a8d64 Mon Sep 17 00:00:00 2001 From: iamdoubz <> Date: Tue, 7 Jul 2026 00:47:55 -0500 Subject: [PATCH] fix(mcp): make bind_loopback/serve/HttpServerHandle pub for the e2e test (T10.4) Widens visibility from pub(crate) to pub so tests/mcp_server_test.rs (an external integration-test crate, per CLAUDE.md's "cross-service tests in /tests") can drive the real HTTP transport end-to-end. This does not weaken the loopback guarantee: bind_loopback still refuses non-loopback regardless of caller -- only its visibility changed. --- src-tauri/src/mcp/http_transport.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src-tauri/src/mcp/http_transport.rs b/src-tauri/src/mcp/http_transport.rs index 396b1a3..87bd6f4 100644 --- a/src-tauri/src/mcp/http_transport.rs +++ b/src-tauri/src/mcp/http_transport.rs @@ -25,7 +25,7 @@ use tokio_util::sync::CancellationToken; /// listening socket for MCP (FR-MCP-1, NFR-SEC-5). Kept generic over `host` /// purely so the refusal path is directly unit-testable; the only production /// caller (`mcp::server`) always passes `"127.0.0.1"`. -pub(crate) async fn bind_loopback(host: &str, port: u16) -> Result { +pub async fn bind_loopback(host: &str, port: u16) -> Result { let ip: IpAddr = host.parse().map_err(|_| McpError::NonLoopback)?; if !ip.is_loopback() { return Err(McpError::NonLoopback); @@ -37,7 +37,7 @@ pub(crate) async fn bind_loopback(host: &str, port: u16) -> Result, @@ -54,7 +54,7 @@ impl HttpServerHandle { /// routing) on an already-bound loopback listener. Every request must present /// `Authorization: Bearer ` matching the stored token (constant-time /// compare, `mcp::token::verify`) or it never reaches `rmcp`. -pub(crate) fn serve( +pub fn serve( listener: TcpListener, expected_token: String, handler: WaMcpHandler,