Skip to main content
Glama

服装老板驾驶舱 · AI 开放接口(MCP)

装上这个,你平时用的 AI 助手(WorkBuddy、Claude、Codex、Cursor…)就能直接管你厂里的订单—— 不用截图、不用复制粘贴、不用它猜。

一句话:AI 助手从此能看见你厂里的真实数据,也能往里写。


装了以后,你能这么说

你说的话

它做的事

「今天厂里有什么要盯的?」

调出今天的逾期单、3 天内到期的、卡住的加急单、已入仓没回款的,按紧急程度排给你

「客户微信发来这张下单表,帮我录进去」

把表整理成订单,先演练一遍给你看,你点头了才真录,一次几十单

「DD-2603 已经打包完了」

直接把这张单推到「打包中」,车间看板同步变

「谁的货拖了?」

按交期倒序列出所有逾期未交的单,带客户名和差几天

「提醒我明天催一下洗水厂」

往驾驶舱里落一条待办,你自己的待办列表里就能看到


Related MCP server: Odoo MCP Pack

装(三步,两分钟)

1. 先拿到两样东西

  • 账号:登录驾驶舱后,浏览器地址栏里 u_ 开头那一串

  • API Key:驾驶舱里「版房 → 对接设置」,复制完整那一串

2. 跑安装

方式 A:npm(不用下载任何文件,推荐)

需要 Node 14 以上。终端里一条命令:

npx longda-cockpit-setup

它会问你网址、账号、Key,当场连一次验证,连上了才写进配置。

想先确认装好了没:

npx longda-cockpit-mcp --selftest

看到 12 个工具名就是对的。

也可以全局安装:npm i -g longda-cockpit-mcp,之后直接跑 longda-cockpit-setup。

方式 B:下载 zip 解压

Windows:双击 一键安装-Windows.bat

Mac / Linux:在终端里

cd 这个文件夹
node install.js

跟着提示填网址、账号、Key。它会当场连一次验证——连上了才继续,连不上会告诉你差在哪。

3. 重启 AI 助手

  • WorkBuddy:设置 → 连接器 / MCP,看到 longda-cockpit,点一下「信任」

  • Codex:关掉终端重开

  • Claude Desktop:完全退出再打开

然后直接问它:「今天厂里有什么要盯的?」

装的过程不会动你其它的配置。已有的 MCP 服务、Codex 里别的设置,都原样保留,只多一段。


手动配置(不想跑安装脚本的)

WorkBuddy / Claude Desktop / Cursor

配置文件 ~/.workbuddy/mcp.json(Claude 是 ~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "longda-cockpit": {
      "command": "node",
      "args": ["把这里换成 server.js 的完整路径"],
      "env": {
        "COCKPIT_BASE": "https://ylzz.work",
        "COCKPIT_ACCT": "你的账号",
        "COCKPIT_KEY": "你的APIKey"
      }
    }
  }
}

Codex

~/.codex/config.toml 末尾加:

[mcp_servers.longda-cockpit]
command = "node"
args = ["把这里换成 server.js 的完整路径"]
env = { COCKPIT_BASE = "https://ylzz.work", COCKPIT_ACCT = "你的账号", COCKPIT_KEY = "你的APIKey" }

不想用 MCP,直接 HTTP 调

接口就长这样,任何能发 HTTP 的东西都能用(豆包、DeepSeek、n8n、影刀、自己写的脚本):

curl "https://ylzz.work/api/open/v1/alerts?acct=你的账号" \
  -H "x-api-key: 你的APIKey"

完整接口清单:https://longdaai.top/openapi/


工具清单

工具

干什么

会不会改数据

cockpit_summary

关键数字:订单数、在产、逾期、加急、待办

只读

cockpit_alerts

今天该盯的事,按紧急程度排好

只读

cockpit_orders

按客户/状态/逾期/加急查订单

只读

cockpit_order

单张订单全部信息,含颜色尺码矩阵

只读

cockpit_todos

还没做完的待办

只读

cockpit_help

接口说明书(字段叫什么、状态码几是哪个节点)

只读

cockpit_morning_report

看今天早报全文(不发送)

只读

cockpit_create_order

建一张单

会写

cockpit_import_orders

批量导入下单表

会写

cockpit_update_order

改单 / 推进生产节点

会写

cockpit_add_todo

写一条待办

会写

cockpit_push_now

把早报立刻推到老板手机

会发消息

每天 7:30 驾驶舱会自动把这份早报推到老板微信 / 飞书,不用谁去问。要改时间或换群,看 push.json。


安全上做了什么

  • 一把钥匙只开一把锁:API Key 绑定单个账号,只能看到自己厂的数据

  • 能改的字段有白名单:只有单号、客户、款式、数量、价格、交期、节点这些正常业务字段,塞不进乱七八糟的东西

  • 写操作是服务端「读-改-写」:两个人同时改不会互相覆盖,每次改动 rev 自增

  • 建单防重复:同一个单号再提交一次不会建出两张单,返回「已存在」,AI 重试也不会搞出重复单

  • 可以先演练:任何写操作加 dryRun 只校验不落库,适合让 AI 先给你看结果

  • 说停就停:账号在后台一停用,接口立刻拒绝


常见问题

连不上 / 报 403

先确认三件事:网址对不对(浏览器能打开 https://ylzz.work)、账号是不是 u_ 开头那串、Key 有没有复制全(前后别带空格)。

AI 说「没有这个工具」

没重启。WorkBuddy 要在设置里刷新连接器并点「信任」,Codex 要重开终端。

改了数据,驾驶舱里没变

驾驶舱是打开时拉一次数据。刷新一下页面(F5)就能看到。

能不能只给它读、不给它写?

可以。在配置的 env 里加 COCKPIT_READONLY=1——不过更简单的办法是直接跟 AI 说「只准查,不准改」,或者干脆只用 HTTP 的只读接口。

换账号怎么办

重跑一次 node install.js,填新账号即可,不会在配置里留两份。


自检

node server.js --selftest

会打印当前连的是哪个地址、哪个账号、Key 前六位,以及全部工具名。不打印完整 Key。


龙大AI · 企业 AI 落地 | https://longdaai.top

Available Tools

12 tools
cockpit_add_todo写待办A

往驾驶舱里落一条待办,让老板在自己的待办列表里看到。核对订单时发现问题,就把问题写成待办,别只在对话里说。

Inputs: text (required), due, prio.

cockpit_alerts今天该盯的事A

按紧急程度返回需要老板处理的事:逾期未交、3 天内到期、7 天内到期、加急单卡住、已入仓未回款、今天到期的待办。做「每日提醒」或「早会清单」就用这个。

Inputs: level.

cockpit_create_order建订单A

把一张新订单录进驾驶舱。客户名称和数量必填。同一单号重复提交不会建重复单(返回 existed:true),所以可以放心重试。想先演练不落库,传 dryRun:true。

Inputs: qty (required), customer (required), mx, no, +11 more.

cockpit_help接口说明书A

返回开放接口的完整说明书:所有端点、字段含义、状态枚举、调用示例。想确认某个字段叫什么、状态码几代表哪个节点时调它。

Inputs: no named parameters.

cockpit_import_orders批量导入下单表A

客户发来一张下单表(Excel/图片/微信消息),你把它整理成订单数组,一次全录进去。返回逐条结果:新建 / 已存在 / 失败原因。任一单据失败不影响其它单。

Inputs: orders (required), dryRun.

cockpit_morning_report看今天早报A

生成今天这份「早报」的全文(逾期、今天到期、3 天内到期、缺料、未回款、今日待办),先给老板看,不发送。老板说「推给我」时再用 cockpit_push_now。

Inputs: no named parameters.

cockpit_order订单详情A

拿一张订单的全部信息,含颜色尺码矩阵。要看「这一单每个颜色每个码各多少件」时用。

Inputs: no (required).

cockpit_orders查订单A

按条件查订单。不带条件就是全部(最多 200 条)。每行带:单号、客户、款式、数量、已交、单价、下单日、交期、当前节点、进度%、距交期天数。

Inputs: q, limit, status, urgent, +2 more.

cockpit_push_now立刻推早报到手机A

把今天的早报立刻发到老板的微信 / 飞书(走驾驶舱里配好的推送渠道)。每天 7:30 会自动发一次,这个工具用于「现在就想看」。

Inputs: no named parameters.

cockpit_summary今日概览A

一次拿到这家厂的关键数字:订单总数、在产单数、逾期单数、加急单数、待办条数。不知道下一步查什么时,先调这个。

Inputs: no named parameters.

cockpit_todos看待办A

列出还没做完的待办(到期日、优先级)。

Inputs: no named parameters.

cockpit_update_order改订单 / 推节点B

改一张订单的字段,最常用的是推进生产节点(status 0→8)。只传要改的字段,其余不动。

Inputs: no (required), ws, cut, due, +6 more.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 12 tools

    Disambiguation4/5

    Most tools are clearly distinct (list vs. single order vs. create vs. update vs. import all have different purposes). The main risk is the trio cockpit_summary / cockpit_alerts / cockpit_morning_report, which all surface 'what needs attention' and could be confused at a glance, but descriptions explicitly disambiguate each ('不知道下一步查什么' vs '每日提醒' vs '早报全文'). cockpit_orders vs. cockpit_order differs only by singular/plural, which is readable but slightly subtle.

    Naming Consistency4/5

    Every tool carries the same cockpit_ prefix and consistent snake_case, which is highly predictable. However, conventions mix noun-only names (cockpit_summary, cockpit_todos, cockpit_orders, cockpit_order, cockpit_help) with verb_noun names (cockpit_create_order, cockpit_update_order, cockpit_add_todo, cockpit_push_now), and the singular/plural pair orders/order encodes a semantic distinction that isn't visually obvious.

    Tool Count5/5

    12 tools is squarely in the well-scoped range, and each earns its place: dashboard summaries, alerts, order CRUD/import, todos, reporting, and help are all distinct concerns of a factory cockpit. No tool appears redundant or filler.

    Completeness4/5

    Order lifecycle is well covered (create, bulk import, list, get, update/status advance) and the report lifecycle (generate then push) is complete. The notable gap is the todo surface: todos can be listed and added but never marked complete, closed, or edited, which will force workarounds; order deletion/cancellation is also absent (though possibly reachable via status update).

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents to query and operate on ERP data through a unified tool interface, working across CSV exports, SFTP drop folders, SQLite/ODBC, and optional enterprise APIs. It supports purchase orders, vendors, and inventory lookups while keeping agent-facing tools consistent regardless of backend.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents to query live ERP/CRM records through Odoo's external JSON-RPC API, covering contact and company lookups, sales orders and quotations, CRM leads and opportunities, customer invoices, and generic search_read access to any Odoo model. Runs either as a hosted gateway endpoint or a local stdio server.
      65 npm
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables read- or write-scoped access to synthetic enterprise orders, inventory, support tickets, and metrics via schema-validated JSON-RPC tools over stdio and HTTP, with permission allow-lists and audit logging. It also exposes enterprise resources and prompt templates for grounded, cited, multi-step assistant workflows.
      MIT