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数据库中公共数据的访问。
