File tree Expand file tree Collapse file tree 4 files changed +8
-3
lines changed Expand file tree Collapse file tree 4 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ export const streamableHTTPApp = (options: McpOptions) => {
83
83
export const launchStreamableHTTPServer = async (
84
84
options : McpOptions ,
85
85
endpoints : Endpoint [ ] ,
86
- port : number | undefined ,
86
+ port : number | string | undefined ,
87
87
) => {
88
88
const app = streamableHTTPApp ( options ) ;
89
89
const server = app . listen ( port ) ;
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ async function main() {
26
26
await launchStdioServer ( options , selectedTools ) ;
27
27
break ;
28
28
case 'http' :
29
- await launchStreamableHTTPServer ( options , selectedTools , options . port ) ;
29
+ await launchStreamableHTTPServer ( options , selectedTools , options . port ?? options . socket ) ;
30
30
break ;
31
31
}
32
32
}
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ export type CLIOptions = McpOptions & {
7
7
list : boolean ;
8
8
transport : 'stdio' | 'http' ;
9
9
port : number | undefined ;
10
+ socket : string | undefined ;
10
11
} ;
11
12
12
13
export type McpOptions = {
@@ -141,6 +142,10 @@ export function parseOptions(): CLIOptions {
141
142
type : 'number' ,
142
143
description : 'Port to serve on if using http transport' ,
143
144
} )
145
+ . option ( 'socket' , {
146
+ type : 'string' ,
147
+ description : 'Unix socket to serve on if using http transport' ,
148
+ } )
144
149
. help ( ) ;
145
150
146
151
for ( const [ command , desc ] of examples ( ) ) {
@@ -262,6 +267,7 @@ export function parseOptions(): CLIOptions {
262
267
list : argv . list || false ,
263
268
transport,
264
269
port : argv . port ,
270
+ socket : argv . socket ,
265
271
} ;
266
272
}
267
273
Original file line number Diff line number Diff line change @@ -67,7 +67,6 @@ export function init(params: {
67
67
const logAtLevel =
68
68
( level : 'debug' | 'info' | 'warning' | 'error' ) =>
69
69
( message : string , ...rest : unknown [ ] ) => {
70
- console . error ( message , ...rest ) ;
71
70
void server . sendLoggingMessage ( {
72
71
level,
73
72
data : { message, rest } ,
You can’t perform that action at this time.
0 commit comments