File tree 1 file changed +7
-1
lines changed
src/mcp_grafana/transports
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 11
11
from pydantic import ValidationError
12
12
from starlette .datastructures import Headers
13
13
from starlette .requests import Request
14
- from starlette .responses import JSONResponse , Response
14
+ from starlette .responses import JSONResponse , PlainTextResponse , Response
15
15
from starlette .types import ASGIApp , Receive , Scope , Send
16
16
17
17
from ..client import GrafanaClient , grafana_client
@@ -156,6 +156,12 @@ async def handle_post_message():
156
156
logger .debug ("Sending client message" )
157
157
await read_stream_writer .send (client_message )
158
158
159
+ if isinstance (client_message .root , types .JSONRPCNotification ):
160
+ # Notifications don't have a response, so we don't need to wait for one.
161
+ response = PlainTextResponse ("Accepted" , status_code = 202 )
162
+ await response (scope , receive , send )
163
+ return
164
+
159
165
# Wait for the server's response, and forward it to the client.
160
166
server_message = await write_stream_reader .receive ()
161
167
obj = server_message .model_dump (
You can’t perform that action at this time.
0 commit comments