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

@reaatech/agent-handoff-transport

v0.1.0

Published

Transport layer (MCP + A2A) for the Agent Handoff Protocol

Readme

@reaatech/agent-handoff-transport

npm version License: MIT CI

Status: Pre-1.0 — APIs may change in minor versions. Pin to a specific version in production.

Transport layer implementations for delivering handoffs between agents. Includes MCP (tool-call-based), A2A (HTTP POST with retry), and a transport factory with health-check caching and priority-based auto-selection.

Installation

npm install @reaatech/agent-handoff-transport
# or
pnpm add @reaatech/agent-handoff-transport

Feature Overview

  • MCPTransport — handoffs via MCP accept_handoff tool calls with connection validation via ping
  • A2ATransport — handoffs via HTTP POST with exponential backoff retry and full jitter
  • TransportFactory — priority-based auto-selection with 30-second TTL health cache
  • Pluggable clients — inject your own MCPClient or HttpClient implementation
  • Payload limits — 10 MB (MCP) and 50 MB (A2A) max payload enforcement
  • Snake-case mapping — MCP transport converts camelCase payload to expected snake_case args

Quick Start

import {
  MCPTransport,
  A2ATransport,
  TransportFactory,
} from '@reaatech/agent-handoff-transport';

// MCP transport
const mcpTransport = new MCPTransport({
  async callTool(params) {
    return { accepted: true, responseCode: 200 };
  },
  async ping(serverId) { /* noop */ },
});

// A2A transport with auth
const a2aTransport = new A2ATransport({
  async get(url) { return { status: 200 }; },
  async post(url, body) { return { status: 200, data: body }; },
}, { authHeaders: { 'x-api-key': 'sk-abc123' } });

// Auto-select best transport
const factory = new TransportFactory([mcpTransport, a2aTransport]);
const transport = factory.getTransport(agentCapabilities);
// Returns highest-priority healthy transport for the agent

Exports

Transports

| Export | Priority | Protocol | Description | |---|---|---|---| | MCPTransport | 1 | MCP | Tool-call-based handoffs via accept_handoff | | A2ATransport | 2 | HTTP | RESTful handoffs with retry and health checks |

MCPTransport

new MCPTransport(client: MCPClient)

MCPClient Interface

| Method | Description | |---|---| | callTool(params) | Invoke accept_handoff tool with snake_case payload | | ping(serverId) | Validate connection to MCP server |

The transport converts HandoffPayload to snake_case MCP tool-call arguments and parses the response. Connection validation uses ping. Max payload: 10 MB.

A2ATransport

new A2ATransport(client: HttpClient, options?: A2ATransportOptions)

HttpClient Interface

| Method | Description | |---|---| | get(url) | Health check via GET {endpoint}/health | | post(url, body) | Send handoff via POST {endpoint}/handoffs |

A2ATransportOptions

| Property | Type | Default | Description | |---|---|---|---| | authHeaders | Record<string, string> | {} | Custom headers added to all requests |

Uses withRetry from @reaatech/agent-handoff for network errors and 5xx responses. Exponential backoff with full jitter. Max payload: 50 MB.

TransportFactory

new TransportFactory(transports: TransportLayer[], healthTtlMs?: number)

| Method | Description | |---|---| | getTransport(agent, preferred?) | Select transport by user preference or auto-detect | | registerTransport(transport) | Add a new transport layer | | unregisterTransport(name) | Remove a transport by name | | checkHealth(agent) | Pre-warm health cache for an agent | | getRegisteredTransports() | List all registered transport names |

Auto-selection: returns the highest-priority transport whose validateConnection returns true. Health results are cached with a 30-second TTL. Pass preferred: 'mcp' or preferred: 'a2a' to override auto-selection.

Related Packages

License

MIT