RazorMCP
Allows AI buyer agents to discover products and complete purchases by creating Razorpay Test Mode payment orders, with deterministic guardrails and an audit trail.
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., "@RazorMCPsearch for a keyboard under 5000 and process purchase with 6000 budget"
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.
MCP security listing: Indexed on the M8ven Trust Index
Why this project exists
Traditional online stores are designed for people: browse pages, compare products, add to cart, and check out. That breaks down when the buyer is an AI assistant, procurement bot, or autonomous shopping agent. These systems need a machine-readable catalog, a structured way to negotiate within a mandate, and a payment path that is safe by design.
Live Demo & Demo Mode Notice
🚀 Try the Live App: https://razormcp.streamlit.app/
The public live deployment runs with DEMO_MODE=true enabled by default. So it's a mock, I really don't want exhaust my keys.
Razorpay Agentic Seller Gateway
A machine-to-machine commerce gateway where AI buyer agents discover products, receive a structured margin-aware offer, pass deterministic guardrails, and create Razorpay Test Mode orders — without a human checkout flow.
Built for Razorpay Buildathon — Track 01: AI Growth & Agentic Commerce.
What it demonstrates
Agent-ready storefront: REST/OpenAPI and MCP tools expose catalog search and an atomic purchase workflow.
Autonomous seller reasoning: Groq-hosted, OpenAI-compatible LLM inference selects products, proposes bundles, and returns a typed
ProposedQuotethrough Instructor.Hard payment boundaries: Pydantic guardrails validate transaction caps, buyer budget, discount policy, SKU validity, and stock before Razorpay is called.
Traceable decisions: every purchase response includes an ordered audit trail from buyer intent to payment-order creation or rejection.
Demo-friendly UI: a Streamlit dashboard makes the end-to-end transaction flow easy to inspect live.
Related MCP server: deskkit-agentic-commerce
Architecture at a glance
flowchart LR
B[AI buyer agent] -->|REST / OpenAPI or MCP| A[FastAPI + FastMCP]
D[Streamlit dashboard] -->|REST| A
A --> S[SellerAgentService]
S --> C[CatalogService\nIn-memory products]
S --> L[Groq LLM + Instructor\nTyped ProposedQuote]
S --> G[SafetyGuardrailEngine]
G -->|approved| R[Razorpay Test Mode]
G -->|rejected| O[Structured result + audit trail]
R --> ORead the full component map, data flow, API contracts, and security notes in docs/ARCHITECTURE.md. For the Railway deployment runbook, see docs/HOSTING.md.
Quick start
Requirements: Python 3.10+ and credentials for Groq plus Razorpay Test Mode.
git clone <your-github-repository-url>
cd Backend
python -m venv .venv
source .venv/bin/activate # Windows PowerShell: .venv\Scripts\Activate.ps1
pip install -r requirements.txt
cp .env.example .envFill in .env with your own credentials. Do not commit it.
# Terminal 1 — API and MCP server
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
# Terminal 2 — optional transaction inspector
streamlit run app/dashboard.py --server.port 8501Service | URL |
Swagger / OpenAPI UI | |
ReDoc | |
OpenAPI JSON | |
Health check | |
MCP endpoint | |
Streamlit dashboard |
Configuration
Copy .env.example to .env and configure the following values.
Variable | Required | Purpose |
| Yes for successful orders | Razorpay Test Mode key ID |
| Yes for successful orders | Razorpay Test Mode secret |
| Yes for seller negotiation | API key for the OpenAI-compatible Groq endpoint |
| No | Model identifier; defaults to |
| No | Defaults to |
| No | Merchant discount ceiling; defaults to |
| No | Per-transaction merchant cap; defaults to |
| No | Runtime label returned by |
| Recommended in public deployments | Simulates successful checked-out orders locally; no Groq or Razorpay call |
| Recommended in production | Comma-separated trusted dashboard URLs, or |
The
.gitignoredeliberately excludes.env, virtual environments, private keys, logs, and Streamlit secrets. If a credential has ever been committed, revoke and rotate it; adding it to.gitignoredoes not remove it from Git history.
API surface
Method | Route / tool | Description |
|
| Liveness and active guardrail limits |
|
| Keyword catalog discovery |
|
| Intent → quote → guardrails → Razorpay order |
MCP |
| MCP-native catalog discovery |
MCP |
| MCP-native atomic purchase workflow |
MCP tool safety metadata
Both MCP tools declare all four standard MCP safety hints. search_catalog is
read-only, idempotent, and local to the server's in-memory catalog.
process_agentic_purchase may create a Razorpay Test Mode order, so clients
must treat it as state-changing, non-idempotent, and capable of contacting an
external service. MCP hosts can use these declarations to warn users before
invocation.
Example request:
curl -X POST http://localhost:8000/api/v1/agent/process-intent \
-H 'Content-Type: application/json' \
-d '{
"buyer_agent_id": "demo-buyer-01",
"query": "silent mechanical keyboard with a wrist rest",
"max_budget_inr": 5000
}'The response has a SUCCESS, GUARDRAIL_REJECTED, or ERROR status and always carries validation_details plus an audit_trail.
Validation and demos
python test_phase2.py # catalog and deterministic guardrails; no external call
python test_phase4.py # FastAPI contract; full success needs a configured LLM/payment path
python test_phase3.py # seller-agent flow; may create a Razorpay Test Mode order
python test_razorpay.py # creates a Razorpay Test Mode order
python test_mcp_tools.py # MCP tool names and mandatory safety metadataThe last two scripts can contact external services and create Test Mode payment orders. Use only with credentials you control.
Repository layout
app/
main.py FastAPI routes and FastMCP tool registration
config.py Typed environment configuration
dashboard.py Streamlit transaction inspector
core/ Guardrails and Razorpay adapter
services/ Catalog and seller orchestration
docs/
ARCHITECTURE.md Complete technical architecture
PHASE*_IMPLEMENTATION.md Build-phase notes
requirements.txt Runtime dependencies
.env.example Safe configuration templateGitHub checklist
git init # only if this folder is not already a Git repository
git add README.md .gitignore .env.example app docs requirements.txt test_*.py
git status # verify .env and virtual environments are absent
git commit -m "docs: prepare agentic seller gateway for GitHub"
git branch -M main
git remote add origin <your-github-repository-url>
git push -u origin mainBefore publishing, inspect git status --ignored and search staged files for any real key or order/customer data.
Project status and next steps
This is a prototype using an in-memory catalog and Razorpay Test Mode. A production evolution should add persistent inventory/orders, quote expiry, authenticated agent identity and spend mandates, webhook verification and fulfillment, rate limits, restricted CORS, and durable audit storage.
Made for a future where commerce APIs serve agents as naturally as they serve people.
This server cannot be deployed
Maintenance
Related MCP Connectors
Autonomous commerce for AI agents: discover, quote, order, pay, verify.
AI shopping gateway for product search, inventory, carts, and merchant-hosted checkout.
Multi-seller shopping for AI agents. Settle via Stripe MPP or x402 USDC on Base. Hosted.
Multi-seller shopping for AI agents. Settle via Stripe MPP or x402 USDC on Base. Hosted.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to discover, check stock, and purchase products through your existing store APIs, with spend mandates, discount ceilings, and a full audit trail enforced in code.28,107 npmMIT
- FlicenseNot gradedqualityCmaintenanceEnables AI agents to browse a merchant catalog and place Razorpay test-mode orders with budget gating, persistent monthly limits, and full audit trails.-
- AlicenseNot gradedqualityBmaintenanceEnables autonomous AI agents to discover products, compute tax-accurate quotes, and complete payments through Razorpay with deterministic budget, quantity, and idempotency guardrails.10 npm1MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to search a merchant's product catalog and complete UPI checkouts via Razorpay test-mode APIs, with spend mandates and full audit logging.MIT