Model Context Protocol (MCP) Server
The official Go-based Model Context Protocol (MCP) runtime for ecomm.lk. Enables AI models (ChatGPT, Claude Desktop, Cursor, and custom web chat UIs) to manage storefronts, adjust inventories, fulfill orders, and query financial analytics using natural language in Sinhala and English.
1. Multi-Transport Architecture
The Ecomm MCP Server is written in high-concurrency Go utilizing github.com/mark3labs/mcp-go, deployed across Google Cloud Run in the Asia-Southeast1 region. It supports three distinct transport channels for local and remote AI clients:
Compliant with the modern 2025/2026 MCP specification. Supports streaming POST requests required by Claude Remote Connectors and OpenAI GPT Custom Actions.
Persistent bidirectional event streaming. Real-time session state cached across SSE event streams and POST message dispatch.
Zero-latency UNIX stdio transport for local developer tools, the Claude Desktop application, and Cursor IDE agents.
2. OAuth 2.0 & Bearer Authentication
The server implements full automated discovery conforming to RFC 8414 and RFC 8707, allowing modern AI clients to discover authorization parameters and perform secure 1-click merchant authorization:
GET https://mcp.ecomm.lk/.well-known/oauth-authorization-server
GET https://mcp.ecomm.lk/.well-known/openid-configuration
GET https://mcp.ecomm.lk/.well-known/oauth-protected-resource
Authorization: https://store-dash.ecomm.lk/oauth/authorize
Token Exchange: https://store-api.ecomm.lk/api/oauth/token
Supported Scopes: "store:manage", "read:orders", "read:products", "write:products"
Alternatively, merchants can provide their personal Store API Key (Bearer Token) directly in client settings or as the HTTP header Authorization: Bearer <TOKEN>.
3. AI Quotas & Automated Metering
Every write operation executed by an MCP tool is verified against the store's active subscription tier and real-time wallet credits:
Trial allowance to test conversational stock updates and catalog queries.
250 operations included free each month; additional write operations debited at LKR 1.00 per operation from wallet.
Zero metered fees. Full autonomous stock synchronization, order processing, and customer SMS dispatch.
4. Complete MCP Tool Suite (26 Tools)
The server exposes 26 production tools covering every aspect of retail operations. All tools accept English and Sinhala natural language parameters:
Platform overview, URL rules, pricing plans, and system capabilities.
Verify active OAuth 2.0 or token connection and current store identity.
Active products count, monthly orders count, wallet balance, and plan limits.
Update storefront accent theme color (presets or hex codes like #6366f1).
Toggle Cash on Delivery (COD) or Direct Bank Transfer on or off in the storefront.
Search products by keyword, category, or status (ACTIVE, ARCHIVED).
Retrieve complete attributes, inventory, variant matrices, and images.
Add listing with title, price, stock, category, SKU, and sale prices.
Modify title, description, pricing, or status of an existing product.
Directly adjust inventory quantity for fast audits or restocks.
Permanently remove a product listing from the storefront catalog.
Download image from external URL, compress & upload to Cloudflare R2, and attach.
Retrieve full store category tree with infinite-depth parent/child nesting.
Create top-level category or nested subcategory under an existing parent.
Rename a category or re-parent under a new category branch.
Delete an empty category from the store taxonomy.
View latest orders filtered by status (PENDING, SHIPPED, DELIVERED, CANCELLED).
Line items, variant choices, customer phone, and shipping address.
Update fulfillment state (e.g. mark order as SHIPPED or DELIVERED).
Dispatch live SMS tracking messages directly to customer phones via Text.lk.
View active discount codes, usage counts, and expiration dates.
Create Percentage or Fixed LKR discount codes with usage limits.
Deactivate or permanently remove promotional coupons.
Identify items running out of inventory below a configurable threshold.
Rank store items by sales volume and total revenue generated.
Day-over-day financial telemetry (Today's revenue vs Yesterday's revenue).
5. Connecting AI Clients
Claude Desktop Configuration (claude_desktop_config.json)
{
"mcpServers": {
"ecomm-store": {
"command": "/path/to/mcp-server",
"args": ["-stdio"],
"env": {
"ECOMM_API_URL": "https://store-api.ecomm.lk",
"PORT": "8080"
}
}
}
}Remote Connectors / Web Chat (Streamable HTTP / SSE)
// Streamable HTTP (Modern 2025/2026 Spec) POST https://mcp.ecomm.lk/mcp Headers: Authorization: Bearer <MERCHANT_TOKEN> Content-Type: application/json // Server-Sent Events (SSE) GET https://mcp.ecomm.lk/sse?token=<MERCHANT_TOKEN> Accept: text/event-stream
Need technical assistance or custom tools?
Our engineering team regularly assists enterprises and third-party SaaS platforms integrating with the ecomm.lk Model Context Protocol server.