Skip to content

Commit c286e04

Browse files
committed
fix: core mcp test with invalid type
1 parent cc00cea commit c286e04

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

core/context/mcp/MCPConnection.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ class MCPConnection {
221221
);
222222
await this.client.connect(transport, {});
223223
this.transport = transport;
224-
} else {
224+
} else if (!this.options.type) {
225225
try {
226226
const transport = this.constructHttpTransport({
227227
...this.options,
@@ -243,6 +243,10 @@ class MCPConnection {
243243
);
244244
}
245245
}
246+
} else {
247+
throw new Error(
248+
`Unsupported transport type: ${this.options.type}`,
249+
);
246250
}
247251
}
248252

extensions/cli/src/services/MCPService.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ export class MCPService
372372
} else if (serverConfig.type === "streamable-http") {
373373
const transport = this.constructHttpTransport(serverConfig);
374374
await client.connect(transport, {});
375-
} else {
375+
} else if (!serverConfig.type) {
376376
try {
377377
const transport = this.constructHttpTransport(serverConfig);
378378
await client.connect(transport, {});
@@ -392,6 +392,8 @@ export class MCPService
392392
);
393393
}
394394
}
395+
} else {
396+
throw new Error(`Unsupported transport type: ${serverConfig.type}`);
395397
}
396398
}
397399

packages/llm-info/package-lock.json

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

0 commit comments

Comments
 (0)