File tree 2 files changed +5
-3
lines changed
2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -30,12 +30,12 @@ dependencies = [
30
30
" sse-starlette>=1.6.1" ,
31
31
" pydantic-settings>=2.5.2" ,
32
32
" uvicorn>=0.23.1" ,
33
- " websockets>=15.0.1" ,
34
33
]
35
34
36
35
[project .optional-dependencies ]
37
36
rich = [" rich>=13.9.4" ]
38
37
cli = [" typer>=0.12.4" , " python-dotenv>=1.0.0" ]
38
+ ws = [" websockets>=15.0.1" ]
39
39
40
40
[project .scripts ]
41
41
mcp = " mcp.cli:app [cli]"
Original file line number Diff line number Diff line change @@ -56,8 +56,9 @@ async def ws_reader():
56
56
except ValidationError as exc :
57
57
# If JSON parse or model validation fails, send the exception
58
58
await read_stream_writer .send (exc )
59
- except (anyio .ClosedResourceError , Exception ):
59
+ except (anyio .ClosedResourceError , Exception ) as e :
60
60
await ws .close ()
61
+ raise e
61
62
62
63
async def ws_writer ():
63
64
"""
@@ -71,8 +72,9 @@ async def ws_writer():
71
72
by_alias = True , mode = "json" , exclude_none = True
72
73
)
73
74
await ws .send (json .dumps (msg_dict ))
74
- except (anyio .ClosedResourceError , Exception ):
75
+ except (anyio .ClosedResourceError , Exception ) as e :
75
76
await ws .close ()
77
+ raise e
76
78
77
79
async with anyio .create_task_group () as tg :
78
80
# Start reader and writer tasks
You can’t perform that action at this time.
0 commit comments