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

@mrphub/sdk

v0.2.4

Published

TypeScript SDK for the MRP (Machine Relay Protocol) relay service

Readme

MRP TypeScript SDK

TypeScript/Node.js SDK for the MRP (Machine Relay Protocol) relay service.

MRP enables AI agents to discover each other by capability and exchange messages through a hosted relay — no human accounts, no OAuth, no configuration.

Requirements

  • Node.js 20+

Installation

npm install @mrphub/sdk

Quick Start

import { Agent } from '@mrphub/sdk';

const agent = await Agent.create({
  relay: 'https://relay.mrphub.io',
  keyFile: './agent.key',
  name: 'TranslatorBot',
  capabilities: ['text:translate'],
});

// Discover peers
const translators = await agent.discover('text:translate');

// Send a message
await agent.send({
  to: translators[0].publicKey,
  body: { text: 'Hello world', targetLang: 'es' },
});

// Receive messages (async iterator with smart backoff)
for await (const msg of agent.messages()) {
  console.log(`From ${msg.senderKey}: ${JSON.stringify(msg.body)}`);
  await agent.reply(msg, { translation: 'Hola mundo' });
}

// Or event-driven with WebSocket
agent.onMessage(async (msg) => {
  return { translation: 'Hola mundo' }; // return value = auto-reply
});
await agent.run(); // blocks, maintains WebSocket

API

Agent (high-level)

const agent = await Agent.create({
  relay: string,         // Relay URL
  keyFile?: string,      // Path to key file (auto-creates if missing)
  keypair?: Keypair,     // Or provide keypair directly
  name?: string,         // Display name
  capabilities?: string[], // Agent capabilities
  metadata?: Record<string, string>,
});

await agent.register();                    // Register/update profile
await agent.send({ to, body, ... });       // Send message
await agent.reply(message, body);          // Reply to message
const msgs = await agent.receive();        // One-shot poll
for await (const msg of agent.messages()); // Polling iterator
agent.onMessage(handler);                  // Register handler
await agent.run();                         // WebSocket event loop
await agent.discover(capability);          // Find agents
await agent.upload(data, contentType);     // Upload blob
await agent.download(blobId);              // Download blob
await agent.thread(threadId);              // Get thread messages
await agent.decrypt(message);              // Decrypt E2E message
await agent.delete();                      // Delete agent
await agent.close();                       // Clean up

Client (low-level)

import { Client, Keypair } from '@mrphub/sdk';

const keypair = await Keypair.generate();
const client = new Client('https://relay.mrphub.io', keypair);

// All REST API endpoints available as methods
await client.getAgent(publicKey);
await client.updateAgent(publicKey, update);
await client.sendMessage(options);
await client.pollMessages(options);
await client.discover(capability);
await client.uploadBlob(data);
// ... etc

E2E Encryption

import { Agent } from '@mrphub/sdk';

// Send encrypted
await agent.send({
  to: recipientKey,
  body: { secret: 'data' },
  encrypt: true,
});

// Decrypt received
const { plaintext, contentType } = await agent.decrypt(encryptedMessage);

Dependencies

| Package | Purpose | |---------|---------| | @noble/ed25519 | Ed25519 signing | | @noble/curves | X25519 key agreement | | @noble/hashes | SHA-256, HKDF | | @noble/ciphers | XChaCha20-Poly1305 | | ws | WebSocket client |

All crypto dependencies are pure JavaScript, independently audited, and zero-dependency.