Skip to content

Commit 05c3803

Browse files
committed
fix(test): fix port conflict in test with js
1 parent 09032db commit 05c3803

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

crates/rmcp/tests/test_with_js.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
66
mod common;
77
use common::calculator::Calculator;
88

9-
const BIND_ADDRESS: &str = "127.0.0.1:8000";
9+
const SSE_BIND_ADDRESS: &str = "127.0.0.1:8000";
10+
const STREAMABLE_HTTP_BIND_ADDRESS: &str = "127.0.0.1:8001";
1011

1112
#[tokio::test]
1213
async fn test_with_js_client() -> anyhow::Result<()> {
@@ -24,7 +25,7 @@ async fn test_with_js_client() -> anyhow::Result<()> {
2425
.wait()
2526
.await?;
2627

27-
let ct = SseServer::serve(BIND_ADDRESS.parse()?)
28+
let ct = SseServer::serve(SSE_BIND_ADDRESS.parse()?)
2829
.await?
2930
.with_service(Calculator::default);
3031

@@ -83,7 +84,7 @@ async fn test_with_js_streamable_http_client() -> anyhow::Result<()> {
8384
.wait()
8485
.await?;
8586

86-
let ct = StreamableHttpServer::serve(BIND_ADDRESS.parse()?)
87+
let ct = StreamableHttpServer::serve(STREAMABLE_HTTP_BIND_ADDRESS.parse()?)
8788
.await?
8889
.with_service(Calculator::default);
8990

crates/rmcp/tests/test_with_js/streamable_client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
22
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
33

4-
const transport = new StreamableHTTPClientTransport(new URL(`http://127.0.0.1:8000/`));
4+
const transport = new StreamableHTTPClientTransport(new URL(`http://127.0.0.1:8001/`));
55

66
const client = new Client(
77
{

0 commit comments

Comments
 (0)