产品召回查询服务

一个用于访问法国产品召回数据的MCP服务器,提供多种查询工具和提示功能。

  • by azman0101
  • Python
  • 本地部署
  • 更新于
在 GitHub 查看 azman0101/rappel-conso-mcp

使用说明

Rappel Conso MCP服务器

模型上下文协议(MCP)服务器,用于访问RappelConso API的法国产品召回数据。

概述

该MCP服务器提供查询法国政府产品召回数据库(RappelConso)的工具。它公开了MCP客户端可以用来搜索和检索产品召回信息的几个工具。

可用工具

  • get_rappels_conso:通过过滤和分页检索产品召回
  • get_latest_rappels:获取最新的产品召回信息
  • get_categories_with_counts:列出召回次数的产品类别
  • get_most_represented_category:查找召回次数最多的类别
  • get_latest_from_category:获取特定类别的最近召回

可用提示

  • chercher_rappel_produit:生成特定产品的搜索消息

安装

安装所需的依赖项:

pip install -r requirements.txt

运行服务器

python server-rappel.py

测试

该项目包括一个全面的测试套件,用于验证MCP服务器的功能。

安装测试依赖项

pip install -r requirements-dev.txt

运行测试

运行所有测试:

pytest test_mcp_server.py -v

运行特定的测试类:

pytest test_mcp_server.py::TestMCPServerConfiguration -v
pytest test_mcp_server.py::TestMCPTools -v
pytest test_mcp_server.py::TestMCPPrompts -v
pytest test_mcp_server.py::TestToolFunctionality -v
pytest test_mcp_server.py::TestErrorHandling -v

测试覆盖率

测试套件包括:

  • MCP服务器初始化和配置
  • 工具可用性和注册
  • 即时可用性和功能
  • 具有模拟API调用的工具功能
  • HTTP和请求错误的错误处理

许可证

该项目提供了对法国政府RappelConso数据库中公共数据的访问。