File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,9 @@ export async function connectMCPClient(
21
21
let client : Client ;
22
22
try {
23
23
client = await createMCPStreamableClient ( url , token ) ;
24
+ return client ;
24
25
} catch ( error ) {
26
+ // If streamable HTTP transport fails on not timeout error, continue with SSE transport
25
27
if ( error instanceof TimeoutError ) {
26
28
log . warning ( 'Connection to MCP server using streamable HTTP transport timed out' , { url } ) ;
27
29
return null ;
@@ -35,6 +37,7 @@ export async function connectMCPClient(
35
37
36
38
try {
37
39
client = await createMCPSSEClient ( url , token ) ;
40
+ return client ;
38
41
} catch ( error ) {
39
42
if ( error instanceof TimeoutError ) {
40
43
log . warning ( 'Connection to MCP server using SSE transport timed out' , { url } ) ;
@@ -44,8 +47,6 @@ export async function connectMCPClient(
44
47
log . error ( 'Failed to connect to MCP server using SSE transport' , { cause : error } ) ;
45
48
throw error ;
46
49
}
47
-
48
- return client ;
49
50
}
50
51
51
52
async function withTimeout < T > ( millis : number , promise : Promise < T > ) : Promise < T > {
Original file line number Diff line number Diff line change @@ -940,5 +940,21 @@ export function createIntegrationTestsSuite(
940
940
941
941
await client . close ( ) ;
942
942
} ) ;
943
+
944
+ // Skipping tests, MCP actors are not available in staging environment
945
+ // TODO: run this tests only for local environment
946
+ it . skip . for ( [
947
+ 'mcp-servers/slidespeak-mcp-server' ,
948
+ 'mcp-servers/brave-search-mcp-server' ,
949
+ 'jiri.spilka/weather-mcp-server' ,
950
+ 'apify/actors-mcp-server' ,
951
+ 'jakub.kopecky/browserbase-mcp-server' ,
952
+ 'jakub.kopecky/arxiv-mcp-server' ,
953
+ 'jiri.spilka/playwright-mcp-server' ,
954
+ ] ) ( 'should connect to "%s" MCP server and at least one tool is available' , async ( mcpServer ) => {
955
+ client = await createClientFn ( { tools : [ mcpServer ] } ) ;
956
+ const tools = await client . listTools ( ) ;
957
+ expect ( tools . tools . length ) . toBeGreaterThan ( 0 ) ;
958
+ } ) ;
943
959
} ) ;
944
960
}
You can’t perform that action at this time.
0 commit comments