npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ezmcpz/transport-sse

v0.1.1

Published

Server-Sent Events transport for EZMCPZ

Readme

@ezmcpz/transport-sse

Server-Sent Events (SSE) transport for EZMCPZ. Enables real-time, server-to-client streaming communication.

Installation

npm install @ezmcpz/transport-sse
# or
pnpm add @ezmcpz/transport-sse

Usage

import { McpServer } from '@ezmcpz/core';
import { sseTransport } from '@ezmcpz/transport-sse';

const server = new McpServer({
  name: 'my-server',
  version: '1.0.0'
});

// Add SSE transport
server.use(sseTransport({
  port: 3000,
  endpoint: '/sse',
  heartbeat: 30000
}));

await server.start();

Configuration

sseTransport({
  port: 3000,              // Port to listen on (default: 3000)
  host: '0.0.0.0',         // Host to bind to (default: '0.0.0.0')
  endpoint: '/sse',        // SSE endpoint path (default: '/sse')
  heartbeat: 30000,        // Heartbeat interval in ms (default: 30000)
  https: {                 // Optional HTTPS configuration
    cert: './cert.pem',
    key: './key.pem'
  },
  cors: {                  // CORS configuration
    origin: '*'
  }
})

How It Works

The SSE transport uses a two-endpoint model:

  1. GET /sse - Client connects and receives server-sent events
  2. POST /sse/message - Client sends messages to the server

This allows bidirectional communication while maintaining the SSE connection for server-to-client streaming.

Client Example

// Connect to SSE endpoint
const eventSource = new EventSource('http://localhost:3000/sse?clientId=my-client');

eventSource.onmessage = (event) => {
  const data = JSON.parse(event.data);
  console.log('Received:', data);
};

// Send a message
async function callTool(name: string, args: any) {
  const response = await fetch('http://localhost:3000/sse/message', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      clientId: 'my-client',
      message: {
        jsonrpc: '2.0',
        id: 1,
        method: 'tools/call',
        params: { name, arguments: args }
      }
    })
  });
  
  return response.json();
}

// Call a tool
await callTool('my_tool', { arg: 'value' });

Features

  • Real-time streaming: Server can push updates to clients
  • Automatic reconnection: SSE clients automatically reconnect
  • Heartbeat: Keeps connections alive with periodic pings
  • Multiple clients: Supports multiple concurrent client connections
  • HTTPS support: Optional SSL/TLS encryption
  • CORS support: Configurable cross-origin resource sharing

Endpoints

GET /sse

Establish SSE connection.

Query Parameters:

  • clientId (optional): Client identifier

Response: Event stream

POST /sse/message

Send a message to the server.

Request:

{
  "clientId": "my-client",
  "message": {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "my_tool",
      "arguments": { "arg": "value" }
    }
  }
}

Response:

{
  "status": "sent",
  "messageId": 1
}

The actual result will be sent via the SSE connection.

GET /health

Health check endpoint.

Response:

{
  "status": "healthy",
  "name": "my-server",
  "version": "1.0.0",
  "connectedClients": 5
}

Use Cases

  • Real-time notifications
  • Long-running operations with progress updates
  • ChatGPT and other AI assistants
  • Web-based MCP clients
  • Dashboard applications

License

MIT