ERP-lite MCP Server

ERP-lite MCP Server

MCP server that exposes ERP functionalities to AI agents, enabling read-only queries for sales orders and inventory, and human-in-the-loop purchase requisition creation and approval.

Category
访问服务器

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 maturity, this project features a realistic data schema and a critical human-in-the-loop workflow for write actions.

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_approval state.
  • The agent cannot approve its own requisition. A human must intervene to approve it.

Architecture

graph TD
    Client[Claude Desktop / Custom Client] -->|MCP (stdio or SSE HTTP)| FastMCP[FastMCP Server]
    FastMCP -->|SQLAlchemy| DB[(PostgreSQL Database)]
    DB --> Seed[Seed Data]

Quick Start (Docker)

To get started quickly, run the entire stack with Docker Compose:

docker compose up

This spins up:

  • A PostgreSQL database (pre-seeded with realistic enterprise data for sales orders, inventory, and requisitions).
  • The MCP server exposing SSE transport at http://localhost:8000/sse.

Tools Exposed

  • get_open_orders(status="open", limit=20): Retrieves a list of sales orders by status.
  • check_inventory(material_id): Checks the inventory level and computes if it's below the reorder point.
  • get_low_stock_items(): Intelligent query that identifies all inventory items below their reorder threshold.
  • create_requisition(material_id, quantity, requested_by): WRITE TOOL. Creates a new purchase requisition in a pending_approval state.
  • approve_pending_requisition(requisition_id, approved_by): WRITE TOOL. Approves a pending requisition. Must be explicitly triggered by human confirmation.

Testing Locally

Using the Custom Python Client

To prove that this server supports remote transport via HTTP (Server-Sent Events), you can use the built-in client script:

python client.py

Using Claude Desktop (Stdio transport)

To test with Claude Desktop, configure your claude_desktop_config.json to use the uv run command:

{
  "mcpServers": {
    "erp-lite": {
      "command": "C:\\Absolute\\Path\\To\\erp-lite-mcp\\.venv\\Scripts\\python.exe",
      "args": [
        "-m",
        "src.server"
      ],
      "env": {
        "PYTHONUNBUFFERED": "1",
        "PYTHONIOENCODING": "utf-8",
        "PYTHONPATH": "C:\\Absolute\\Path\\To\\erp-lite-mcp"
      }
    }
  }
}

Note for Windows Users: Claude Desktop runs in a sandboxed environment on Windows. Using uv run directly inside the config often fails to resolve relative module paths correctly. It is highly recommended to provide the absolute path to the .venv\Scripts\python.exe and explicitly pass your project directory as the PYTHONPATH environment variable as shown above.

Running Unit Tests

To run the pytest suite testing the tool logic and requisition lifecycle:

uv run pytest

Future Enhancements

  • Authentication & RBAC: Implement Role-Based Access Control to ensure the approved_by identity has the actual rights to approve the specific value/material in the requisition.
  • Audit Logging: Maintain a strict append-only audit trail of who/what queried and executed which tool, crucial for compliance (e.g. SOX).
  • Policy Search Resource: A RAG-like capability to expose procurement policy documents to the agent as MCP resources.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选