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

mcp-agent-broker

v1.0.2

Published

The Model Context Protocol (MCP) Agent Broker is a centralized service designed to orchestrate and manage autonomous coding agents.

Readme

MCP Agent Broker

The Model Context Protocol (MCP) Agent Broker is a centralized service designed to orchestrate and manage autonomous coding agents.

It acts as a middleware that securely maps AI Agents (Principals) to tasks, enforcing distributed locks (Fencing Tokens) so multiple agents don't step on each other's toes when working on the same repository.

Features

  • MCP Server Integration: Natively implements the MCP SDK via Server-Sent Events (SSE).
  • Secure Authentication: Validates API keys against securely hashed database records.
  • Distributed Locking: Safely hand off tasks between implementer agents and reviewer agents using fencing tokens.
  • Transactional Outbox: Guaranteed delivery of domain events without dual-write issues.
  • Event Relay: Real-time event broadcasting over Redis Pub/Sub.

Getting Started

1. Start the Infrastructure

The broker requires PostgreSQL and Redis. We provide a docker-compose.yml to spin up everything (including the broker itself) instantly.

docker compose up -d

Note: If you are doing local development, you can run docker compose up -d postgres redis and then run the app locally using npm run dev.

2. Generate an API Key

To connect to the broker, your Agent must have an API Key. We provide a seed script to generate your first Workspace, Principal, and API Key.

npx tsx seed_api_key.ts

Take note of the API Key (e.g. test-api-key-123) output by the terminal.

3. Connect your Agents

Point your MCP-compatible client to the broker's endpoint and pass your API key as a Bearer token.

Programmatic Example (TypeScript):

import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";

const transport = new SSEClientTransport(new URL("http://localhost:3000/mcp/sse"), {
  eventSourceInit: {
    headers: { Authorization: "Bearer test-api-key-123" }
  } as any,
  requestInit: {
    headers: { Authorization: "Bearer test-api-key-123" }
  }
});

const client = new Client({ name: "my-agent", version: "1.0.0" }, { capabilities: {} });
await client.connect(transport);

// Register your agent!
await client.request({
  method: "tools/call",
  params: {
    name: "register_agent",
    arguments: { 
      workspaceId: "00000000-0000-0000-0000-000000000000", 
      name: "My Implementer Agent", 
      version: "1.0", 
      capabilities: ["execute"] 
    }
  }
}, CallToolResultSchema);

4. Listen to Real-Time Events

Any downstream CI dashboard or review agent can connect to the Redis server and subscribe to workspace:{workspace_id}:events to see real-time updates as tasks are created and leases are acquired!


Future Improvements for Contributors

  • Implement standard OAuth2 / OIDC for user-facing dashboards.
  • Extend the Review Module to enforce reviewer sign-offs before pushing to main branches.
  • Implement the Fencing Token check in a Git Hook or CI/CD layer.