mcp-go icon indicating copy to clipboard operation
mcp-go copied to clipboard

ToolCall request returns 504 Gateway Timeout via Nginx Ingress for Long-Running Requests

Open CeerDecy opened this issue 7 months ago • 1 comments

Problem Description

We observe intermittent 504 errors when handling long-running requests through Nginx Ingress, despite the SSE backend functioning properly. Below are the key details:

Environment

1. Backend Service:

  • mcp-server deployed in Kubernetes
  • Used server.WithKeepAliveInterval(10 * time.Second) for SSE connections
  • Processing logic requires 2+ minutes to complete

2. Gateway Layer:

  • Nginx Ingress Controller default timeout settings (60s)

Observed Behavior

client by python-sdk:

  • Successful results via /sse endpoint.
  • the ToolCall request receive 504 Gateway Timeout after 60s, though backend logs confirm continued processing. Image

client by mcp-go:

  • timeout, no result return

Image

CeerDecy avatar Apr 17 '25 05:04 CeerDecy

Problem Description

We observe intermittent 504 errors when handling long-running requests through Nginx Ingress, despite the SSE backend functioning properly. Below are the key details:

Environment

1. Backend Service:

  • mcp-server deployed in Kubernetes
  • Used server.WithKeepAliveInterval(10 * time.Second) for SSE connections
  • Processing logic requires 2+ minutes to complete

2. Gateway Layer:

  • Nginx Ingress Controller default timeout settings (60s)

Observed Behavior

client by python-sdk:

  • Successful results via /sse endpoint.
  • the ToolCall request receive 504 Gateway Timeout after 60s, though backend logs confirm continued processing.
Image **client by `mcp-go`:**
  • timeout, no result return

Image

@CeerDecy How is SSE URL customization implemented? Why can't I modify it and only write the IP address? How to deploy a remote MCP server and access it through FQDNS?

Hwting avatar Apr 20 '25 05:04 Hwting

solved

CeerDecy avatar May 06 '25 05:05 CeerDecy