Skip to main content
Glama
smart-retail-mcp

smart-retail-mcp

🤖 Smart Retail MCP Server

基于 Model Context Protocol (MCP) 的工具服务器,为 AI 代理提供库存预测分析能力。

可用工具

工具

描述

get_current_stock

获取所有产品的当前库存以及供应商的交货时间

get_sales_velocity

计算过去 N 天内每个产品的日均销售速度

create_ai_recommendation

当库存将在下次交货前耗尽时创建补货警报

Related MCP server: vanam-erp-mcp

架构

src/
├── index.ts   → Definición e implementación de herramientas MCP (stdio transport)
├── db.ts      → Pool de conexión a PostgreSQL
└── seed.ts    → Script para insertar datos de prueba

配置

环境变量 (.env)

DATABASE_URL=postgresql://usuario:password@localhost:5432/smart_retail

脚本

npm start      # Ejecutar el servidor MCP
npm run dev    # Desarrollo con hot-reload (tsx watch)
npm run seed   # Insertar datos de prueba
npm run build  # Compilar TypeScript

依赖

  • @modelcontextprotocol/sdk — MCP 官方 SDK

  • pg — PostgreSQL 客户端

  • dotenv — 环境变量

通信

服务器通过 stdio(stdin/stdout)进行通信。Next.js 前端使用 MCP SDK 的 StdioClientTransport 将其作为子进程启动。它不暴露 HTTP 端口。

许可证

ISC

Available Tools

3 tools
create_ai_recommendationA

Crea una alerta de reabastecimiento en la base de datos cuando detectas que el stock se agotará antes de que el proveedor pueda entregar.

Inputs: reason (required), product_id (required), recommended_order_qty (required).

get_current_stockA

Obtiene los niveles actuales de inventario de todos los productos y los tiempos de entrega del proveedor.

Inputs: no named parameters.

get_sales_velocityA

Calcula el promedio de ventas diarias de los productos en los últimos X días. Útil para predecir cuándo se agotará el stock.

Inputs: days (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 3 tools

    Disambiguation5/5

    Each tool targets a distinct inventory concern: current stock and lead times, sales velocity, and creating restock alerts. There is no meaningful overlap, so an agent can select the correct tool without ambiguity.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern: get_current_stock, get_sales_velocity, create_ai_recommendation. The naming is predictable and clear.

    Tool Count4/5

    Three tools is at the low end, but each tool has a clear role in the inventory-alerting workflow. The count feels appropriate for a narrow purpose, though the broad server name could imply more coverage.

    Completeness2/5

    The set covers the input side well, but create_ai_recommendation is a create-only operation with no way to list, update, or delete existing recommendations. This leaves agents with a dead end for managing alert state.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      A
      quality
      D
      maintenance
      MCP server for querying inventory items and stock levels via internal API, enabling AI chatbots to look up product codes and current quantities.
      2
      -
    • F
      license
      Not graded
      quality
      C
      maintenance
      Enterprise-grade MCP server for intelligent supply chain analytics, enabling managers to investigate forecast accuracy, vendor performance, demand trends, and root causes using natural language.
      -