Order MCP
Order MCP
Ein kleines End-to-End-Beispiel für einen Groq-gestützten Bestellassistenten, der das Model Context Protocol (MCP) verwendet.
Architektur
Groq LLM -> MCP client -> MCP server -> REST order backendsrc/ai-client.tssendet die Benutzerfrage an Groq und fungiert als MCP-Client.src/index.tsist der MCP-Server und stellt dasget_order_status-Tool über stdio bereit.src/backend.tsist ein Beispiel-REST-Backend für Bestellungen unterhttp://localhost:3000.
Related MCP server: commerce-ops-mcp
Tool-Erkennung und -Aufruf
Nach der Verbindung mit dem MCP-Server ruft der Client listTools() auf, um die Tools und ihre JSON-Schemas zu ermitteln. Er wandelt diese Definitionen in Groq-Funktionstools um und nimmt sie in die Chat-Anfrage auf. Wenn Groq einen Tool-Aufruf zurückgibt, übergibt der Client dessen Namen und Argumente an callTool(). Der MCP-Server ruft das REST-Backend auf, und der Client sendet das Tool-Ergebnis für die endgültige Antwort an Groq zurück.
Installation und Ausführung
Erfordert Node.js 20 oder höher.
npm installGeben Sie einen Groq-API-Schlüssel über die Umgebungsvariable GROQ_API_KEY an. Fügen Sie den Schlüssel nicht in den Quellcode ein und committen Sie ihn nicht in Git.
Starten Sie das REST-Backend in einem Terminal:
npm run backendFühren Sie dann den Client in einem anderen Terminal aus. Der Client startet und verbindet sich automatisch mit dem MCP-Server:
PowerShell:
$env:GROQ_API_KEY = "your-key"
npm run clientmacOS/Linux:
export GROQ_API_KEY="your-key"
npm run clientRelated 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
31Turn 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
- FlicenseAqualityCmaintenanceProvides 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