Skip to content

Commit 0456b1b

Browse files
committed
return 405 for get stream
1 parent 2a3bed8 commit 0456b1b

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

examples/servers/simple-streamablehttp/pyproject.toml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,12 @@
11
[project]
22
name = "mcp-simple-streamablehttp"
33
version = "0.1.0"
4-
description = "A simple MCP server exposing a website fetching tool with StreamableHttp transport"
4+
description = "A simple MCP server exposing a StreamableHttp transport for testing"
55
readme = "README.md"
66
requires-python = ">=3.10"
77
authors = [{ name = "Anthropic, PBC." }]
8-
maintainers = [
9-
{ name = "David Soria Parra", email = "davidsp@anthropic.com" },
10-
{ name = "Justin Spahr-Summers", email = "justin@anthropic.com" },
11-
]
128
keywords = ["mcp", "llm", "automation", "web", "fetch", "http", "streamable"]
139
license = { text = "MIT" }
14-
classifiers = [
15-
"Development Status :: 4 - Beta",
16-
"Intended Audience :: Developers",
17-
"License :: OSI Approved :: MIT License",
18-
"Programming Language :: Python :: 3",
19-
"Programming Language :: Python :: 3.10",
20-
]
2110
dependencies = ["anyio>=4.5", "click>=8.1.0", "httpx>=0.27", "mcp", "starlette", "uvicorn"]
2211

2312
[project.scripts]

src/mcp/server/streamableHttp.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -492,10 +492,10 @@ async def _handle_get_request(self, request: Request, send: Send) -> None:
492492
return
493493

494494
# TODO: Implement SSE stream for GET requests
495-
# For now, return 501 Not Implemented
495+
# For now, return 405 Method Not Allowed
496496
response = self._create_server_response(
497497
"SSE stream from GET request not implemented yet",
498-
HTTPStatus.NOT_IMPLEMENTED,
498+
HTTPStatus.METHOD_NOT_ALLOWED,
499499
)
500500
await response(request.scope, request.receive, send)
501501

@@ -514,7 +514,6 @@ async def _handle_delete_request(self, request: Request, send: Send) -> None:
514514
if not await self._validate_session(request, send):
515515
return
516516

517-
# Terminate the session
518517
self._terminate_session()
519518

520519
response = self._create_server_response(

0 commit comments

Comments
 (0)