File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -260,7 +260,10 @@ func (g *Gateway) Run(ctx context.Context) error {
260260 return fmt .Errorf ("loading configuration: %w" , err )
261261 }
262262
263- if g .McpOAuthDcrEnabled {
263+ // When running in Container mode, disable OAuth notification monitoring and authentication
264+ inContainer := os .Getenv ("DOCKER_MCP_IN_CONTAINER" ) == "1"
265+
266+ if g .McpOAuthDcrEnabled && ! inContainer {
264267 // Start OAuth notification monitor to receive OAuth related events from Docker Desktop
265268 log .Log ("- Starting OAuth notification monitor" )
266269 monitor := oauth .NewNotificationMonitor ()
@@ -319,7 +322,6 @@ func (g *Gateway) Run(ctx context.Context) error {
319322 // Initialize authentication token for SSE and streaming modes
320323 // Skip authentication when running in container (DOCKER_MCP_IN_CONTAINER=1)
321324 transport := strings .ToLower (g .Transport )
322- inContainer := os .Getenv ("DOCKER_MCP_IN_CONTAINER" ) == "1"
323325 if (transport == "sse" || transport == "http" || transport == "streamable" || transport == "streaming" || transport == "streamable-http" ) && ! inContainer {
324326 token , wasGenerated , err := getOrGenerateAuthToken ()
325327 if err != nil {
You can’t perform that action at this time.
0 commit comments