Skip to content

Commit

Permalink
add sse logging
Browse files Browse the repository at this point in the history
  • Loading branch information
SecretiveShell committed Jan 24, 2025
1 parent 0a635df commit 5473458
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mcp_bridge/mcp_server/sse.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from .sse_transport import SseServerTransport
from fastapi import APIRouter, Request
from pydantic import ValidationError
from loguru import logger

from .server import server, options

Expand All @@ -14,6 +15,7 @@

@router.get("/", response_class=StreamingResponse)
async def handle_sse(request: Request):
logger.info("new incoming SSE connection established")
async with sse.connect_sse(request) as streams:
try:
await server.run(streams[0], streams[1], options)
Expand All @@ -30,5 +32,6 @@ async def handle_sse(request: Request):

@router.post("/messages")
async def handle_messages(request: Request):
logger.info("incoming SSE message received")
await sse.handle_post_message(request.scope, request.receive, request._send)
await request.close()

0 comments on commit 5473458

Please sign in to comment.