1
Initialize the SSE stream
Open a persistent
GET request to the MCP server endpoint. Include your Bearer token in the Authorization header. The connection stays open for the duration of the session.2
Receive the session ID
The server streams an Your session URL becomes:
event: endpoint message containing your unique session URL. Parse the data line to extract the path and prepend the base URL.3
Dispatch the JSON-RPC call
POST your JSON-RPC 2.0 payload to the session URL. The server immediately returns
HTTP 202 Accepted. The actual result, such as a DISPATCH_SUCCESS payload or a completed order, arrives later as an SSE message on the open stream.JavaScript example: opening the stream and extracting the session URL
The following example uses the nativefetch API to open the SSE stream, read chunks, and extract the session URL with a regular expression.
What happens after dispatch
After the POST returns202 Accepted, the server processes the request asynchronously. For a human-in-the-loop tool such as lexera_route_to_specialist, this means:
- The server places a temporary AED wallet hold.
- The document enters the assigned law firm’s triage queue.
- Once the attorney completes review, the server streams the finalized payload back over your open SSE connection.
Next steps
- Browse the available MCP tools in Tools Overview
- Understand how pricing and wallet holds work in Wallet & Pricing