Parley
Handles order payments by creating Razorpay payment links and charging against spend mandates.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ParleyCan you find an ergonomic chair in stock and place an order under my $300 mandate?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Architecture
flowchart LR
subgraph EXT [ Their AI client ]
direction TB
BA[Buyer agent<br/><i>Claude · ChatGPT · Gemini</i>]
end
subgraph PARLEY [ Your Parley deployment ]
direction TB
WK[".well-known/<br/>agent-commerce.json"]
MCP["MCP endpoint<br/><b>/api/mcp</b>"]
TOOLS["9 tools<br/><i>search · stock · order<br/>mandate · audit</i>"]
SELLER["Seller agent<br/><i>persona + limits</i>"]
DASH["Dashboard<br/><b>/dashboard</b>"]
PG[("Postgres<br/>audit_log · mandates")]
end
subgraph STORE [ Your existing store ]
direction TB
API1["GET search"]
API2["GET product"]
API3["POST order"]
end
RZP[["Razorpay<br/>payment link"]]
U([Customer])
U --> BA
BA <-->|"discovers"| WK
BA <-->|"JSON-RPC"| MCP
MCP --> TOOLS
TOOLS <--> SELLER
TOOLS -->|"read"| API1
TOOLS -->|"read"| API2
TOOLS -->|"write"| API3
TOOLS -->|"log every decision"| PG
TOOLS -->|"needs approval"| RZP
PG --> DASH
classDef ext fill:#1e293b,stroke:#475569,color:#e2e8f0
classDef core fill:#0f2942,stroke:#2563eb,color:#dbeafe
classDef store fill:#0f2e1f,stroke:#16a34a,color:#dcfce7
classDef pay fill:#2e1f0f,stroke:#d97706,color:#fed7aa
class BA ext
class WK,MCP,TOOLS,SELLER,DASH,PG core
class API1,API2,API3 store
class RZP payParley never writes to your database. Every order goes through your own API.
Where this sits in the 2026 protocol landscape. Parley is an MCP-based implementation of the emerging agentic-commerce pattern — UCP-style discovery, AP2-style mandates, Razorpay as the settlement layer. The transport layer is the one exact match: Parley speaks MCP, so any MCP client is a first-class buyer agent. Above that, everything is patterned rather than compliant. search_products, get_product_details and check_stock play the role UCP's catalog-and-cart discovery plays, but they answer in Parley's own schema, not a UCP manifest — and the .well-known/agent-commerce.json document maps Parley's order vocabulary onto ACP's checkout-session concepts purely as a reading aid for agents that already speak it, which it states rather than claiming compliance. create_mandate / check_mandate mirrors conceptually what an AP2 mandate does — a bounded, customer-authorized spend cap that lets a purchase complete without a human in the loop — but it is self-issued and enforced as a cap-and-ledger in Postgres, not a W3C Verifiable Credential or a cryptographic proof chain. Settlement is a Razorpay test-mode payment, not a Shared Payment Token. That last one is a deliberate scoping choice: the point is to prove Razorpay's own rails can carry agent-initiated commerce end to end, not to interoperate with Google's or OpenAI's stacks.
Related MCP server: Mercora
How a purchase happens
sequenceDiagram
autonumber
actor C as Customer
participant B as Buyer agent
participant P as Parley
participant S as Your store
participant R as Razorpay
C->>B: "Buy a navy tee under ₹1500"
B->>P: search_products
P->>S: GET search
S-->>P: catalog
P-->>B: normalized products
B->>P: check_stock
P->>S: GET product (live, never cached)
S-->>P: stock: 8
B->>P: create_order_and_pay
Note over P: discount clamped in code
P->>S: POST order
alt Out of stock
S-->>P: 409 out_of_stock
P-->>B: blocked · nothing charged
else Store is down
S-->>P: 5xx
P-->>B: unavailable · try again
else Accepted
S-->>P: order_id
alt Mandate covers the amount
P->>P: charge against cap
P-->>B: completed · no human needed
else No mandate
P->>R: create payment link
R-->>P: link
P-->>B: awaiting approval
B-->>C: pay here →
end
end
P->>P: write audit_log rowBefore you start
Parley does not run your store. It talks to the store you already have.
Almost every business online today already has a website, and behind that website are real APIs — the same endpoints your own site calls to list products, check stock and place orders. Parley plugs into those. This is the one hard requirement.
You need three HTTP endpoints:
Endpoint | What it must do | Example |
Search products | Return your catalog, so the agent can find items |
|
Get one product | Return a single product with its live stock |
|
Create an order | Reserve the stock and return an order id |
|
One more is optional: an order-status endpoint. Leave it unset and Parley reuses your order API.
Field names and JSON shape are up to you — you map them in config, not in code, so no existing endpoint has to be rewritten to fit Parley.
If you do not have these APIs yet, Parley has nothing to connect to. It never scrapes your website and never reads your database directly. Expose the three endpoints first, then come back to the steps below.
Quickstart
1 · Clone
git clone https://github.com/Mudavath-Giri-Naik/Parley.git
cd Parley
npm installRequires Node 20+
2 · Configure
cp .env.example .env.localSet these four:
MERCHANT_NAME="Your Store"
MERCHANT_SEARCH_API=https://yourstore.com/api/products
MERCHANT_STOCK_API=https://yourstore.com/api/products
MERCHANT_ORDER_API=https://yourstore.com/api/ordersThen set PRICE_UNIT to match your API:
Your API returns |
|
Your API returns |
|
→ Everything else: docs/CONFIGURATION.md
3 · Add a database
Any Postgres. Free Supabase or Neon works.
Run supabase/0001_shared_schema.sql against it — it creates the tables, a parley_app role, and the row-level isolation policies. Every row of its verification query must read PASS.
PARLEY_DB_URL=postgresql://parley_app:pass@host:5432/db?sslmode=requireConnect as
parley_app, not as a superuser. A superuser bypasses row-level security, which silently removes the isolation layer.On Supabase, use the pooler connection string (Project Settings → Database → Connection pooling). The direct
db.<ref>.supabase.cohost is IPv6-only and will not resolve on most IPv4 networks.
4 · Add payment keys
From your Razorpay dashboard → Settings → API Keys.
RAZORPAY_KEY_ID=rzp_test_xxxxx
RAZORPAY_KEY_SECRET=xxxxx5 · Run locally
npm run devOpen http://localhost:3000 and confirm:
No "Configuration incomplete" warning
Capability cards show green
Prices match your real catalog
npm run test:regression6 · Deploy
npx vercel --prod⚠️ Re-enter every variable in Vercel → Settings → Environment Variables, then redeploy.
.env.localis not uploaded.
7 · Copy your MCP link
Open your deployed URL. Click Copy next to the MCP endpoint.
https://your-project.vercel.app/api/mcp8 · Connect to Claude
Settings → Connectors → Add custom connector → paste the URL → Add.
Claude connector docs · For ChatGPT, see OpenAI's MCP docs — untested here
9 · Test it
Paste into the chat:
Show me what's in stock right now, with prices.
Then check live availability for one of them.Then open /dashboard — every call appears with its reasoning.
What's built in
🔒 Discount ceiling | Enforced in code, not by the prompt |
💳 Spend mandates | Unattended purchases only within a customer-authorized cap |
📦 Live stock | Never cached, checked before every promise |
📝 Full audit trail | Every decision logged with plain-language reasoning |
🔌 Any API shape | Field names mapped via config, not code |
🤝 Negotiation | Optional, via Claude or Gemini |
Commands
npm run dev # local dev server
npm run build # production build
npm run test:regression # end-to-end suite against a live deployment
npm run check:template # verify no merchant values leaked into source
npm run typecheck # tsc --noEmitProject layout
app/
api/mcp/route.ts MCP endpoint
dashboard/ audit trail UI
page.tsx status page + copyable MCP link
lib/
config.ts all env vars, validated once
merchantApi.ts field mapping, envelopes, refusals
tools/ one file per tool
sellerAgent.ts negotiation
scripts/
regression.mjs end-to-end testsDocs
Configuration — every env var, the order API contract
Limitations — known gaps, read before deploying
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
AI shopping gateway for product search, inventory, carts, and merchant-hosted checkout.
The independent agent-commerce protocol for AI-agent checkout on any online store.
Agent-native security, trust, reliability, data and procurement tools for AI workflows.
Payment infrastructure for AI agents: spending rules, approval flows, single-use virtual cards.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI agents to autonomously browse inventory, negotiate terms, manage carts, and execute secure payments on Shopify stores using standardized protocols. It provides a bridge for LLMs to handle the entire commerce lifecycle from discovery to order tracking through a verifiable mandate chain.52MIT
- FlicenseNot gradedqualityBmaintenanceEnables AI agents to discover products, build carts, and complete purchases across multiple downstream commerce services through a secure, contract-driven API.-
- FlicenseNot gradedqualityBmaintenanceEnables AI agents to browse product catalogs and make purchases through a policy engine that enforces spending limits, requires human approval for certain amounts, and logs all actions to an audit trail.-
- AlicenseNot gradedqualityCmaintenanceEnables AI shopping agents to search products, check stock, apply promotions, manage cart sessions, and create cryptographically signed checkout sessions on e-commerce storefronts, while giving merchants analytics into agent intent and catalog demand gaps.MIT