sagasu mcp服务器
smu设施预订网站已经过时了。人工智能在哪里?
由于严重缺乏艺术天赋,与双子座3 pro一起创作的吉祥物。
sagasu能做什么
所有搜索结果都会自动缓存,并具有可配置的过期检测功能(您可以运行 refresh_data 如果你愿意的话),该工具可以直接集成到其他mcp客户端(包括我亲爱的claude代码)。
- 检查可用性:
sagasu-mcp随附中所有有效过滤器的完整文档 FILTER_VALUES.md --包括建筑物、楼层、设施类型、设备和容量 - 查看现有预订
- 查看用户任务列表
sagasu不能做什么(以及为什么)
sagasu-mcp 不能 图书室。这是一个 *故意的* 设计决策,以防止smu的设施预订流程变成代理战争,代理人正在为预订房间而战——这会饿死真正需要房间的人。虽然实现这一点很简单,但我们宁愿 sagasu-mcp 不得为此目的滥用。
安装
您应该已经拥有:
- node.js 18+
- 剧作家安装
克隆仓库,然后创建一个 .env 使用您的凭据文件:
SMU_EMAIL=your.email@yourschool.smu.edu.sg
SMU_PASSWORD=your_passwordnpm run build为享受claude代码的人
添加到您的claude配置(~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"sagasu": {
"command": "node",
"args": ["/path/to/sagasu-mcp/build/index.js"],
"env": {
"SMU_EMAIL": "your.email@yourschool.smu.edu.sg",
"SMU_PASSWORD": "your_password"
}
}
}
}实际文件
get_available_rooms
看见 FILTER_VALUES.md 对于所有有效的筛选值
参数:
date(字符串,可选):日期格式为DD-MMM-YYYY(默认值:今天)startTime(字符串,可选):HH:MM格式的开始时间(默认值:08:00)endTime(字符串,可选):HH:MM格式的结束时间(默认值:22:00)buildings(string\[\],可选):按建筑名称筛选floors(string\[\],可选):按楼层号筛选facilityTypes(string\[\],可选):按设施类型筛选equipment(string\[\],可选):按所需设备过滤capacity(字符串,可选):容量范围过滤器availableNow(布尔值,可选):仅显示当前可用的房间
例子:
{
"buildings": ["Lee Kong Chian School of Business", "School of Computing & Information Systems 1"],
"availableNow": true
}get_user_bookings
参数:
status(字符串,可选):按“全部”、“已确认”或“待定”筛选
get_tasks
参数:
status(字符串,可选):按“全部”、“待处理”、“已批准”或“已拒绝”进行筛选
refresh_data
参数:
type(字符串,必填):“房间”、“预订”、“任务”或“全部”config(对象,可选):房间刮擦配置
例子:
{
"type": "rooms",
"config": {
"startTime": "09:00",
"endTime": "18:00",
"buildings": ["Lee Kong Chian School of Business"]
}
}get_status
检查缓存新鲜度和抓取器状态。
响应:
{
"rooms": { "lastUpdated": "2024-01-15T10:30:00Z", "stale": false },
"bookings": { "lastUpdated": "2024-01-15T09:00:00Z", "stale": true },
"tasks": { "lastUpdated": null, "stale": true },
"credentialsConfigured": true
}缓存
数据在本地缓存以减少抓取频率:
| 数据类型 | TTL |
|---|---|
| 房间 | 30分钟 |
| 预订 | 1小时 |
| 任务 | 1小时 |
使用 get_status 检查缓存新鲜度和 refresh_data 强行进行新的刮擦。
项目结构
sagasu-mcp/
├── src/
│ ├── index.ts # MCP server entry point
│ ├── scrapers/
│ │ ├── auth.ts # Shared authentication
│ │ ├── rooms.ts # Room availability scraper
│ │ ├── bookings.ts # User bookings scraper
│ │ └── tasks.ts # Tasks scraper
│ ├── cache/
│ │ └── manager.ts # Cache management
│ ├── tools/
│ │ ├── get-rooms.ts # MCP tool: get available rooms
│ │ ├── get-bookings.ts # MCP tool: get user bookings
│ │ ├── get-tasks.ts # MCP tool: get tasks
│ │ ├── refresh.ts # MCP tool: refresh data
│ │ └── status.ts # MCP tool: cache status
│ └── types/
│ └── index.ts # TypeScript types
├── tests/
│ └── scrapers.test.ts # Unit tests
├── cache/ # Cached JSON data
├── package.json
├── tsconfig.json
└── vitest.config.ts许可和贡献
麻省理工学院
如果你想贡献,请打开一个问题和/或拉取请求。请注意,其目的是 不 以公平对待其他付费学生的名义,实现设施预订流程的自动化。
