Stock MCP
Integrates with WeChat to monitor group messages, parse Excel attachments from suppliers, and extract inventory data into the system.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Stock MCPwhat's the current stock for SKU-001?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
stock-mcp-server
Stock MCP 后端服务(NestJS 10 + Drizzle + PostgreSQL + Redis + MCP SDK 1.0) 当前版本:v0.3.0(JKY + Supor + 微信 Excel 三数据源已接入)
快速开始
# 1. 准备 .env
cp .env.example .env
# 按需修改 PG / Redis / JKY_* 配置
# 2. 启动依赖
docker compose up -d postgres redis # 或复用 baojia_src 实例
# 3. 安装依赖
pnpm install
# 4. 数据库迁移(首次)
pnpm db:migrate
# 5. 启动 API + SSE MCP
pnpm start:dev
# 6. 单独启动 stdio MCP(Claude Desktop 等本地客户端用)
pnpm mcp:stdioRelated MCP server: Inventory Management AI MCP
模块结构
src/
├── main.ts # NestJS 启动入口(HTTP + Swagger + SSE)
├── app.module.ts # 全局模块
├── config/ # 配置加载与 joi 校验
├── database/
│ ├── database.module.ts # PG Pool + Drizzle 实例
│ ├── migrate.ts # SQL 迁移执行器
│ └── schema/ # Drizzle TS schema(inventory / audit / source 枚举)
├── redis/
│ ├── redis.module.ts # ioredis 客户端
│ └── redis.service.ts # 通用 getJson/setJson/限流/分布式锁
├── common/
│ ├── scheduler/ # 统一调度器(node-cron + BullMQ)
│ ├── filters/ # 全局异常过滤
│ └── interceptors/ # 统一响应包装
├── modules/
│ ├── health/ # /health/live, /health/ready
│ ├── jky/ # 吉客云 MCP 适配(签名/限流/重试/mock)
│ ├── supor/ # 苏泊尔工厂适配(mock/http/csv 三模式)
│ ├── wechat-xlsx/ # 微信群 Excel 监听 + 解析 + webhook
│ ├── inventory/ # 库存核心查询(多源聚合 + 缓存 + stale 判定)
│ └── mcp-tools/ # MCP 工具注册(inventory.query 等 4 个工具)
└── mcp/
├── bootstrap.ts # MCP 上下文启动器
├── stdio.ts # Claude Desktop 直连入口
└── sse.controller.ts # 远端 MCP SSE + POST messageAPI 速览
详见 docs/api.md。
Method | Path | 说明 |
GET |
| 主查询(与 MCP 同源) |
GET |
| 列出所有仓库/供应商 |
GET |
| 健康检查(PG + Redis) |
GET |
| 存活探针 |
GET |
| Swagger UI |
MCP 工具
Tool | 说明 | 实现版本 |
| 主查询;多源并发 + stale 判定;强制 AI 带 asOf 字段 | ✅ v0.2.0 |
| 列仓库/供应商 | ✅ v0.2.0 |
| 异步 RPA 询问 | 🚧 v0.4.0(接口已暴露,调用会抛错) |
| 轮询 RPA 询问状态 | 🚧 v0.4.0 |
数据源(v0.3.0)
来源 | 接入方式 | 默认状态 |
吉客云 |
| ✅ mock 可用;切 |
苏泊尔工厂 | cron(每 2h)+ 按需补数 | ✅ mock 可用;切 `SUPOR_MODE=http |
微信群 Excel | webhook 被动 + 5min 轮询兜底 | ✅ webhook 已就绪 |
测试
pnpm test # 单元测试
pnpm test:cov # 覆盖率设计约束
不引入向量检索——库存是结构化精确匹配
强制三层时间戳——
as_of(必填) /ingested_at/created_at;INVENTORY_REQUIRE_AS_OF=true时缺 as_of 抛错陈旧阈值 30 分钟——超阈值自动标
stale=true并尝试 JKY 实时补数API + MCP 同源——所有查询都走
InventoryService,避免语义分裂JKY 签名兼容 baojia_src——
md5(appSecret + joined(sortedParams) + appSecret),可直接复用 baojia 的 JkyClient 测试用例
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
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/huohou0418/stock-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server