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

@asterpay/agent-ready

v1.0.1

Published

Make any API AI-agent discoverable in one line. Generates robots.txt, llms.txt, agent.json, MCP endpoint, scanner filter, and CORS presets.

Readme

agent-ready

Make any API AI-agent discoverable in one line.

agent-ready auto-generates everything AI agents need to find and use your API:

  • robots.txt — welcomes AI crawlers (GPTBot, ClaudeBot, etc.)
  • llms.txt — human-readable endpoint catalog
  • agent.json — A2A agent card at /.well-known/agent.json
  • MCP server card at /.well-known/mcp/server-card.json
  • MCP JSON-RPC endpoint at POST /mcp
  • Scanner filter — blocks vulnerability scanners
  • CORS + security header presets

Works with Fastify, Express, and Next.js.

Install

npm install @asterpay/agent-ready

Quick Start

Fastify

import Fastify from 'fastify';
import { agentReady } from '@asterpay/agent-ready';

const app = Fastify();

await app.register(agentReady, {
  name: 'My API',
  description: 'Weather data for AI agents',
  baseUrl: 'https://api.example.com',
  endpoints: [
    {
      path: '/v1/weather',
      method: 'GET',
      description: 'Get current weather by city',
      free: true,
      params: {
        city: { type: 'string', required: true, description: 'City name' },
      },
    },
  ],
});

await app.listen({ port: 3000 });

Express

import express from 'express';
import { agentReadyExpress } from '@asterpay/agent-ready/express';

const app = express();
app.use(express.json());

app.use(agentReadyExpress({
  name: 'My API',
  description: 'Weather data for AI agents',
  baseUrl: 'https://api.example.com',
  endpoints: [
    {
      path: '/v1/weather',
      method: 'GET',
      description: 'Get current weather by city',
      free: true,
    },
  ],
}));

app.listen(3000);

Next.js (App Router)

// app/robots.txt/route.ts
import { createAgentReadyHandlers } from '@asterpay/agent-ready/nextjs';

const config = {
  name: 'My API',
  description: 'Weather data for AI agents',
  baseUrl: 'https://api.example.com',
  endpoints: [
    { path: '/api/weather', method: 'GET' as const, description: 'Get weather', free: true },
  ],
};

const handlers = createAgentReadyHandlers(config);

export const GET = () => handlers.robotsTxt();

// app/llms.txt/route.ts → export const GET = () => handlers.llmsTxt();
// app/.well-known/agent.json/route.ts → export const GET = () => handlers.agentJson();
// app/mcp/route.ts → export const POST = (req) => handlers.mcpEndpoint(req);
// app/health/route.ts → export const GET = () => handlers.health();

Configuration

interface AgentReadyConfig {
  name: string;             // API name
  description: string;      // What your API does
  baseUrl: string;          // Public URL

  endpoints: EndpointConfig[];  // Your API endpoints

  // Optional
  provider?: { name: string; url?: string; email?: string; organization?: string };
  version?: string;
  documentationUrl?: string;
  protocols?: string[];     // e.g. ['x402', 'mpp']
  chains?: string[];        // e.g. ['base', 'ethereum']
  tokens?: string[];        // e.g. ['USDC']

  features?: {
    robotsTxt?: boolean;      // default: true
    llmsTxt?: boolean;        // default: true
    agentJson?: boolean;      // default: true
    mcpEndpoint?: boolean;    // default: true
    mcpServerCard?: boolean;  // default: true
    scannerFilter?: boolean;  // default: true
    corsPreset?: boolean;     // default: true
    healthCheck?: boolean;    // default: true
  };

  payment?: {
    x402?: boolean;
    settlement?: 'EUR' | 'USD' | 'GBP';
  };

  scannerFilter?: {
    additionalUAs?: string[];
    additionalPaths?: string[];
    onScannerDetected?: (ua: string, path: string) => void;
  };
}

Endpoints

Each endpoint describes one route of your API:

{
  path: '/v1/kya/score',
  method: 'GET',
  description: 'Get AI agent trust score',
  free: true,                              // free = no payment required
  price: 0.01,                             // USD per call (for paid endpoints)
  params: {
    wallet: { type: 'string', required: true, description: 'Agent wallet address' },
  },
}

Scanner Filter

Automatically detects vulnerability scanners by user-agent and request path. Add custom rules:

app.use(agentReadyExpress({
  // ...config
  scannerFilter: {
    additionalUAs: ['my-internal-bot'],
    additionalPaths: ['/admin'],
    onScannerDetected: (ua, path) => {
      console.log(`Blocked scanner: ${ua} at ${path}`);
    },
  },
}));

Access req.isScanner in downstream handlers to conditionally handle scanner traffic.

Standalone Utilities

Use generators individually without the full middleware:

import {
  generateRobotsTxt,
  generateLlmsTxt,
  generateAgentJson,
  generateMcpServerCard,
  handleMcpRequest,
  isScannerUA,
  isScannerPath,
  getCorsPreset,
  getHelmetPreset,
} from '@asterpay/agent-ready';

What Gets Generated

After adding agent-ready, your API serves:

| Path | Description | |------|-------------| | GET /robots.txt | Welcomes AI crawlers | | GET /llms.txt | Endpoint catalog | | GET /.well-known/agent.json | A2A agent card | | GET /.well-known/mcp/server-card.json | MCP server card | | POST /mcp | MCP JSON-RPC 2.0 | | GET /health | Health check |

License

MIT