commerce-ops-mcp

commerce-ops-mcp

Enables investigating delayed e-commerce orders by searching orders, retrieving order context, diagnosing delay causes, and recommending resolutions through natural language.

Category
访问服务器

README

Commerce Operations MCP

Status: domain/data foundation plus a working MCP server exposing four read-only investigation tools, served over both local stdio and remote Streamable HTTP (hosted on Render). No write/action tool yet — see "Current limitations".

Hosted MCP URL: https://e-commerce-mcp.onrender.com/mcp (Streamable HTTP, stateless — see "Connecting to the hosted server" below)

Working name: commerce-ops-mcp (may change before final delivery).

An AI-native commerce operations investigator focused on delayed-order investigation, exposed through a remotely hosted MCP server.

Problem

An operations specialist needs to answer, for a given order: "why is this order delayed, and what should I do about it?" Answering that well often requires checking payment status, inventory availability, and fulfillment state — but the product is that one investigation workflow, not standalone tooling for payments, inventory, or fulfillment.

Confirmed scope (client-clarified): a single, focused end-to-end workflow — delayed-order investigation — is the right level of scope. Separate coverage of all four commerce domains (orders, payments, inventory, fulfillment) as independent workflows is explicitly out of scope. The project intentionally does not provide independent workflows for payments, inventory, fulfillment, or general order management; those systems are consulted only as supporting evidence when investigating a delayed order.

Current scope

This repository implements the backend foundation plus a working MCP server on top of it:

  • Domain types and status enums
  • A synthetic, internally consistent commerce dataset (static TypeScript modules)
  • A repository layer over that dataset
  • An OrderContextService that composes operational facts (not diagnoses) for a given order
  • A DelayDiagnosisService that applies deterministic rules to those facts to identify the likely delay cause
  • A ResolutionService that maps a diagnosis to recommended next actions
  • An MCP server exposing search_orders, get_order_context, diagnose_order_delay, and recommend_resolution as tools, over two transports sharing the same tool registration (src/mcp/create-server.ts):
    • src/mcp/server.ts — stdio, for local MCP clients (Claude Desktop/Code, MCP Inspector)
    • src/mcp/http.ts — Streamable HTTP (stateless), deployed remotely on Render for AI agents to connect to without any local setup
  • Tests covering all of the above

No write/action tool (create_resolution_ticket), LLM/agent integration, database, or frontend exists yet. See CLAUDE.md for the explicit scope boundary and docs/assumptions.md / docs/decisions.md for what's decided vs. pending.

Architecture

Synthetic data (src/data/*.ts — static, typed TypeScript modules)
        ↓
Repositories (src/repositories/*.repository.ts)
        ↓
Domain services (order-context.service.ts, delay-diagnosis.service.ts,
                  resolution.service.ts)
        ↓
src/mcp/create-server.ts — search_orders, get_order_context,
                            diagnose_order_delay, recommend_resolution
        ↓                              ↓
src/mcp/server.ts (stdio)   src/mcp/http.ts (Streamable HTTP → Render)

Repositories hide the underlying data representation; services and the MCP tools depend only on repository method signatures, not on how the data is stored. See docs/decisions.md for why static TypeScript modules were chosen over PostgreSQL, why the MCP tool set stops at four read-only tools for now, and why the remote transport runs in stateless mode.

Connecting to the hosted server

No local setup is required to try the deployed workflow — point any MCP client that supports Streamable HTTP at:

https://e-commerce-mcp.onrender.com/mcp

For example, with the MCP Inspector:

npx @modelcontextprotocol/inspector
# then connect with transport "Streamable HTTP" and the URL above

The server is stateless and unauthenticated (read-only synthetic data only — see docs/decisions.md for that tradeoff, stated explicitly rather than left implicit). The /mcp endpoint is rate-limited to 60 requests per IP per minute (in-memory, per-instance — see docs/decisions.md) as a basic abuse guard given the lack of authentication.

Running locally

npm install
npm run typecheck
npm test

# stdio transport (for Claude Desktop/Code, MCP Inspector over stdio)
npm run build
npm start

# Streamable HTTP transport (what's deployed to Render)
npm run build
npm run start:http   # listens on $PORT, defaults to 3000

Point any MCP client (e.g. npx @modelcontextprotocol/inspector node dist/server.js, or Claude Desktop/Code's MCP config) at npm start (from this directory) to connect over stdio.

Testing

Tests use Vitest and live in tests/, mirroring src/:

  • tests/repositories/ — finder methods, including missing-record cases
  • tests/services/ — OrderContextService (context composition, including the ORD-1003 inventory-shortage case), DelayDiagnosisService (all seven scenario orders map to their expected category), and ResolutionService
  • tests/data/ — cross-record invariant checks (foreign keys, order totals, one-record-per-order cardinality, required scenario orders) run against the real dataset and against deliberately broken copies of it — checks TypeScript's structural typing can't express on its own

Synthetic data

src/data/ contains 18 products, 15 customers, 50 orders, and their corresponding payments/inventory/fulfillment records — all synthetic, INR-priced, .test-domain emails, MockPay as the fake payment provider. Each entity is a static, typed TypeScript module (e.g. src/data/orders.ts) rather than a JSON file; the dataset was generated once and is now finalized and hand-editable in place — see docs/decisions.md.

Seven orders (ORD-1001–ORD-1007) are deterministic, hand-crafted scenarios representing known operational situations (payment failure, inventory shortage, fulfillment delay, etc.) — see docs/test-scenarios.md for the full table.

Current limitations

  • No write/action tool (create_resolution_ticket) — read-only investigation, diagnosis, and recommendation only.
  • No persistence beyond static TypeScript modules; no database.
  • No authentication/authorization on the hosted HTTP endpoint — deliberate and disclosed, not an oversight; see docs/decisions.md. Acceptable here because the tool set is read-only and the data is synthetic; would need revisiting before any real data touched this server. Mitigated in part by a per-IP rate limit (60 req/min, in-memory) on /mcp, but that limits abuse per-instance only, not a substitute for real auth.
  • No real external integrations of any kind.

Future stages

Not yet built, and out of scope for this submission: one controlled, confirmation-gated write action (create_resolution_ticket), and authentication on the hosted endpoint if this ever handled real data. See CLAUDE.md and docs/decisions.md / docs/assumptions.md for what's confirmed vs. still open.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选