Ecomm Logo
Official Protocol Specification

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.

Protocol Version: MCP Spec 2025/2026•Server: ecomm-store-manager v1.0.0•Host: https://mcp.ecomm.lk

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:

Streamable HTTP
/mcp

Compliant with the modern 2025/2026 MCP specification. Supports streaming POST requests required by Claude Remote Connectors and OpenAI GPT Custom Actions.

Server-Sent Events (SSE)
/sse & /message

Persistent bidirectional event streaming. Real-time session state cached across SSE event streams and POST message dispatch.

Standard I/O (Stdio)
-stdio flag

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:

// Discovery Endpoints
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 & Token Grant Endpoints
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:

FREE Plan
10 Free Operations

Trial allowance to test conversational stock updates and catalog queries.

BASIC Plan (LKR 2,999)
250 Free Ops / mo

250 operations included free each month; additional write operations debited at LKR 1.00 per operation from wallet.

PRO Plan (LKR 9,999)Unlimited
Unlimited Operations (∞)

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:

Store Management & Configuration
get_platform_info

Platform overview, URL rules, pricing plans, and system capabilities.

check_connection_status

Verify active OAuth 2.0 or token connection and current store identity.

get_store_metrics

Active products count, monthly orders count, wallet balance, and plan limits.

update_theme_color

Update storefront accent theme color (presets or hex codes like #6366f1).

toggle_payment_method

Toggle Cash on Delivery (COD) or Direct Bank Transfer on or off in the storefront.

Product Catalog & Media Management
list_products

Search products by keyword, category, or status (ACTIVE, ARCHIVED).

get_product_details

Retrieve complete attributes, inventory, variant matrices, and images.

create_product

Add listing with title, price, stock, category, SKU, and sale prices.

update_product

Modify title, description, pricing, or status of an existing product.

update_inventory

Directly adjust inventory quantity for fast audits or restocks.

delete_product

Permanently remove a product listing from the storefront catalog.

attach_product_image_from_url

Download image from external URL, compress & upload to Cloudflare R2, and attach.

Hierarchical Categories & Subcategories
list_categories

Retrieve full store category tree with infinite-depth parent/child nesting.

create_category

Create top-level category or nested subcategory under an existing parent.

update_category

Rename a category or re-parent under a new category branch.

delete_category

Delete an empty category from the store taxonomy.

Orders & Customer SMS Notifications
list_orders

View latest orders filtered by status (PENDING, SHIPPED, DELIVERED, CANCELLED).

get_order_details

Line items, variant choices, customer phone, and shipping address.

update_order_status

Update fulfillment state (e.g. mark order as SHIPPED or DELIVERED).

send_customer_sms

Dispatch live SMS tracking messages directly to customer phones via Text.lk.

Coupons, Marketing & Financial Analytics
list_coupons

View active discount codes, usage counts, and expiration dates.

create_coupon

Create Percentage or Fixed LKR discount codes with usage limits.

delete_coupon

Deactivate or permanently remove promotional coupons.

get_low_stock_alerts

Identify items running out of inventory below a configurable threshold.

get_top_selling_products

Rank store items by sales volume and total revenue generated.

get_sales_summary

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.