Skip to content

Commit 87a1cb3

Browse files
committed
feat: add http as alias of streamable-http transport type
1 parent 1254622 commit 87a1cb3

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

src/commands/mcp.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export function createMCPCommand(): Command {
2121
.argument("<name>", "Server name")
2222
.option(
2323
"-t, --transport <type>",
24-
"Transport type: stdio | sse | streamable-http",
24+
"Transport type: stdio | sse | streamable-http (alias: http)",
2525
"stdio",
2626
)
2727
.option(
@@ -43,7 +43,7 @@ export function createMCPCommand(): Command {
4343
switch (opts.transport as TransportType) {
4444
case TRANSPORT_TYPES.STDIO:
4545
config = {
46-
type: "stdio",
46+
type: TRANSPORT_TYPES.STDIO,
4747
command: opts.command,
4848
args: opts.args,
4949
env: parseKeyValue(opts.env),
@@ -53,16 +53,17 @@ export function createMCPCommand(): Command {
5353
break;
5454
case TRANSPORT_TYPES.SSE:
5555
config = {
56-
type: "sse",
56+
type: TRANSPORT_TYPES.SSE,
5757
url: opts.url,
5858
headers: parseKeyValue(opts.header),
5959
timeout: opts.timeout,
6060
enabled: opts.enabled,
6161
};
6262
break;
63+
case TRANSPORT_TYPES.HTTP:
6364
case TRANSPORT_TYPES.STREAMABLE_HTTP:
6465
config = {
65-
type: "streamable-http",
66+
type: TRANSPORT_TYPES.STREAMABLE_HTTP,
6667
url: opts.url,
6768
headers: parseKeyValue(opts.header),
6869
timeout: opts.timeout,

src/mcp/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ export const DEFAULT_TIMEOUT_MS = 60000;
22
export const TRANSPORT_TYPES = {
33
STDIO: "stdio",
44
SSE: "sse",
5+
HTTP: "http",
56
STREAMABLE_HTTP: "streamable-http",
67
} as const;
78

src/mcp/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import type {
1111
* List of all MCP client transport types.
1212
* Which define the communication protocol used to connect MCP servers.
1313
*/
14-
export type TransportType = "stdio" | "sse" | "streamable-http";
14+
export type TransportType = "stdio" | "sse" | "http" | "streamable-http";
1515

1616
export interface BaseServerConfig {
1717
type: TransportType;

0 commit comments

Comments
 (0)