File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,23 @@ async def test_sse_app_returns_starlette_app(self):
7777 assert sse_routes [0 ].path == "/sse"
7878 assert mount_routes [0 ].path == "/messages"
7979
80+ async def test_sse_app_passes_max_body_bytes (self ):
81+ mcp = MCPServer ("test" )
82+ app = mcp .sse_app (host = "0.0.0.0" , max_body_bytes = 123 )
83+
84+ mount_routes = [r for r in app .routes if isinstance (r , Mount )]
85+ assert len (mount_routes ) == 1
86+
87+ message_app = mount_routes [0 ].app
88+ assert hasattr (message_app , "__self__" ), "Expected a bound method for message handler"
89+ sse_transport = message_app .__self__
90+ assert getattr (sse_transport , "_max_body_bytes" ) == 123
91+
92+ async def test_streamable_http_app_passes_max_body_bytes (self ):
93+ mcp = MCPServer ("test" )
94+ mcp .streamable_http_app (host = "0.0.0.0" , max_body_bytes = 123 )
95+ assert mcp .session_manager .max_body_bytes == 123
96+
8097 async def test_non_ascii_description (self ):
8198 """Test that MCPServer handles non-ASCII characters in descriptions correctly"""
8299 mcp = MCPServer ()
You can’t perform that action at this time.
0 commit comments