MCPcopy Create free account
hub / github.com/GH05TCREW/MetasploitMCP / SseEndpoint

Class SseEndpoint

MetasploitMCP.py:1646–1654  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1644
1645# Define ASGI handlers properly with Starlette's ASGIApp interface
1646class SseEndpoint:
1647 async def __call__(self, scope, receive, send):
1648 """Handle Server-Sent Events connection for MCP communication."""
1649 client_host = scope.get('client')[0] if scope.get('client') else 'unknown'
1650 client_port = scope.get('client')[1] if scope.get('client') else 'unknown'
1651 logger.info(f"New SSE connection from {client_host}:{client_port}")
1652 async with sse.connect_sse(scope, receive, send) as (read_stream, write_stream):
1653 await mcp._mcp_server.run(read_stream, write_stream, mcp._mcp_server.create_initialization_options())
1654 logger.info(f"SSE connection closed from {client_host}:{client_port}")
1655
1656class MessagesEndpoint:
1657 async def __call__(self, scope, receive, send):

Callers 1

MetasploitMCP.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected