razoragent
Integrates with Razorpay APIs to create guarded orders and cryptographically verify payments, enabling autonomous AI agents to complete transactions and settlement through Razorpay.
Click on "Install 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., "@razoragentSearch for a wireless keyboard under 2000 and calculate a tax-accurate quote."
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.
โก RazorAgent by Resence
Bounded Model Context Protocol (MCP) Commerce & Settlement Gateway for Autonomous AI Buyers
Engineered by: Resence ยท Piyush Singh
Package Version:v1.1.5(Zero-Dependency Node.js SDK & Standalone CLI)
Live Production Gateway: https://razoragent.resence.in
NPM Package Registry: https://www.npmjs.com/package/razoragent
MCP JSON-RPC Endpoint:https://razoragent.resence.in/api/razoragent/mcp
Install Command:npm install razoragent
๐ฆ 1. What is RazorAgent?
RazorAgent is an open-source TypeScript SDK and CLI that turns a merchant's existing e-commerce backend (Shopify, WooCommerce, or a custom catalog) into a Model Context Protocol (MCP) server with pre-settlement guardrails and Razorpay order creation.
Developers install razoragent, configure their store credentials and Razorpay API keys in environment variables, and run it as an isolated service on their own infrastructure. Autonomous buying agents (such as Claude Desktop, OpenAI Operator, or custom agent frameworks) can then query the catalog, calculate tax-inclusive quotes, and create verified Razorpay orders over standard JSON-RPC 2.0.
The web interface at razoragent.resence.in and the CLI (npx razoragent) are reference deployments demonstrating the complete search, quoting, guardrail evaluation, and settlement pipeline against live APIs.
Related MCP server: Allowance MCP
๐ฏ 2. What RazorAgent Solves
Traditional e-commerce is built for human eyes and fingersโvisual layouts, CSS styling, clickable DOM buttons, and human-in-the-loop OTP checkouts.
By 2026, commerce is transitioning to Autonomous AI Agents (OpenAI Operator, Claude Computer Use, Gemini Agentic Workflows, NPCI Unified Agent Protocol) researching and purchasing on behalf of consumers and enterprises.
However, letting AI agents interact directly with legacy checkout endpoints creates 4 critical failure modes:
Financial Hallucinations: LLMs generating fabricated price amounts or ordering invalid product variants.
Double-Billing from Network Jitter: AI agents retrying timed-out requests and triggering duplicate payment orders.
Unbounded Spending: No mathematical guarantee that an agent won't exceed user budgets or liquidate inventory.
Lack of Standardized Tooling: Fragile web scraping instead of structured tool interfaces.
RazorAgent bridges this gap. It turns any merchant store (Shopify, WooCommerce, or custom databases) into a standardized Model Context Protocol (MCP) server, enabling AI shopping agents to discover products, compute tax-accurate quotes, and complete transactions through Razorpay APIsโbacked by deterministic mathematical guardrails and SHA-256 cryptographic idempotency locks.
๐๏ธ 3. System Architecture & Universal MCP Availability
RazorAgent is an open, universally accessible gateway. Any AI agent (Claude Desktop, OpenAI Operator, Gemini CLI, Cursor, or custom Python agent) connects via standard JSON-RPC 2.0:
flowchart TD
subgraph Client["๐ค Universal AI Buyer Clients"]
Agent1["Claude Desktop / Anthropic SDK"]
Agent2["OpenAI Operator / Function Calling"]
Agent3["Gemini 2.0 / NPCI UAP Protocol"]
end
subgraph Gateway["๐ก๏ธ RazorAgent MCP & Policy Gateway (Next.js Edge)"]
Agent1 & Agent2 & Agent3 -->|"JSON-RPC 2.0 (/api/razoragent/mcp)"| MCP["MCP Tool Dispatcher"]
MCP --> CatalogAdapter["Pluggable Catalog Adapter Layer\n(CatalogProvider Interface)"]
CatalogAdapter --> Prov1["DemoCatalogProvider\n(32+ In-Memory SKUs)"]
CatalogAdapter --> Prov2["ShopifyCatalogProvider\n(Storefront GraphQL API)"]
CatalogAdapter --> Prov3["WooCommerceCatalogProvider\n(REST API v3)"]
MCP --> Quoting["Tax & Promotion Engine\n(18% GST + Coupons)"]
Quoting --> Guardrails{"Deterministic\nPolicy Engine"}
Guardrails -->|"Budget / Qty / Category Check"| PolicyPassed["Policy Evaluated"]
PolicyPassed -->|"Pass"| Idempotency["SHA-256 Idempotency Lock\n(Anti-Race Condition)"]
PolicyPassed -->|"Fail"| Reject["Structured Error Response\n(BUDGET_EXCEEDED / QTY_LIMIT)"]
end
subgraph Settlement["๐ณ Razorpay Fintech Settlement"]
Idempotency -->|"Deterministic Order Payload"| RzpAPI["Razorpay Orders API\n(Dual-Mode: Sandbox / Live)"]
RzpAPI --> Order["Order ID (order_xxx)\n+ Standard Checkout Overlay"]
Order --> Webhook["HMAC-SHA256\nWebhook Signature Verifier"]
end
subgraph Console["๐ Merchant Mission Control Dashboard"]
RzpAPI --> Analytics["GMV Uplift & Analytics\n(Human vs. Agentic Split)"]
Idempotency --> AuditTrail["Live Fintech Webhook Stream"]
CatalogAdapter --> StockManager["Real-Time Inventory & Price Controls"]
end๐ ๏ธ 4. Standardized MCP Commerce Tools
RazorAgent exposes 6 standard Model Context Protocol tools via JSON-RPC 2.0 (/api/razoragent/mcp):
Tool Name | Parameters | Purpose |
|
| Category-aware product search and filtering across merchant inventory. |
|
| Full technical specs, live inventory, and eligible coupon codes. |
|
| Computes subtotal, coupon discount, 18% GST tax, and shipping. |
|
| Deterministically validates compliance against merchant guardrails. |
|
| Creates verified Razorpay Order with SHA-256 race-condition locking. |
|
| Cryptographic HMAC-SHA256 verification of payment completion. |
โก 5. High-Availability Engineering: The Concurrency Challenge
The Problem: The LLM Non-Deterministic Retry Race Condition
During stress testing with concurrent autonomous shopping agents, simulated network jitter (1.5-second latency on order creation) triggered a critical issue:
The AI Buyer Agent assumed the request had timed out, hallucinatively mutated its nonce, and fired a concurrent retry of create_guarded_order. Because standard payment deduplication relied on client-supplied tokens, both requests reached the order creation pipeline 20 milliseconds apart, generating duplicate orders for a single cart.
The Engineering Solution:
Canonical SHA-256 Fingerprinting: An immutable payload fingerprint:
Hash = SHA256(agent_id + canonical_sorted_cart_items + total_amount + time_window)Two-Phase Concurrency Latch: In-memory promise locking with atomic state transitions:
INITIATED โโโโบ LOCKED โโโโบ ORDER_CREATED โโโโบ CAPTUREDAny concurrent thread hitting the gateway while an order is in-flight is held on the same promise and receives the cached order_xxx ID without firing duplicate Razorpay API calls.
Structured Semantic Interception Feedback: Rather than returning a generic HTTP 409 conflict, the gateway returns
IDEMPOTENCY_RETRY_SUPPRESSEDwith the active order receipt, allowing the agent to proceed to payment confirmation seamlessly.
(You can verify this automatically via npx razoragent test or the "Run Tests" button in the dashboard navbar!)
๐ 6. Connecting Your Real Store (Shopify / WooCommerce / Custom)
RazorAgent uses a pluggable CatalogProvider contract. It ships with:
DemoCatalogProvider: Zero-configuration reference catalog with 32+ products across 7 categories.ShopifyCatalogProvider: Real production GraphQL adapter for Shopify Storefront API (/api/2024-01/graphql.json).WooCommerceCatalogProvider: Real REST adapter for WooCommerce (/wp-json/wc/v3/products).
CLI Store Onboarding Wizard
Connect your real merchant store in seconds via the interactive CLI wizard:
npx razoragent connectThe wizard guides you through selecting your platform (Shopify or WooCommerce), entering your storefront access credentials, performing an automated live SKU discovery verification, and saving your configuration into .env.local.
Check your active catalog source and status anytime:
npx razoragent statusWeb Dashboard Onboarding
Visit the live onboarding portal at https://razoragent.resence.in/connect or click "Connect Store" in the top navigation bar to link your Shopify or WooCommerce store with instant live product previews.
Writing a Custom Merchant Adapter (~15 lines)
Any custom database, ERP, or headless backend can plug into RazorAgent by implementing the 3-method CatalogProvider contract:
import { CatalogProvider, CatalogSearchFilters, ProductItem, MCPEngine } from 'razoragent';
export class CustomPostgresCatalogProvider implements CatalogProvider {
async searchProducts(query: string, filters?: CatalogSearchFilters): Promise<ProductItem[]> {
// 1. Query your database with query & filters
const rows = await db.query('SELECT * FROM products WHERE name ILIKE $1', [`%${query}%`]);
return rows.map((r) => ({
id: r.sku,
name: r.title,
category: r.category,
price: r.price_inr,
rating: 4.8,
reviewCount: 120,
stock: r.stock_quantity,
description: r.description,
specs: { brand: r.brand },
tags: r.tags,
image: r.image_url,
}));
}
async getProductDetails(productId: string): Promise<ProductItem | null> {
const r = await db.queryOne('SELECT * FROM products WHERE sku = $1', [productId]);
return r ? { id: r.sku, name: r.title, category: r.category, price: r.price_inr, rating: 4.8, reviewCount: 120, stock: r.stock_quantity, description: r.description, specs: {}, tags: [], image: r.image_url } : null;
}
getProviderName(): string {
return 'Custom Postgres Enterprise Catalog';
}
}
// Register with RazorAgent MCP Engine
const engine = new MCPEngine(new CustomPostgresCatalogProvider());๐ 7. Quick Start & Command Reference
Option A: Try Instantly with Demo Data (Zero Config)
# Simulate an autonomous AI agent purchasing running shoes within โน2,000 spend cap
npx razoragent run --intent "Buy running shoes under 2000"Option B: Connect Your Real Merchant Store
# 1. Run the interactive merchant onboarding wizard
npx razoragent connect
# 2. Check active catalog status
npx razoragent status
# 3. Simulate an AI buyer purchasing from your live catalog
npx razoragent run --intent "Find mechanical keyboard with coupon AGENT500"CLI Command Reference
Command | Purpose |
| Interactive merchant wizard to connect real Shopify or WooCommerce storefronts. |
| Displays active catalog provider ( |
| Simulates an autonomous AI buyer executing product discovery, quoting, and Razorpay order creation. |
| Runs the automated 6/6 fintech verification suite (100% assertion rate). |
| Lists all 6 standardized Model Context Protocol (MCP) commerce tools. |
| Dumps current merchant SKUs, inventory counts, and price lists. |
๐งช 8. Automated Verification Suite (6/6 Passing)
RazorAgent includes automated system verification suites accessible via npm run test:razoragent or the "Run Tests" button on the web UI:
Running RazorAgent Automated Test Suite...
Summary: 6/6 passed (100% Assertion Rate)
[PASSED] TEST_01_HAPPY_PATH: Happy Path Autonomous Agent Checkout (93ms)
[PASSED] TEST_02_BUDGET_GUARDRAIL: Deterministic Budget Cap Enforcement (2ms)
[PASSED] TEST_03_QUANTITY_GUARDRAIL: SKU Hoarding & Quantity Bounds Enforcement (1ms)
[PASSED] TEST_04_2AM_RACE_CONDITION: Concurrency & Duplicate Retry Suppression (0ms)
[PASSED] TEST_05_HMAC_WEBHOOK_VERIFY: HMAC-SHA256 Cryptographic Webhook & Settlement Verifier (1ms)
[PASSED] TEST_06_PLUGGABLE_CATALOG: Pluggable CatalogProvider Contract & Resolution (1ms)๐ฌ 9. Next.js / Express Gateway Deployment
// Example: Exposing RazorAgent MCP tools on any Next.js / Express merchant backend
import { handleMCPRequest } from 'razoragent';
export async function POST(req: Request) {
const jsonRpcBody = await req.json();
const response = await handleMCPRequest(jsonRpcBody, {
maxSpendLimitINR: 5000,
allowedCategories: ['electronics', 'apparel', 'specialty-coffee'],
maxQuantityPerItem: 3
});
return Response.json(response);
}๐บ๏ธ 10. Scope and Roadmap
v1.x is scoped as an isolated gateway for a single merchant's catalog and Razorpay account.
The following capabilities are out of scope for the current release and planned for future iterations:
Multi-tenant deployments hosting multiple merchant catalogs on a single instance
Cross-merchant product discovery, federated search, and catalog aggregation
Web dashboard user authentication and role-based access control (configuration in v1.x is managed through environment variables)
๐ License
MIT License ยฉ 2026 Resence. Open source.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Payment infrastructure for AI agents: spending rules, approval flows, single-use virtual cards.
India payments for AI agents โ UPI, cards, wallets via Razorpay Payment Links. Never holds funds.
Agentic commerce gateway: discovery, search, checkout across Shopify/Woo/Odoo/PrestaShop.
Multi-seller shopping for AI agents. Settle via Stripe MPP or x402 USDC on Base. Hosted.
Related MCP Servers
- AlicenseBqualityFmaintenanceConnects AI agents to payment processors (Lithic, Stripe, PayPal) for automated shopping with single-use virtual cards and transaction management.921Apache 2.0

Allowance MCPofficial
FlicenseNot gradedqualityBmaintenanceEnables AI agents to request purchase approval from humans, receive scoped virtual cards, complete checkout, and report receipts for audit.- 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 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.43,227MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/Piyush-Thakur7/razoragent'
If you have feedback or need assistance with the MCP directory API, please join our Discord server