File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ export const LogId = {
5656 streamableHttpTransportCloseFailure : mongoLogId ( 1_006_006 ) ,
5757 streamableHttpTransportKeepAliveFailure : mongoLogId ( 1_006_007 ) ,
5858 streamableHttpTransportKeepAlive : mongoLogId ( 1_006_008 ) ,
59+ streamableHttpTransportHttpHostWarning : mongoLogId ( 1_006_009 ) ,
5960
6061 exportCleanupError : mongoLogId ( 1_007_001 ) ,
6162 exportCreationError : mongoLogId ( 1_007_002 ) ,
Original file line number Diff line number Diff line change @@ -205,6 +205,17 @@ export class StreamableHttpRunner extends TransportRunnerBase {
205205 message : `Server started on ${ this . serverAddress } ` ,
206206 noRedaction : true ,
207207 } ) ;
208+
209+ if ( this . userConfig . httpHost === "0.0.0.0" ) {
210+ this . logger . warning ( {
211+ id : LogId . streamableHttpTransportHttpHostWarning ,
212+ context : "streamableHttpTransport" ,
213+ message : `Binding to \`0.0.0.0\` exposes the MCP Server to the entire local
214+ network, which allows other devices on the same network to
215+ potentially access the MCP Server. This is a security risk and could
216+ allow unauthorized access to your database context. ` ,
217+ } ) ;
218+ }
208219 }
209220
210221 async closeTransport ( ) : Promise < void > {
You can’t perform that action at this time.
0 commit comments