-
Notifications
You must be signed in to change notification settings - Fork 6
Description
Describe the bug
When running the server via the npx
command and connecting to it from a standard SSE client through an ngrok tunnel, the server process crashes instantly upon receiving the first connection request. The crash appears to be caused by the server trying to JSON.parse a raw HTTP request.
Steps to Reproduce
- Start an ngrok tunnel:
ngrok http 8008 --request-header-add "ngrok-skip-browser-warning: true"
- Start the server with a valid API key:
LIMITLESS_API_KEY="sk-..." npx 199bio-mcp-limitless-server
- The server logs:
Limitless MCP Server starting...
- Connect a client (e.g., an app that connects to a custom SSE URL) to the ngrok forwarding address.
- The
ngrok
console shows a502 Bad Gateway
error. - The server terminal shows no immediate output, but after pressing Enter, the following stack trace is revealed:
Error Log
MCP Server Error: SyntaxError: Unexpected end of JSON input
at JSON.parse ()
at deserializeMessage (file:///Users/someuser/.npm/_npx/17fdf017b1962859/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js:26:44)
at ReadBuffer.readMessage (file:///Users/someuser/.npm/_npx/17fdf017b1962859/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js:19:16)
at StdioServerTransport.processReadBuffer (file:///Users/someuser/.npm/_npx/17fdf017b1962859/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js:39:50)
at StdioServerTransport._ondata (file:///Users/someuser/.npm/_npx/17fdf017b1962859/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js:17:18)
at ReadStream.emit (node:events:507:28)
at addChunk (node:internal/streams/readable:559:12)
at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
at Readable.push (node:internal/streams/readable:390:5)
at TTY.onStreamRead (node:internal/stream_base_commons:189:23)
Expected behavior
The server should be able to handle an incoming HTTP/SSE connection from a standard client without crashing.