modelcontextprotocol / modelcontextprotocol/java-sdk

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

オープン
#293 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

area/server enhancement good first issue P2
主要言語
Java
スター
3.7k
フォーク
1.1k
平均マージ
1日 15時間
マージ済み PR(30日)
9

説明

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.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

spring-ai-starter-mcp-server-webmvc にある issue で説明されている SSE レスポンス処理から始め、SSE レスポンスがどのように生成されるかを調査します。SSE エンドポイントのレスポンスヘッダーを確認し、完了時の動作に Content-Type: text/event-stream と X-Accel-Buffering: no が含まれ、プロキシによるバッファリングが行われないことを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java, spring
領域
api, backend
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
50/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。