
一个模式背景协议服务器向AI代理披露ERP类数据(销售订单,库存,采购请购单)——在写作动作上有一个真正的人入式批准门.
概览
一个企业备妥的 " 模式背景协议 " (MCP)服务器,将企业资源规划系统的功能暴露给AI代理商。 这个项目是作为展示AI/ML工程成熟度的组合项目而建立的,其特点是一个现实的数据计划,一个真正执行的用于写作动作的即时人员审批工作流程,以及一个完全合规式的审计线索。 随着企业AI的采用加快,为LLMs提供直接阅读/写入ERP系统的机会变得至关重要。 然而,自主代理机构不应在没有人力监督的情况下执行相应的业务(如订立定购单或改变系统配置)。 这个服务器展示了一个强大的"人入"模式: -AI代理可以查询,检查,并使用其只读工具进行识别. - 当代理人决定补充库存时,只能提出待批准的状态。 - 说吧 当它创建请购单时,会生成一个安全的批注 token并保存到数据库中,但从未返回代理.
概述(AI 翻译)
一个企业备妥的 " 模式背景协议 " (MCP)服务器,将企业资源规划系统的功能暴露给AI代理商。 这个项目是作为展示AI/ML工程成熟度的组合项目而建立的,其特点是一个现实的数据计划,一个真正执行的用于写作动作的即时人员审批工作流程,以及一个完全合规式的审计线索。
□ 概览
随着企业AI的采用加快,为LLMs提供直接阅读/写入ERP系统的机会变得至关重要。 然而,自主代理机构不应在没有人力监督的情况下执行相应的业务(如订立定购单或改变系统配置)。
这个服务器展示了一个强健的"人行走"模式:
- 人工智能代理人可以查询开放销售订单,检查库存水平,并使用其只读工具识别低库存物品。
- 代理人决定补充库存时,只能以[(T0)]状态提出购买请购单。
- ** 代理人不能批准自己的请购单。 ** 当它创建请购单时,会生成一个
approval_token安全装置并保存到数据库中,但从未返回代理商.
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
ERP-lite MCP Server
An enterprise-ready Model Context Protocol (MCP) server that exposes ERP functionalities to AI agents. Built as a portfolio project to demonstrate AI/ML engineering maturity, this project features a realistic data schema, a genuinely enforced human-in-the-loop approval workflow for write actions, and a full compliance-style audit trail.
Overview
As enterprise AI adoption accelerates, providing LLMs with direct read/write access to ERPs is becoming essential. However, autonomous agents should not execute consequential operations (like creating purchase orders or altering system configurations) without human oversight.
This server demonstrates a robust “human-in-the-loop” pattern:
- The AI agent can query open sales orders, check inventory levels, and identify low-stock items using its read-only tools.
- When an agent decides to replenish stock, it can only propose a purchase requisition in a
pending_approvalstate. - The agent cannot approve its own requisition. When it creates the requisition, a secure
approval_tokenis generated and saved to the database, but is never returned to the agent. - A human administrator can view pending requisitions and their tokens via a dedicated, authenticated REST endpoint (
GET /admin/pending-requisitions) that sits entirely outside the MCP tool surface — no agent can reach it. - The human retrieves the token through that endpoint and supplies it back to approve the requisition, closing the loop with a real access-control check (constant-time token comparison), not just a naming convention.
- Every tool call — successful or failed — is written to an append-only audit log, with sensitive values like
approval_tokenredacted before persistence.
Architecture
graph TD
Client[Claude Desktop / Custom Client] -- "MCP (stdio or Streamable HTTP with Bearer Token)" --> FastMCP[FastMCP Server]
FastMCP -- "SQLAlchemy" --> DB[(PostgreSQL Database)]
DB --> Seed[Seed Data]
Admin[Human Admin] -- "X-Admin-Key (REST, outside MCP surface)" --> FastMCP
Demo
https://github.com/user-attachments/assets/8584d882-ecb2-43f2-bd31-7a095bedd25c
Checking low-stock inventory → agent proposing a purchase requisition → retrieving the approval token via the admin endpoint → approving the requisition → resulting audit log entry.
Quick Start (Docker)
First, create your .env file and set secure keys for both the MCP transport and the Admin API:
cp .env.example .env
# Edit .env and set MCP_API_KEY and ADMIN_API_KEY to secure, independent values
Then start the containers:
docker compose up
This spins up:
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →配置
{
"mcpServers": {
"erp-lite": {
"command": "/absolute/path/to/erp-lite-mcp/.venv/Scripts/python.exe",
"args": ["-m", "src.server"],
"env": {
"PYTHONUNBUFFERED": "1",
"PYTHONIOENCODING": "utf-8",
"PYTHONPATH": "/absolute/path/to/erp-lite-mcp"
}
}
}
}