Stellar Agent Merchant Lab

Stellar Agent Merchant Lab

An MCP server for AI agents to purchase resources via Stellar testnet USDC, handling quotes, purchase URLs, and merchant receipts.

Category
Visit Server

README

Stellar Agent Merchant Lab

Independent Stellar testnet merchant for reproducible agent purchase validation.

Merchant Lab is the seller-side counterpart to Stellar Agent Spend Hub. An agent discovers resources through MCP, receives a machine-readable quote, requests a purchase URL, handles an MPP 402 Payment Required challenge, and receives a resource plus a privacy-safe merchant receipt.

The local mode is explicitly simulated. It never emits a transaction hash or claims settlement. Real testnet settlement activates only with official Stellar MPP configuration, a separate merchant account, and atomic Upstash storage.

Why a separate project

A buyer paying a seller in another repository, process, deployment, and Stellar account proves more than an application calling itself. Merchant Lab creates that independent trust boundary and doubles as a reusable Provider Kit acceptance harness.

flowchart LR
  Agent["AI agent"] --> MCP["Merchant MCP quote"]
  MCP --> URL["Purchase URL"]
  URL --> Challenge["MPP 402"]
  Challenge --> Hub["Spend Hub policy"]
  Hub --> Human["Human confirmation"]
  Human --> Merchant["Merchant USDC account"]
  Merchant --> Delivery["Resource and receipt"]

Current capabilities

  • Three machine-purchasable resources priced from 0.001 to 0.01 USDC.
  • Provider definition at /.well-known/agent-provider.json.
  • MCP stdio and stateless Streamable HTTP transports.
  • Official Stellar MPP Charge integration for testnet USDC.
  • Local 402 -> credential -> delivery -> receipt simulation.
  • One-time local credentials and replay rejection.
  • Eight adversarial scenarios for buyer-policy tests.
  • Sanitized merchant receipts with no PII, secrets, XDR, or fake hashes.
  • Stateless checksummed simulated receipts that survive Vercel cold starts.
  • Independent buyer script and ten automated tests.
  • Zero known npm vulnerabilities.

Quick start

npm install
npm run qa
npm run build
npm run dev

Open http://localhost:4180.

In another terminal:

npm run demo:buyer -- --resource=market-signal --yes

Without --yes, the buyer stops at the human-confirmation boundary.

Public interfaces

Interface Purpose
GET /.well-known/agent-provider.json Machine-readable provider definition
GET /api/catalog Resource catalog and purchase URLs
GET /.well-known/legal-context.json LCP terms and verifiable ATR hash
GET /api/resource/:id MPP-protected delivery
GET /api/scenarios Valid and adversarial buyer tests
GET /api/receipts/:id Sanitized merchant evidence
GET /api/health Public readiness without secrets
POST /mcp Stateless MCP Streamable HTTP
npm run mcp:serve Local MCP stdio server

MCP tools

  • list_resources
  • quote_resource
  • list_test_scenarios
  • get_merchant_receipt

There is no MCP payment-execution tool. The MCP server quotes resources; Spend Hub owns policy and confirmation.

Test scenarios

  • happy
  • over-budget
  • wrong-recipient
  • wrong-asset
  • wrong-network
  • expired
  • unavailable
  • delivery-failure

Only happy is executable. Adversarial scenarios generate non-chargeable challenges or failures for buyer validation.

Real Stellar testnet mode

Configure private Vercel environment variables:

  • MERCHANT_SIMULATION_ENABLED=false
  • MPP_ENABLED=true
  • MPP_STELLAR_RECIPIENT=<merchant G address>
  • MPP_SECRET_KEY=<32+ random characters>
  • UPSTASH_REDIS_REST_URL
  • UPSTASH_REDIS_REST_TOKEN

Server-side public configuration:

  • PUBLIC_BASE_URL
  • MPP_NETWORK=stellar:testnet
  • MPP_PRICE_USDC=0.01
  • STELLAR_HORIZON_URL
  • SOROBAN_RPC_URL

No buyer secret belongs in this project or Vercel deployment.

Acceptance gate

Real evidence requires:

  1. A distinct merchant testnet account and USDC trustline.
  2. Official MPP challenge for the quoted resource.
  3. Spend Hub buyer validates price, recipient, asset and network.
  4. Human confirmation occurs before signing.
  5. Merchant receives USDC and delivers the resource.
  6. Merchant and buyer receipts reference the same public hash.
  7. Replay produces no second debit.
  8. Pending/simulated evidence never contains a hash.

See architecture, threat model, and deployment runbook.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured