模型上下文协议服务器

Pinglo MCP Server是一个将Pinglo功能暴露给AI代理的模型上下文协议服务器,使代理系统无需HTTP知识或凭证管理即可编排Pinglo活动。

  • by gowthamjayaram
  • Python
  • 本地部署
  • 更新于
在 GitHub 查看 gowthamjayaram/pinglo-mcp

使用说明

Pinglo MCP服务器

向AI代理公开Pinglo功能的MCP(模型上下文协议)服务器。

概述

Pinglo MCP使代理AI系统(Claude、n8n等)能够通过Pinglo编排活动,而不需要HTTP知识或凭据管理。客服直接通过MCP调用Pinglo工具。

快速开始

# Install dependencies
pip install -r requirements.txt

# Run the MCP server
python mcp_server.py

# Run all tests (unit + integration + E2E)
pytest

文档

  • domain.md --什么是MCP?架构、约束、身份验证策略
  • 最佳实践.md --工具模式、HTTP客户端模式、错误处理标准
  • 实施_ Employment.md --构建要素的6阶段工作流程
  • product_canvas.md --功能规格模板
  • PRP/ --每个功能的产品和技术画布
    • product_canvas_receive_messages.md --特征1:消息工具规范
    • tech_canvas_receive_messages.md --特点1:实施计划

项目结构

pinglo-mcp/
├── domain.md                          # Architecture overview
├── BEST_PRACTICES.md                  # Coding standards
├── IMPLEMENTATION_TEMPLATE.md         # Feature workflow
├── product_canvas.md                  # Feature spec template
├── config.py                          # Configuration
├── mcp_server.py                      # MCP server entry point
├── tools/                             # Tool implementations
│   ├── __init__.py
│   ├── messages.py                    # receive_message tool
│   └── README.md                      # Tool documentation
├── tests/                             # Test suite (28 tests)
│   ├── test_tools_messages.py         # Unit tests (10)
│   ├── test_mcp_server.py             # MCP tests (13)
│   └── test_e2e_receive_message.py    # E2E tests (5)
├── requirements.txt                   # Python dependencies
├── .env.example                       # Environment template
└── PRPs/                              # Product/Tech canvases
    ├── product_canvas_receive_messages.md
    └── tech_canvas_receive_messages.md

状态

功能1:接收消息工具 ✅ 完成(第1-6阶段)

  • 第一阶段:核心逻辑✅ (10个单元测试,覆盖率89%)
  • 第二阶段:集成层✅ (HTTP客户端,错误处理)
  • 第三阶段:MCP注册✅ (通过装饰器发现工具)
  • 阶段4:错误处理✅ (测试所有故障路径)
  • 第5阶段:文件编制✅ (domain.md,工具/README.md)
  • 第6阶段:E2E测试✅ (5次E2E测试,自动启动Pinglo后端)

测试套件:

  • 总共28次测试✅ (10台机组+13 MCP+5 E2E)
  • 约94%的代码覆盖率
  • 所有测试均已通过

运行测试

# Run all tests
pytest

# Run only unit + MCP tests
pytest tests/test_tools_messages.py tests/test_mcp_server.py

# Run only E2E tests
pytest tests/test_e2e_receive_message.py -v

# Run with coverage report
pytest --cov=tools --cov=mcp_server

发展

看 IMPLEMENTATION_TEMPLATE.md 用于分阶段的工作流程。

许可证

待定