Service Discovery

Discover MPP-enabled services programmatically so agents can autonomously find and pay for APIs without manual configuration.

Overview

Service discovery enables agents to:

  • Find MPP-enabled services based on capability requirements

  • Detect payment support via HTTP headers

  • Parse pricing and payment method requirements

  • Build dynamic service catalogs

MPP Service Directory

The official MPP directory maintains a catalog of services accepting Machine Payments Protocol.

Query the directory

import { MoltMPPClient } from '@moltmpp/sdk'

const mpp = new MoltMPPClient({
  solanaRpc: 'https://api.mainnet-beta.solana.com',
  wallet: wallet
})

// Search for services by category
const services = await mpp.discoverServices({
  category: 'weather',
  paymentMethods: ['solana/usdc'],
  maxPriceUSD: 10.00
})

console.log(`Found ${services.length} services:`)
for (const service of services) {
  console.log(`- ${service.name}: $${service.priceUSD} per request`)
  console.log(`  URL: ${service.endpoint}`)
  console.log(`  Rating: ${service.rating}/5`)
}

Service metadata

Each service listing includes:

HTTP Header Detection

Services advertise MPP support via HTTP headers.

Check for MPP support

Detect payment methods

HTTP 402 Payment Required

When requesting a resource, MPP services return 402 with pricing details.

Request resource

Parse 402 response

Complete 402 response

Agent Service Discovery

Enable agents to discover services based on natural language requirements.

OpenClaw integration

Custom discovery logic

Building a Service Catalog

Maintain a local catalog of discovered services for faster lookups.

Catalog structure

MCP Server Discovery

Model Context Protocol (MCP) servers can advertise MPP payment support.

MCP manifest with MPP

Discover MCP servers

Service Reputation

Track service performance to build reputation scores.

Reputation tracking

Production Example

Complete service discovery system for production agents.

Next Steps

Resources

Last updated

Was this helpful?