modelcontextprotocol / modelcontextprotocol/java-sdk

Add X-Accel-Buffering: no Header for SSE Responses

Đang mở
#293 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

area/server enhancement good first issue P2
Ngôn ngữ chính
Java
Star
3.7k
Fork
1.1k
Merge trung bình
1 ngày 15 giờ
Pull request đã merge (30 ngày)
9

Mô tả

Quick Search Confirmation

I searched existing issues in this repository and did not find a duplicate request for adding X-Accel-Buffering headers to SSE responses.

Expected Behavior

When using the spring-ai-starter-mcp-server-webmvc module to handle Server-Sent Events (SSE), the framework should automatically inject the header X-Accel-Buffering: no into all SSE responses. This ensures proxy servers (e.g., Nginx) disable response buffering, allowing real-time streaming of AI-generated content (e.g., chat completions, streaming predictions) without latency.

Example of Expected Headers:
For an SSE endpoint like /stream, the response should include:

Content-Type: text/event-stream
X-Accel-Buffering: no
Current Behavior
  • Missing Header: SSE responses from spring-ai-starter-mcp-server-webmvc do not include X-Accel-Buffering: no.
  • Consequence: Proxy servers (e.g., Nginx) buffer SSE responses by default, causing:
    • Delayed delivery of real-time data (e.g., chat messages appear in batches instead of streaming).
    • Inconsistent behavior in AI applications where low latency is critical.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu từ phần xử lý phản hồi SSE được mô tả trong issue ở spring-ai-starter-mcp-server-webmvc và kiểm tra cách các phản hồi SSE được tạo ra. Xác minh các header phản hồi của một endpoint SSE, sau đó đảm bảo hành vi khi hoàn tất bao gồm Content-Type: text/event-stream và X-Accel-Buffering: no mà không có proxy buffering.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
java, spring
Lĩnh vực
api, backend
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
50/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.