Skip to main content
Glama
tas1337

MCP A2A AP2 Food Delivery & Payments

by tas1337

mcp-a2a-ap2-im-hungry πŸ”πŸ’³

MCP server with A2A protocol (food delivery) + AP2 protocol (payments with Mandates).

Demo

AP2 Demo

Quick Start

git clone https://github.com/tas1337/mcp-a2a-ap2-im-hungry.git cd mcp-a2a-ap2-im-hungry npm start

Services:

  • MCP Server: http://localhost:8000/mcp

  • Registry: http://localhost:8004

  • DoorDash/UberEats/Grubhub: 8001-8003 (A2A)

  • Stripe: http://localhost:8005 (AP2)

What's Different from mcp-a2a-im-hungry?

mcp-a2a-im-hungry

This project

A2A only

A2A +

AP2

No payments

Stripe payments

β€”

Mandates

(signed authorization)

What is AP2?

Problem: AI agents spending money. Who approved it?

AP2 = Payments with Mandates β€” cryptographically signed proof of user intent.

MANDATE = { userId, maxAmount, expires, signature }

Flow (matches real-world AP2):

  1. User asks for cheeseburger πŸ”

  2. Your agent searches restaurants via A2A (discovers DoorDash/UberEats/Grubhub agents)

  3. Your agent gets menus and delivery estimates

  4. Your agent decides which restaurant (cheapest/fastest)

  5. User authorizes payment β†’ User's authorization service creates mandate (signed with user's private key)

  6. Your agent requests authorization β†’ Receives mandate from user

  7. Your agent sends payment request WITH mandate to Stripe agent (via A2A)

  8. Stripe agent VERIFIES mandate (signature valid? not expired? amount ok?)

  9. If valid β†’ Stripe processes payment βœ…

  10. Your agent places order with food delivery agent (DoorDash/UberEats/Grubhub via A2A)

  11. πŸ” Burger incoming!

Key Point: The agent NEVER creates mandates. User authorization creates them. Agent only uses them.

Project Structure

src/ β”œβ”€β”€ a2a-client.ts # Calls ANY agent (food or Stripe) β”œβ”€β”€ tools.ts # Food tools β”œβ”€β”€ ap2-tools.ts # Payment tools (requests user authorization) β”œβ”€β”€ user-authorization.ts # User creates mandates (real-world: wallet/auth service) mock-agents/ β”œβ”€β”€ food-delivery/ # DoorDash, UberEats, Grubhub β”œβ”€β”€ payments/ # Stripe (verifies mandates!) └── registry/ # Agent discovery

Tools

Tool

Description

search_restaurants

Search food (A2A)

get_menu

Get menu (A2A)

place_order

Order food (A2A)

process_payment

Pay via Stripe (AP2 + Mandate)

process_refund

Refund via Stripe (AP2 + Mandate)

Connect to Cursor

{ "mcpServers": { "mcp-a2a-ap2-im-hungry": { "url": "http://localhost:8000/mcp" } } }

Resources

-
security - not tested
A
license - permissive license
-
quality - not tested

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/tas1337/mcp-a2a-ap2-im-hungry'

If you have feedback or need assistance with the MCP directory API, please join our Discord server