-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
Problem Description
The Letta MCP client has compatibility issues with MCP servers that implement SSE (Server-Sent Events) transport. When connecting to MCP servers via SSE, Letta attempts to send JSON-RPC requests via POST to the SSE endpoint, which is not supported by the MCP specification.
Root Cause Analysis
After examining the Letta source code and testing with FastMCP servers, the issue is:
- Letta's SSE client expects bidirectional communication - It tries to POST JSON-RPC requests to
/sse
endpoint - FastMCP's SSE implementation is unidirectional - It only supports server→client streaming via GET requests
- MCP SSE specification requires bidirectional communication - Clients should be able to send requests over the SSE connection itself
Expected Behavior
Letta should follow the proper MCP SSE protocol flow:
- Connect to SSE endpoint (
/sse
) via GET request - Send JSON-RPC requests (
initialize
,tools/list
) over the SSE connection itself - Receive responses via SSE events
- Use established session for subsequent operations
Current Behavior
Letta incorrectly attempts to:
- ✅ Connect to SSE endpoint via GET request (works)
- ❌ Send JSON-RPC requests via POST to
/sse
endpoint (405 Method Not Allowed) - ❌ Send JSON-RPC requests via POST to
/messages/
endpoint (requires session_id)
This causes:
- HTTP 405 Method Not Allowed on POST to
/sse
- HTTP 400 Bad Request on POST to
/messages/
(session_id required) - Tool loading failures
Technical Details
From the Letta source code (letta/services/mcp/sse_client.py
):
- Uses official MCP library's
sse_client
- Expects bidirectional communication over SSE
- Creates
ClientSession
with SSE transport streams
From server logs:
INFO: 34.72.165.107:36352 - "POST /sse HTTP/1.1" 405 Method Not Allowed
INFO: 64.95.12.49:53934 - "POST /messages/ HTTP/1.1" 400 Bad Request
Impact
This prevents Letta from successfully connecting to MCP servers that properly implement SSE transport according to the MCP specification.
Workaround
MCP server developers are forced to implement permissive endpoints that bypass proper MCP protocol flow, which compromises security and protocol compliance.
Request
Please update the Letta MCP client to properly implement bidirectional SSE communication according to the MCP specification, allowing JSON-RPC requests to be sent over the SSE connection itself rather than via separate POST requests.
Environment
- Letta version: Latest
- MCP Protocol version: 2024-11-05
- Server: FastMCP-based servers with proper SSE implementation
- Issue confirmed with clean FastMCP implementation (no custom overrides)