diff --git a/src/mcp/server/streamable_http.py b/src/mcp/server/streamable_http.py index ace74b33b4..3f3cf4cbab 100644 --- a/src/mcp/server/streamable_http.py +++ b/src/mcp/server/streamable_http.py @@ -51,6 +51,7 @@ # Content types CONTENT_TYPE_JSON = "application/json" CONTENT_TYPE_SSE = "text/event-stream" +CONTENT_TYPE_ALL = "*/*" # Special key for the standalone GET stream GET_STREAM_KEY = "_GET_stream" @@ -282,6 +283,9 @@ async def handle_request(self, scope: Scope, receive: Receive, send: Send) -> No def _check_accept_headers(self, request: Request) -> tuple[bool, bool]: """Check if the request accepts the required media types.""" accept_header = request.headers.get("accept", "") + if accept_header == CONTENT_TYPE_ALL: + return True, True + accept_types = [media_type.strip() for media_type in accept_header.split(",")] has_json = any(