The MCP Canteen Server allows you to retrieve employee canteen attendance data with the following capabilities:
- Query meal attendance: Get breakfast, lunch, and total meal counts for specified date ranges
- Date specification options:
- Custom date ranges using
start_date
andend_date
in YYYYMMDD format - Relative periods like
today
,yesterday
,this_week
,last_month
- Custom date ranges using
- API integration: Requires proper environment variables for authentication
- Error handling: Provides diagnostic information for various failure scenarios
餐厅数据 MCP Server
本服务用于查询职工餐厅就餐人数数据,提供指定日期范围内的早餐和午餐就餐人数统计。
docs: https://modelcontextprotocol.io/quickstart/server
安装
通过 pip 安装
通过 uv 安装
开发环境安装
环境变量配置
在使用服务之前,需要配置以下环境变量:
CANTEEN_API_TOKEN
: API认证令牌CANTEEN_API_BASE
: API基础URL
环境变量获取方式
- 联系系统管理员获取 API 认证令牌
- API基础URL通常由系统管理员提供
设置环境变量
Windows
Linux/Mac
服务运行
使用 uv 运行
使用 Python 运行
功能说明
服务提供以下功能:
get_canteen_data
: 查询指定日期范围内的餐厅就餐人数数据- 参数:
start_date
: 开始日期,格式为YYYYMMDD(如20250331)end_date
: 结束日期,格式为YYYYMMDD(如20250331)period
: 相对时间范围,可选值:today
: 今天yesterday
: 昨天day_before_yesterday
: 前天this_week
: 本周last_week
: 上周this_month
: 本月last_month
: 上月
- 返回: 包含早餐人数、午餐人数和总计人数的文本统计
- 参数:
使用 Claude for Desktop 作为客户端测试
配置
打开并编辑文件: ~/Library/Application\ Support/Claude/claude_desktop_config.json,内容如下:
重启 Claude for Desktop
重启不报错,且有锤子
图标显示可用的 MCP Tool,即为成功;否则,查看日志排查
错误处理
常见错误及解决方案
- 环境变量未设置
- 错误信息:
缺少必要的环境变量配置
- 解决方案:确保已正确设置所有必需的环境变量
- 错误信息:
- 日期格式错误
- 错误信息:
日期格式不正确,请使用YYYYMMDD格式
- 解决方案:检查日期格式是否正确,例如:20240321
- 错误信息:
- API请求失败
- 错误信息:
HTTP请求失败
或API返回错误
- 解决方案:
- 检查网络连接
- 验证API令牌是否正确
- 确认API基础URL是否正确
- 错误信息:
- 服务器连接失败
- 错误信息:
无法连接到MCP服务器
- 解决方案:
- 确保服务器正在运行
- 检查端口是否被占用
- 验证配置文件是否正确
- 错误信息:
Claude for Desktop 日志
日志文件夹:~/Library/Logs/Claude
来自具体 MCP Server 的日志:mcp-server-canteen.log
MCP 连接通用日志:mcp.log
工作原理
- 客户将您的查询发送给 Claude
- Claude 分析可用的工具并决定使用哪一个
- 客户端通过 MCP 服务器执行所选工具
- 结果被发回给 Claude
- Claude 制定了自然语言响应
- 答案已经展示给你了!
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Tools
A service that provides cafeteria dining statistics, allowing users to query breakfast and lunch attendance numbers within a specified date range.
Related MCP Servers
- AsecurityAlicenseAqualityA Model Context Protocol server that provides structured access to canteen lunch menus for specific dates through a simple API integration.Last updated -10TypeScriptMIT License
- -securityFlicense-qualityA server that provides enterprise data services including company information, profiles, business details, shareholders, investments, branches, and key personnel through keyword search and specific queries.Last updated -4
- -securityFlicense-qualityProvides tools to query flight and train information including flight searches, train tickets, weather forecasts, and transfer options between different transportation modes.Last updated -15
- AsecurityAlicenseAqualityAn AI-powered server that helps users discover and book restaurants based on location, cuisine preferences, mood, and event type, with integration to Google Maps Places API for accurate recommendations.Last updated -53TypeScriptMIT License