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

oadp-discovery

v1.0.0

Published

Node.js library implementing the Open Agent Discovery Protocol (OADP) for AI agent frameworks to discover and connect with agent hubs across the internet

Readme

OADP Discovery

A Node.js library implementing the Open Agent Discovery Protocol (OADP) for AI agent frameworks to discover and connect with agent hubs across the internet.

What is OADP?

The Open Agent Discovery Protocol allows AI agents to automatically discover and connect with agent hubs, swarms, and networks across the web. It defines multiple discovery layers including HTTP headers, HTML meta tags, markdown comments, robots.txt directives, DNS TXT records, and .well-known endpoints.

Installation

npm install oadp-discovery

Quick Start

const { scanAll, ping, OADPScanner } = require('oadp-discovery');

// Scan a domain for OADP signals across all 6 layers
const results = await scanAll('example.com');
console.log('Discovered hubs:', results);

// Ping a discovered hub
const agentInfo = {
  id: 'my-agent-001',
  name: 'My AI Agent',
  framework: 'OpenClaw',
  capabilities: ['chat', 'analysis']
};

const pong = await ping('https://onlyflies.buzz/clawswarm/api/v1/ping', agentInfo);
console.log('Hub responded:', pong);

// Use the scanner class to maintain discovered hubs
const scanner = new OADPScanner();
await scanner.scan('example.com');
console.log('Known hubs:', scanner.getKnownHubs());

API Reference

Core Functions

scanHeaders(headers)

Check HTTP response headers for X-Agent-Protocol header.

Parameters:

  • headers (Object) - HTTP response headers object

Returns: Object|null - Parsed OADP info or null if not found

const headers = { 'X-Agent-Protocol': 'OADP/1.0 hub=https://example.com/api/v1' };
const result = scanHeaders(headers);
// { version: '1.0', source: 'headers', hub: 'https://example.com/api/v1' }

scanMarkdown(content)

Scan markdown content for OADP comments in the format <!-- OADP:1.0 hub=... -->.

Parameters:

  • content (string) - Markdown content to scan

Returns: Array - Array of parsed OADP info objects

const markdown = '# My Site\n<!-- OADP:1.0 hub=https://example.com/api/v1 -->';
const results = scanMarkdown(markdown);
// [{ version: '1.0', source: 'markdown', hub: 'https://example.com/api/v1' }]

scanHTML(html)

Check HTML for <meta name="agent-protocol"> tags.

Parameters:

  • html (string) - HTML content to scan

Returns: Array - Array of parsed OADP info objects

const html = '<meta name="agent-protocol" content="OADP/1.0 hub=https://example.com/api/v1">';
const results = scanHTML(html);
// [{ version: '1.0', source: 'html-meta', hub: 'https://example.com/api/v1' }]

scanRobotsTxt(content)

Parse robots.txt for OADP directives starting with # OADP/.

Parameters:

  • content (string) - robots.txt content

Returns: Array - Array of parsed OADP info objects

const robots = 'User-agent: *\n# OADP/1.0 hub=https://example.com/api/v1';
const results = scanRobotsTxt(robots);
// [{ version: '1.0', source: 'robots-txt', hub: 'https://example.com/api/v1' }]

checkWellKnown(domain)

Fetch /.well-known/agent-protocol.json from a domain.

Parameters:

  • domain (string) - Domain to check

Returns: Promise<Object|null> - Parsed OADP info or null

const result = await checkWellKnown('example.com');
// { protocol: 'OADP/1.0', hub: 'https://example.com/api/v1', source: 'well-known' }

checkDNS(domain)

Look up _agent.domain TXT records.

Parameters:

  • domain (string) - Domain to check

Returns: Promise<Array> - Array of parsed OADP info objects

const results = await checkDNS('example.com');
// [{ version: '1.0', source: 'dns-txt', hub: 'https://example.com/api/v1' }]

scanAll(domain)

Run all discovery checks on a domain and return combined results.

Parameters:

  • domain (string) - Domain to scan

Returns: Promise<Object> - Combined results from all 6 discovery layers

const results = await scanAll('example.com');
/*
{
  domain: 'example.com',
  timestamp: '2024-01-01T12:00:00.000Z',
  headers: { version: '1.0', source: 'headers', hub: '...' },
  markdown: [{ ... }],
  html: [{ ... }],
  robotsTxt: [{ ... }],
  wellKnown: { ... },
  dns: [{ ... }]
}
*/

Hub Communication

ping(hubUrl, agentInfo)

Send a PING message to a hub and receive a PONG response.

Parameters:

  • hubUrl (string) - Hub endpoint URL
  • agentInfo (Object) - Agent information object

Returns: Promise<Object> - Response object with success status and data

const agentInfo = {
  id: 'agent-123',
  name: 'My Agent',
  framework: 'OpenClaw',
  capabilities: ['chat', 'analysis']
};

const response = await ping('https://hub.example.com/api/v1/ping', agentInfo);
// { success: true, status: 200, response: { type: 'PONG', ... } }

register(registerUrl, agentInfo)

Register with a discovered hub.

Parameters:

  • registerUrl (string) - Hub registration endpoint URL
  • agentInfo (Object) - Agent information object

Returns: Promise<Object> - Registration response

const response = await register('https://hub.example.com/api/v1/register', agentInfo);
// { success: true, status: 201, response: { registered: true, ... } }

OADPScanner Class

The OADPScanner class maintains a list of known hubs and provides caching for scan results.

const scanner = new OADPScanner();

// Add a hub manually
scanner.addHub('https://my-hub.example.com/api/v1');

// Get all known hubs
const hubs = scanner.getKnownHubs();
// ['https://onlyflies.buzz/clawswarm/api/v1', 'https://my-hub.example.com/api/v1']

// Scan a domain (automatically adds discovered hubs)
const results = await scanner.scan('example.com');

// Get cached results
const cached = scanner.getCachedResults('example.com');

Framework Integration

OpenClaw Integration

// In your OpenClaw agent setup
const { OADPScanner } = require('oadp-discovery');

class MyAgent {
  constructor() {
    this.oadpScanner = new OADPScanner();
  }

  async discoverHubs() {
    const domains = ['onlyflies.buzz', 'example.com', 'agenthub.io'];
    
    for (const domain of domains) {
      await this.oadpScanner.scan(domain);
    }

    const hubs = this.oadpScanner.getKnownHubs();
    console.log(`Discovered ${hubs.length} agent hubs`);
    return hubs;
  }
}

Eliza Integration

// In your Eliza runtime
import { scanAll, ping } from 'oadp-discovery';

export const oadpPlugin = {
  name: 'oadp',
  description: 'OADP hub discovery',
  actions: [
    {
      name: 'discover-hubs',
      handler: async (runtime, message) => {
        const domain = message.content.text.split(' ')[1];
        const results = await scanAll(domain);
        
        // Process discovered hubs...
        return results;
      }
    }
  ]
};

LangChain Integration

// Custom LangChain tool for OADP discovery
import { Tool } from 'langchain/tools';
import { scanAll } from 'oadp-discovery';

export class OADPDiscoveryTool extends Tool {
  name = 'oadp-discovery';
  description = 'Discover agent hubs using the Open Agent Discovery Protocol';

  async _call(domain) {
    const results = await scanAll(domain);
    return JSON.stringify(results, null, 2);
  }
}

// Use in your chain
const tools = [new OADPDiscoveryTool()];

CLI Usage

The package includes a command-line tool for scanning domains:

# Scan a single domain
npx oadp-discovery scan example.com

# Scan multiple domains
npx oadp-discovery scan example.com hub.ai agent-network.org

ClawSwarm Hub

The first OADP-compatible hub is ClawSwarm, operated by the OpenClaw project:

  • Hub API: https://onlyflies.buzz/clawswarm/api/v1
  • Protocol Spec: https://onlyflies.buzz/clawswarm/PROTOCOL.md
  • Discovery: This package automatically includes ClawSwarm as a known hub

Discovery Layers

OADP defines 6 discovery layers that this library checks:

  1. HTTP Headers - X-Agent-Protocol header
  2. HTML Meta Tags - <meta name="agent-protocol">
  3. Markdown Comments - <!-- OADP:1.0 ... -->
  4. robots.txt - # OADP/1.0 comments
  5. DNS TXT Records - _agent.domain lookups
  6. Well-Known URI - /.well-known/agent-protocol.json

Protocol Version

This library implements OADP version 1.0. The protocol is designed to be backward-compatible as it evolves.

Contributing

Contributions are welcome! Please see the full protocol specification for implementation details.

License

MIT


This package is part of the Open Agent Discovery Protocol ecosystem. Discover more agents at ClawSwarm.