MCP A2A AP2 Food Delivery & Payments

MCP A2A AP2 Food Delivery & Payments

Enables AI agents to discover and order food from multiple delivery services (DoorDash, UberEats, Grubhub) using A2A protocol and process payments via Stripe with AP2 protocol mandates for cryptographically signed user authorization.

Category
Visit Server

README

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

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

Demo

AP2 Demo

Flow

AP2 Flow

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

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
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
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
Qdrant Server

Qdrant Server

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

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
E2B

E2B

Using MCP to run code via e2b.

Official
Featured