Skip to main content
Glama
Running-hue

ProcureFlow MCP Server

by Running-hue

Procure Agent

A multi-agent intelligent procurement system built on DeepAgents / LangGraph, integrating procurement analysis, order execution, ERP data services, MCP tools, long-term memory, and sandboxed execution into an auditable business pipeline.

Python LangGraph FastAPI MCP Vue

Project Highlights

  • Multi-Agent Collaboration: The main Agent handles intent recognition and task routing, procurement-analyst handles procurement analysis, and procurement-order handles order queries and write operations; Prompts, Skills, and middleware are all decoupled through YAML/modular configuration.

  • Standardized Business Tools: Supplier, inventory, and purchase order capabilities are encapsulated via MCP, providing 8 tools in total, supporting price comparison, inventory alerts, order detail queries, procurement recommendations, and visual report generation.

  • Human-in-the-Loop: Before creating or modifying orders, the Agent automatically parses materials, supplier prices, and system unit prices, structures missing fields, and requires manual approval before the final write.

  • Long-Context Management: MongoDB Checkpoint saves session state, with long-term memory isolated per user; context summarization, tool result offloading, and progressive Skills loading are combined to control context overhead.

  • Isolated Execution and Recovery: OpenSandbox handles file and code execution, supporting health checks, lifecycle renewal, failure recovery, and Skills restoration.

  • ERP Python Migration: The original Spring Boot ERP layer is refactored using FastAPI + SQLAlchemy, maintaining compatibility with 54 REST endpoint paths, 8 MCP tools, and the original response protocol.

Related MCP server: ECOUNT MCP Server

System Architecture

flowchart LR
    UI[Vue 3 对话前端] --> CHAT[FastAPI Chat API]
    CHAT --> MAIN[主 Agent\n意图识别 / 路由]
    MAIN --> ANALYST[采购分析 Agent]
    MAIN --> ORDER[采购订单 Agent]
    ANALYST --> MCP[MCP 工具层\n8 tools]
    ORDER --> HITL[字段补充 / 人工审批]
    HITL --> MCP
    MCP --> ERP[FastAPI ERP\n54 REST APIs]
    ERP --> MYSQL[(MySQL)]
    MAIN --> MONGO[(MongoDB\nCheckpoint / Store)]
    ANALYST --> SANDBOX[OpenSandbox\nSkills / 文件 / 代码]
    ORDER --> SANDBOX

Interface Display

Multi-Agent Intelligent Procurement Workbench

Unified display of session history, streaming responses, tool calls, and Agent business capabilities.

Procure Agent Workbench

Inventory Analysis and Visual Reports

The procurement analysis Agent calls inventory MCP tools to output inventory alert tables, bar charts, and procurement recommendations.

Inventory Analysis and Visual Reports

Order Validation and Human Approval

The order Agent completes material, quantity, system unit price, and delivery date validation, then stops at the human approval boundary; no writes are executed without approval.

Order Validation and Human Approval

Core Processes

Procurement Analysis

用户需求 → 主 Agent 路由 → 采购分析 Agent
        → MCP 查询 ERP 数据 → 按需加载分析 Skill
        → 沙箱生成报告/图表 → 主 Agent 汇总结论与建议

Purchase Orders

用户下单/改单 → 主 Agent 路由 → 采购订单 Agent
        → 查询物料、供应商和系统单价
        → 校验 Schema → 结构化补充缺失字段
        → Human-in-the-Loop 最终审批 → MCP 写入 ERP

Project Structure

procureflow-agent/
├─ src/
│  ├─ agent/          # 主 Agent、子 Agent、中间件、记忆、HITL 与沙箱后端
│  ├─ skills/         # 主 Agent、采购分析与订单扩展 Skills
│  ├─ mcp_server/     # 8 个 ERP MCP 工具
│  ├─ erp_api/        # FastAPI + SQLAlchemy ERP 服务
│  └─ api_view/       # 对话、历史记录与流式事件 API
├─ frontend/          # Vue 3 对话前端
├─ tests/             # ERP 流程、54 接口与 8 MCP 工具契约测试
├─ migrations/        # Alembic 基线迁移
├─ database/          # 已匿名化的本地演示数据
├─ demo_data/         # 采购网页抓取的最小可复现报价页面
├─ docs/              # 架构迁移与等价性说明
└─ start_web.py       # ERP、MCP、Agent API、前端统一启动器

Quick Start

1. Create Environment

Conda is recommended for managing both Python 3.11 and Node.js 22:

git clone https://github.com/Running-hue/procureflow-agent.git
cd procureflow-agent
conda env create -f environment.yml
conda activate procureflow-agent
Copy-Item .env.example .env

Configure MySQL, MongoDB, model services, and OpenSandbox in .env. The repository does not contain any real secrets.

2. Initialize Database

Create empty tables:

alembic upgrade head

Or import sample data:

python scripts\import_original_sql.py --yes-recreate

Importing sample data will rebuild the related tables; do not run this against a production database.

3. Start the Optional Quote Demo Page

The three quote pages from the procurement analysis Skill are included in the repository. When OpenSandbox runs in Docker, access it via host.docker.internal:

python -m http.server 5173 --directory demo_data\quote_pages

4. Start the Full Service

python start_web.py

Service

Address

Vue Frontend

http://127.0.0.1:3000

ERP OpenAPI

http://127.0.0.1:8080/docs

Agent OpenAPI

http://127.0.0.1:8090/docs

MCP

http://127.0.0.1:8000/mcp

Verification

python -m pytest -q
ruff check src\erp_api src\mcp_server tests start_web.py scripts
cd frontend
npm ci
npm run build

Current automated verification coverage:

  • 54 ERP REST endpoint path contracts;

  • 8 MCP tool registration contracts;

  • Supplier, part, inventory, order transaction, and line-item flows;

  • OpenSandbox failure recovery logic;

  • Vue 3 production builds.

Real end-to-end conversations with models, MongoDB, MySQL, and OpenSandbox require local services and personal keys; this repository does not fake external integrations.

Security Design

  • .env, local key directories, logs, caches, generated files, and frontend build artifacts are all ignored by Git.

  • Purchase order write operations are executed only by the order sub-Agent, and manual approval is required before any MCP write tool is actually invoked.

  • Unverified Skills run in OpenSandbox; user memory is persisted in isolation per user_id.

  • Large tool results are automatically offloaded, and automatic summarization kicks in when the context approaches the limit, reducing the risk of long-chain failures.

For migration scope and API equivalence details, see Migration Report; for security boundaries, see SECURITY.md.

F
license - not found
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Exposes 48 SAP Ariba APIs as Claude-compatible tools for managing procurement, sourcing, supplier management, and supply chain data. It enables AI agents to interact with contracts, catalogs, and business network transactions through natural language.
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    Enables AI assistants to interact with ECOUNT ERP through natural language, providing tools for products, inventory, sales, purchases, and more.
    23
    22
    3
    MIT
  • F
    license
    Not graded
    quality
    C
    maintenance
    Enables AI assistants to query and operate Dingjie ERP system via natural language, covering procurement, sales, and material management.
    1

View all related MCP servers

Related MCP Connectors

  • Runtime permission, approval, and audit layer for AI agent tool execution.

  • Odoo ERP for AI agents: hosted OAuth endpoint, gated writes, one endpoint for every instance.

  • Secure agent purchasing with human-approved virtual cards, receipts, and audit trails.

View all MCP Connectors

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/Running-hue/procureflow-agent'

If you have feedback or need assistance with the MCP directory API, please join our Discord server