Order MCP
Order MCP
一个由 Groq 驱动、使用 Model Context Protocol (MCP) 的订单助手的端到端小示例。
架构
Groq LLM -> MCP client -> MCP server -> REST order backendsrc/ai-client.ts将用户问题发送给 Groq,并充当 MCP 客户端。src/index.ts是 MCP 服务器,通过 stdio 暴露get_order_status工具。src/backend.ts是位于http://localhost:3000的示例 REST 订单后端。
Related MCP server: commerce-ops-mcp
工具发现与调用
连接到 MCP 服务器后,客户端调用 listTools() 来发现工具及其 JSON 模式。它将这些定义转换为 Groq 函数工具,并将其包含在聊天请求中。当 Groq 返回工具调用时,客户端将其名称和参数传递给 callTool()。MCP 服务器调用 REST 后端,客户端将工具结果发送回 Groq 以生成最终响应。
安装与运行
需要 Node.js 20 或更高版本。
npm install通过 GROQ_API_KEY 环境变量提供 Groq API 密钥。不要将密钥放在源代码中,也不要将其提交到 Git。
在一个终端中启动 REST 后端:
npm run backend然后在另一个终端中运行客户端。客户端会自动启动并连接到 MCP 服务器:
PowerShell:
$env:GROQ_API_KEY = "your-key"
npm run clientmacOS/Linux:
export GROQ_API_KEY="your-key"
npm run clientThis server cannot be deployed
Maintenance
Related MCP Connectors
Manage Shipday orders, drivers, driver earnings, reports from your AI assistants.
Read-only access to your Order41 wholesale data. Look up orders, carts, products, drops and contacts, with their custom tags, straight from Claude, ChatGPT or Cursor. Order41 is a B2B ordering platform for fashion and action-sports brands, their sales agencies and retail buyers. Sign in with your Order41 account; you only see what your role allows.
Search 16,000+ API operations and 95 built tools by need, then call any of them by name
Turn user requests and support messages into tasks and tell users what shipped, from any AI agent.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to verify orders in an ERP system through Supabase API, checking order existence and retrieving details.MIT
- AlicenseAqualityDmaintenanceEnables investigating delayed e-commerce orders by searching orders, retrieving order context, diagnosing delay causes, and recommending resolutions through natural language.4MIT
- FlicenseAqualityDmaintenanceProvides e-commerce customer support tools for order status, delivery, account, and policy questions, with RAG-grounded retrieval and strict authorization checks over mock data.6-
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to find stale unshipped orders, retrieve order details, and mark orders as shipped by wrapping the orders REST API as MCP tools.4MIT