Simplify error response when accessing MCP without session ID
まだ誰も着手していません。
評価
調査の方向性
HttpServletStreamableServerTransportProvider.java の264行目付近から始め、mcp-session-id ヘッダーのないリクエストに対する GET の処理を調査します。issue に記載されたリクエストを再現し、その後、レスポンスが例外のスタックトレースを公開せず、単純なリクエストまたはセッションIDのメッセージを返すことを確認します。
索引モデルが issue の本文から書いたものです。
説明
Description:
Currently, when accessing the MCP Streamable HTTP server at https://host:port/mcp without providing a session ID, the server responds with the full exception stack trace and detailed error information.
Issue:
Returning the complete stack trace in the response is not user-friendly and may expose internal details unnecessarily.
Suggestion:
Instead of returning the full error, return a simple, clear message indicating there is an issue with the request headers or the session ID
stack trace
{
"cause": null,
"stackTrace": [
{
"moduleName": null,
"moduleVersion": null,
"classLoaderName": null,
"methodName": "doGet",
"fileName": "HttpServletStreamableServerTransportProvider.java",
"lineNumber": 268,
"className": "com.ibm.modelcontextprotocol.server.transport.HttpServletStreamableServerTransportProvider",
"nativeMethod": false
},
{
"moduleName": null,
"moduleVersion": null,
"classLoaderName": null,
"methodName": "service",
"fileName": "HttpServlet.java",
"lineNumber": 527,
"className": "jakarta.servlet.http.HttpServlet",
"nativeMethod": false
},
{
"moduleName": null,
"moduleVersion": null,
"classLoaderName": null,
"methodName": "service",
"fileName": "HttpServlet.java",
"lineNumber": 614,
"className": "jakarta.servlet.http.HttpServlet",
"nativeMethod": false
}
],
"jsonRpcError": null,
"message": "text/event-stream required in Accept header; Session ID required in mcp-session-id header",
"localizedMessage": "text/event-stream required in Accept header; Session ID required in mcp-session-id header",
"suppressed": []
}
- 主要言語
- Java
- スター
- 3.7k
- フォーク
- 1.1k
- 平均マージ
- 1日 15時間
- マージ済み PR(30日)
- 9
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
modelcontextprotocol/java-sdk のほかの issue
-
area/transport bug P2
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
modelcontextprotocol/java-sdk#1136 ·
-
area/client bug P2
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
modelcontextprotocol/java-sdk#1124 · コメント 1 件 ·
-
ServerCapabilities.logging is added unconditionally, overriding the caller's explicit capabilities オープンbug P2 ready for work
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
modelcontextprotocol/java-sdk#1086 · コメント 1 件 ·
-
enhancement good first issue P3
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
modelcontextprotocol/java-sdk#1067 ·
-
bug P2 ready for work
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
modelcontextprotocol/java-sdk#898 · コメント 1 件 ·
modelcontextprotocol/java-sdk の issue をすべて見る
似ている issue
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
apache/cloudstack#14222 ·
-
[BUG]茶杯方块在取茶时会引发崩溃 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
1.0.0-alpha2 Type/Improvement
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
wso2/dpdp-accelerator#272 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
apache/rocketmq-dashboard#4860 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
infinispan/infinispan#18150 ·