Skip to main content
Glama

Order MCP

一个由 Groq 驱动、使用 Model Context Protocol (MCP) 的订单助手的端到端小示例。

架构

Groq LLM -> MCP client -> MCP server -> REST order backend
  • src/ai-client.ts 将用户问题发送给 Groq,并充当 MCP 客户端。

  • src/index.ts 是 MCP 服务器,通过 stdio 暴露 get_order_status 工具。

  • src/backend.ts 是位于 http://localhost:3000 的示例 REST 订单后端。

Related MCP server: woocommerce-mcp-server

工具发现与调用

连接到 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 client

macOS/Linux:

export GROQ_API_KEY="your-key"
npm run client

Maintenance

ActivityMaintained
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    D
    quality
    D
    maintenance
    Provides tools for AI assistants to interact with a WooCommerce store, enabling fetching recent orders with optional filtering and retrieving detailed information about specific orders by ID.
    2
    4
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    Enables investigating delayed e-commerce orders by searching orders, retrieving order context, diagnosing delay causes, and recommending resolutions through natural language.
    4
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Shreerang4/order-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server