streamable-http-sse-mcp-server

z63d/streamable-http-sse-mcp-server

3.2

If you are the rightful owner of streamable-http-sse-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The Streamable HTTP SSE MCP Server is a versatile server implementation that supports both HTTP and Server-Sent Events (SSE) protocols for interacting with Model Context Protocol (MCP) tools.

Tools
1
Resources
0
Prompts
0

streamable-http-sse-mcp-server

Based on: https://github.com/modelcontextprotocol/servers/tree/d6e218d0f88bf0f03fa6b05cdf87d0c209b89289/src/everything

Setup

npm install
npm run build

Streamable HTTP

How to Run

npm run start:streamableHttp

The server will start at http://localhost:3001

Manual Testing

Initialize a session

curl -i -X POST http://localhost:3001/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "initialize",
    "params": {
      "protocolVersion": "2025-06-18",
      "capabilities": {},
      "clientInfo": {
        "name": "test-client",
        "version": "1.0.0"
      }
    }
  }'

Set the session ID from the mcp-session-id header in the response

SESSION_ID=<SESSION_ID>

List available tools

curl -X POST http://localhost:3001/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "mcp-session-id: $SESSION_ID" \
  -d '{
    "jsonrpc": "2.0",
    "id": 2,
    "method": "tools/list"
  }'

Call a tool

curl -X POST http://localhost:3001/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "mcp-session-id: $SESSION_ID" \
  -d '{
    "jsonrpc": "2.0",
    "id": 3,
    "method": "tools/call",
    "params": {
      "name": "echo",
      "arguments": {
        "message": "Hello World"
      }
    }
  }'

Register with Claude Code

claude mcp add-json streamable-http-echo -s user '{
    "type": "http",
    "url": "http://localhost:3001/mcp"
  }'

Remove

claude mcp remove streamable-http-echo -s user

HTTP with Server-Sent Events (SSE)

How to Run

npm run start:sse

The server will start at http://localhost:3001

Manual Testing

Establish SSE connection

curl -N http://localhost:3001/sse

Set the session ID from the SSE event data response

SESSION_ID=<SESSION_ID>

List available tools

curl -X POST "http://localhost:3001/message?sessionId=$SESSION_ID" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 2,
    "method": "tools/list"
  }'

Call a tool

curl -X POST "http://localhost:3001/message?sessionId=$SESSION_ID" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "echo",
      "arguments": {
        "message": "Hello World"
      }
    }
  }'

Register with Claude Code

claude mcp add-json sse-echo -s user '{
    "type": "sse",
    "url": "http://localhost:3001/sse"
  }'

Remove

claude mcp remove sse-echo -s user