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

@aroha-sdk/mcp-bridge

v2.0.0

Published

Aroha ↔ MCP (Model Context Protocol) adapter

Readme

@aroha-sdk/mcp-bridge

Beta npm

Translate between MCP tool definitions and Aroha agents, in both directions: wrap an MCP tool server as a callable Aroha agent, or call a discovered Aroha agent's capabilities as MCP tools.

Install

npm install @aroha-sdk/mcp-bridge

Quick example

import { wrapMcp, registryPublicKeyResolver } from "@aroha-sdk/mcp-bridge";

// Expose your MCP tools as an Aroha agent
const agent = await wrapMcp(server.listTools(), {
  name: "weather-tools",
  price: 0.01, // optional: charge $0.01 per call
  resolvePublicKey: registryPublicKeyResolver(), // verifies who's actually calling
  handlers: {
    // One entry per tool name returned by listTools(). Each must return the
    // tool's real result — wrapMcp() has no way to run your tool for you.
    get_weather: async (args) => ({
      content: [{ type: "text", text: await getWeather(args) }],
    }),
  },
});

await agent.start(); // throws if any tool in the list has no handler entry
// ✓ did:aroha:weather-tools  →  http://localhost:3001

Every incoming request is verified before any tool runs: signature (against the sender DID resolvePublicKey resolves), expiry, and nonce replay — the same validateEnvelope() every other Aroha transport in the SDK uses, not a bridge-specific check. A caller resolvePublicKey can't resolve, or whose signature doesn't match, never reaches a tool handler.

Requiring a spending mandate

const agent = await wrapMcp(server.listTools(), {
  name: "weather-tools",
  price: 0.01,
  resolvePublicKey: registryPublicKeyResolver(),
  requireMandate: true, // reject any call with no valid mandate granting the caller
  handlers: { /* ... */ },
});

With requireMandate: true, every request must carry a spending mandate (in body.credentialToken) that (a) grants the calling agent's DID specifically — a mandate granted to someone else is rejected — and (b) is signed by an issuer resolvePublicKey can resolve, with a real, checked signature — not just a mandate-shaped object present in the request. Issue mandates with issueIntentMandate / issueTaskMandate from @aroha-sdk/credentials.

API

  • wrapMcp(tools, opts) — wrap an array of MCP tool definitions as an Aroha agent. Returns { did, port, endpoint, capabilities, start() }.
  • opts.name — agent name (used to generate the DID).
  • opts.handlers — required. Real tool implementations, keyed by tool name, each returning { content: [{ type: "text", text }], isError? }.
  • opts.resolvePublicKey — required. Resolves a caller DID to its Ed25519 public key, used to verify every request's signature. Use registryPublicKeyResolver() for the common case, or supply your own.
  • opts.requireMandate — when true, reject any request without a valid spending mandate granting the caller. Default false.
  • opts.price — per-call price in USD, attached to the derived capability's pricing metadata.
  • opts.did / opts.port / opts.privateKey — override the auto-generated identity/port.
  • registryPublicKeyResolver(baseUrl?) — a resolvePublicKey implementation backed by the Aroha registry.
  • arohaAgentToMcpTools(agent, orchestratorDID, orchestratorPrivateKey, client, correlationId) — the other direction: call a discovered Aroha agent's capabilities as MCP tools. Returns { tools, handleToolCall }.
  • mcpToolsToArohaCapabilities(tools) — convert MCP tool definitions into Aroha capability definitions, used internally by wrapMcp().

License

MIT