Token导航 LogoToken导航TokenDH.com
Test Ordering MCP logo
开发工具stdio官方级别未说明来源级核验

Test Ordering MCP

MCP Server

一个基于模型上下文协议(MCP)的自动化测试系统,用于测试AGS订单工作流程。

工具数

0

提示词数

0

GitHub Stars

0

资源数

0
自动化测试PythonClaudeClaude DesktopClaudeCursor

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

chunin1103

提供方

chunin1103

最后核验

2026/5/17 20:20

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

pip install -r requirements.txt

详细介绍

MCP订购系统-测试代理

使用模型上下文协议(MCP)的AGS订购工作流程自动化测试系统。

概述

此存储库包含:

  • MCP服务器 (mcp_server.py)-通过MCP公开订购工作流工具
  • 测试代理 (test_agent.py)-自动化代理,用于测试完整的订购工作流程
  • 示例脚本 -各种测试场景

工作流程

订购系统遵循以下工作流程:

1. Extract Manufacturer Data (Tool #1)
   ↓
2. Review Generated Guide (optional)
   ↓
3. Finalize Order (Tool #2)
   ↓
4. Download Excel File

快速开始

1.安装

# Clone the repository
git clone 
cd test-ordering-mcp

# Install dependencies
pip install -r requirements.txt

# Configure environment
cp .env.example .env
# Edit .env with your Tool URLs if different from defaults

2.运行测试代理

基本用途 (测试沙洛姆制造商):

python test_agent.py

定制制造商:

python test_agent.py --manufacturer "Shalom"

自定义作业ID:

python test_agent.py --manufacturer "Shalom" --job-id "order-001"

所有选项:

python test_agent.py \
  --manufacturer "Shalom" \
  --job-id "order-001" \
  --tool1-url "https://ags-tools-1-extract.onrender.com" \
  --tool2-url "https://ags-tools-2-finalize.onrender.com" \
  --output-dir "./output"

3.检查结果

运行代理后,检查 ./output 目录:

  • {job_id}_{timestamp}.xlsx -生成的订单文件
  • {job_id}_guide.md -生成的指南
  • {job_id}_summary.json -工作流执行摘要
  • test_agent.log -详细日志

MCP服务器设置

适用于Claude Desktop(macOS)

编辑 ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "ags-orchestration": {
      "command": "python",
      "args": [
        "/path/to/test-ordering-mcp/mcp_server.py"
      ],
      "env": {
        "TOOL1_BASE_URL": "https://ags-tools-1-extract.onrender.com",
        "TOOL2_BASE_URL": "https://ags-tools-2-finalize.onrender.com"
      }
    }
  }
}

用于游标IDE

编辑 ~/.cursor/mcp.json:

{
  "mcpServers": {
    "ags-orchestration": {
      "command": "python",
      "args": [
        "/path/to/test-ordering-mcp/mcp_server.py"
      ],
      "env": {
        "TOOL1_BASE_URL": "https://ags-tools-1-extract.onrender.com",
        "TOOL2_BASE_URL": "https://ags-tools-2-finalize.onrender.com"
      }
    }
  }
}

适用于Windows(克劳德桌面版)

编辑 %APPDATA%\Claude\claude_desktop_config.json:

{
  "mcpServers": {
    "ags-orchestration": {
      "command": "python",
      "args": [
        "C:\\path\\to\\test-ordering-mcp\\mcp_server.py"
      ],
      "env": {
        "TOOL1_BASE_URL": "https://ags-tools-1-extract.onrender.com",
        "TOOL2_BASE_URL": "https://ags-tools-2-finalize.onrender.com"
      }
    }
  }
}

在Claude/ChatGPT中使用MCP工具

配置MCP服务器后,您可以使用以下命令:

示例1:完整工作流

Use extract_manufacturer_data to create an order for Shalom manufacturer with job_id "order-001"

然后:

Use finalize_order with the guide_uri from the previous step

最后:

Download the order file using get_order_file

示例2:使用指南复习

Extract data for Shalom (job_id: order-002), then show me the guide content before finalizing

可用的MCP工具

1.提取_制造商_数据

提取制造商数据并生成订购指南。

参数:

  • manufacturer_id (字符串,必填):制造商名称(例如“Shalom”)
  • job_id (字符串,必填):唯一作业标识符

退货:

  • guide_uri:生成指南的URL
  • schema_info:架构信息

2.最终确定订单

处理指南并生成Excel订单文件。

参数:

  • guide_uri (字符串,必填):来自extract_manufacturer_data的URI
  • job_id (字符串,必填):作业标识符

退货:

  • order_uri:下载订单文件的URL
  • order_file:生成的Excel的文件名

3.获取订单文件

下载生成的Excel文件。

参数:

  • job_id (字符串,必填):作业标识符
  • output_path (字符串,可选):保存文件的本地路径

退货:

  • file_path:下载文件的路径
  • file_size:大小(字节)

4.获取指南内容

查看指南文件的内容。

参数:

  • guide_uri (string,必填):指南的URI

退货:

  • content:引导标记内容

检测剂API

您还可以通过编程方式使用代理:

import asyncio
from test_agent import OrderingAgent

async def main():
    agent = OrderingAgent(
        tool1_url="https://ags-tools-1-extract.onrender.com",
        tool2_url="https://ags-tools-2-finalize.onrender.com",
        output_dir="./output"
    )

    # Run complete workflow
    result = await agent.run_complete_workflow(
        manufacturer_id="Shalom",
        job_id="order-001",
        review_guide=True
    )

    if result["success"]:
        print(f"Order file: {result['steps']['download']['file_path']}")
    else:
        print("Workflow failed")

asyncio.run(main())

项目结构

test-ordering-mcp/
├── mcp_server.py          # MCP server implementation
├── test_agent.py          # Automated testing agent
├── requirements.txt       # Python dependencies
├── .env.example          # Environment configuration template
├── .gitignore            # Git ignore rules
├── README.md             # This file
└── output/               # Generated files (created automatically)
    ├── *.xlsx            # Order files
    ├── *_guide.md        # Guide files
    ├── *_summary.json    # Workflow summaries
    └── *.log             # Log files

故障排除

MCP服务器未启动

  1. 检查Python版本(需要3.8+):
   python --version
  1. 验证依赖关系:
   pip install -r requirements.txt
  1. 手动测试:
   python mcp_server.py

无法访问工具URL

  1. 验证中的URL .env 或命令行:
   curl https://ags-tools-1-extract.onrender.com/health
   curl https://ags-tools-2-finalize.onrender.com/health
  1. 检查防火墙/代理设置

文件未下载

  1. 检查输出目录权限:
   mkdir -p ./output
   ls -la ./output
  1. 验证工具#2 URL是否正确

工作流失败

检查日志以获取详细的错误信息:

  • 控制台输出(stdout)
  • test_agent.log 文件
  • {job_id}_summary.json 逐步获得结果

高级用法

自定义测试场景

创建自定义测试脚本:

# my_test.py
import asyncio
from test_agent import OrderingAgent

async def test_multiple_manufacturers():
    agent = OrderingAgent(
        tool1_url="...",
        tool2_url="..."
    )

    manufacturers = ["Shalom", "Manufacturer2", "Manufacturer3"]

    for mfr in manufacturers:
        job_id = f"order-{mfr.lower()}-001"
        result = await agent.run_complete_workflow(mfr, job_id)
        print(f"{mfr}: {'✓' if result['success'] else '✗'}")

asyncio.run(test_multiple_manufacturers())

与CI/CD集成

添加到您的CI管道中:

# .github/workflows/test-ordering.yml
name: Test Ordering Workflow

on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Setup Python
        uses: actions/setup-python@v2
        with:
          python-version: '3.9'
      - name: Install dependencies
        run: pip install -r requirements.txt
      - name: Run test agent
        env:
          TOOL1_BASE_URL: ${{ secrets.TOOL1_BASE_URL }}
          TOOL2_BASE_URL: ${{ secrets.TOOL2_BASE_URL }}
        run: python test_agent.py --manufacturer Shalom

环境变量

变量描述默认值
TOOL1_BASE_URL工具#1的基本URL(提取)https://ags-tools-1-extract.onrender.com
TOOL2_BASE_URL工具#2的基本URL(最终确定)https://ags-tools-2-finalize.onrender.com
OUTPUT_DIR输出文件目录./output

贡献

  1. 分叉存储库
  2. 创建要素分支
  3. 进行更改
  4. 使用代理进行测试
  5. 提交拉取请求

许可证

\[您的许可证在这里\]

支持

对于问题或疑问:

  • 检查登录 test_agent.log
  • 查看中的工作流摘要 output/{job_id}_summary.json
  • 在存储库中打开问题

目录标签

目录标签

自动化测试PythonClaude本地部署订单处理工作流测试MCP协议

支持客户端

Claude DesktopClaudeCursor

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP