feat: implemented streamable HTTP transport

Description:

Added a second transport alongside stdio. The server now accepts MCP requests over HTTP at POST /mcp.

What's in this MR:

  • src/transports/http.ts : Express app via createMcpExpressApp, stateless StreamableHTTPServerTransport), open CORS headers, OPTIONS preflight -> 204, GET/DELETE -> 405
  • src/index-http.ts : separate entrypoint, reads PORT env var (default 3000), registers SIGTERM/SIGINT for graceful shutdown, friendly EADDRINUSE message on double-start
  • ALLOWED_HOSTS env var : comma-separated hostnames for DNS rebinding protection; unset = no restriction
  • Error handling : try/catch in POST handler returns JSON-RPC -32603 on unexpected errors

Design decisions:

  • Stateless mode: no session state needed, all tools are pure CDLI API fetches
  • Separate entry point (index-http.ts) , zero risk of touching the stdio path

Merge request reports

Loading