AI-Powered E-Commerce Platform for Agent-Driven Purchases
A production-ready Model Context Protocol (MCP) server that enables AI agents to autonomously:
create_checkout tool enables agents to create Stripe Checkout Sessions with embedded checkout, automatic tax calculation, real-time shipping rates, and multiple payment methods (Card, Link, Cash App, Afterpay).
Search, cart, discounts, checkout, orders, reviews, analytics — all ready to integrate with AI agents.
Embedded checkout with automatic tax (HST/GST/PST), real-time shipping, and multiple payment methods.
JWT authentication, role-based access, PII redaction, rate limiting, input validation.
Postal code validation, provincial tax calculation, E.164 phone format, CAD pricing.
All prices in cents (no floats) — prevents rounding errors and ensures accuracy.
Stripe webhook signature verification, idempotent requests, safe retries.
cd /Users/yuniorrodriguezosorio/Documents/GitHub/origna_gta/mcp-server
npm install
npm run buildcurl -X POST https://api.dev.orignagta.ca/auth/login \
-H "Content-Type: application/json" \
-d '{
"email": "e2e-admin@test.origna.ca",
"password": "TestPass123!"
}'export ORIGNABASE_URL="https://api.dev.orignagta.ca"
export ORIGNABASE_JWT_TOKEN="eyJhbGc..."npm startAdd to ~/.claude_desktop_config.json:
{
"mcpServers": {
"orignagta": {
"command": "node",
"args": ["/path/to/mcp-server/dist/index.js"],
"env": {
"ORIGNABASE_URL": "https://api.dev.orignagta.ca",
"ORIGNABASE_JWT_TOKEN": "your-token-here"
}
}
}
}Restart Claude Desktop and the server is ready!
Full-text search with category, price, and sorting filters
BrowseDetailed product info, images, reviews, stock levels
BrowseReal-time stock status for inventory-aware agents
BrowseAdd items to cart with quantity validation
CartRemove items from cart
CartRetrieve current cart with totals and tax estimates
CartApply discount codes with validation
DiscountCreate Stripe Checkout Session with embedded checkout, automatic tax, shipping rates, and multiple payment methods. Returns checkout URL for payment.
CheckoutView order history with filtering
OrdersOrder details with items, totals, tracking
OrdersInitiate returns/refunds workflow
OrdersSubmit 1-5 star product reviews
ReviewSales data, top products, revenue by period (admin role required)
Analytics1. search_products(
query="laptop",
max_price=200000
)
→ Returns 5 products matching criteria
2. get_product(id="products:xyz789")
→ Reviews price=$1299, stock=25 units
3. add_to_cart(
product_id="products:xyz789",
quantity=1
)
→ Cart subtotal=$1299, tax=$169, total=$1468
4. apply_coupon(code="WELCOME20")
→ Discount=$260, new total=$1208
5. create_checkout(
shipping_address={
street: "123 Yonge St",
city: "Toronto",
province: "ON",
postalCode: "M4Y 1Z5",
country: "CA",
phone: "+14165551234"
},
coupon: "WELCOME20"
)
→ Returns Stripe Checkout Session URL
6. Agent presents checkout URL to user
User completes payment on Stripe
7. Stripe webhook confirms → Order created in OrignaBase
8. Agent calls list_orders(status="confirmed")
→ Verifies order was created successfullyResult: Order placed, payment processed, tracking email sent! ✓
All requests require a valid JWT token issued by OrignaBase.
curl -X POST https://api.dev.orignagta.ca/auth/login \
-H "Content-Type: application/json" \
-d '{"email":"user@example.com","password":"password123"}'
Response:
{
"token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
"userId": "users:abc123",
"role": "buyer"
}Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...| Role | Capabilities |
|---|---|
| buyer | Search, cart, checkout, order history, reviews |
| seller | Manage products, view sales, analytics for own products |
| admin | All operations, platform-wide analytics |
| Role | Password | |
|---|---|---|
| Admin | e2e-admin@test.origna.ca | TestPass123! |
| Seller | e2e-seller@test.origna.ca | TestPass123! |
| Buyer | e2e-buyer@test.origna.ca | TestPass123! |
All monetary values are integer cents (no floats):
2999 cents = $29.99 CAD
129900 cents = $1,299.00 CAD
Display: (cents / 100).toFixed(2) = "$29.99"Format: [A-Z]\d[A-Z] \d[A-Z]\d
Valid: M5V 3A8, V6B 4Z1, T2P 1M1
Invalid: m5v 3a8 (must be uppercase)
Invalid: M5V3A8 (missing space)Format: +1XXXXXXXXXX
Valid: +14165551234
Invalid: 416-555-1234 (wrong format)
Invalid: 14165551234 (missing +1)SurrealDB format: collection:record_id
products:abc123xyz
users:buyer456def
orders:order789ghiUnix timestamps (seconds since epoch):
1710763200 = March 18, 2026, 14:00:00 UTC| Environment | API URL | Web URL | Use |
|---|---|---|---|
| Development | https://api.dev.orignagta.ca | https://dev.orignagta.ca | Testing, integration |
| Staging | https://api.staging.orignagta.ca | https://staging.orignagta.ca | Pre-production validation |
| Production | https://api.orignagta.ca | https://orignagta.ca | Live marketplace |
Machine-readable documentation in llms.txt standard format for AI agents to discover and use the MCP server.
View llms.txtJSON manifest at /.well-known/mcp.json with server metadata, tools, and integration instructions.
View ManifestComplete tool schemas, examples, error codes, rate limits, and best practices.
View API DocsSystem design, data flows, security model, and deployment architecture.
View Architecture5-minute setup guide with installation, configuration, and first agent test.
Get Started