SSE Event Handling in Claude Code/Desktop
Feature Request: Support for Server-Sent Events in MCP Integration
Currently, both Claude Code (CLI) and Claude Desktop lack support for
receiving asynchronous notifications via Server-Sent Events (SSE) from MCP
servers. While these clients can successfully establish connections to MCP
servers with SSE transport and call tools, they cannot process or react to
server-initiated messages.
Current Limitations
- Claude clients can connect to SSE-enabled MCP servers
- Tool invocation works correctly (request-response pattern)
- However, asynchronous events sent from server to client are not processed
Technical Background
When implementing a timer/reminder service:
- The MCP server correctly registers SSE connections
- Events are properly emitted by the server when timers trigger
- Server logs confirm events are sent (status 202)
- Client does not wake up or process these events
Use Cases Blocked by This Limitation
This limitation prevents several valuable use cases:
- "Standby mode" where Claude waits for certain events
- Background processing with notifications
- Timed reminders and scheduled operations
- Event-based workflows (file changes, incoming emails, etc.)
Implementation Considerations
The MCP protocol already supports this functionality, but the Claude clients
would need:
- Event loop integration to monitor SSE streams
- Callback mechanism to process server-initiated events
- UI/interaction model for handling asynchronous notifications
Adding this capability would significantly enhance Claude's ability to
participate in complex, asynchronous workflows and better integrate with
external systems.
---
Note: This feature request is based on testing done with Claude Code itself.
The demonstration code and analysis of limitations were collaboratively
developed with Claude Code assisting in the implementation and debugging
process.
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗