无服务器学生信息直连工具
简介
基于 curl 的轻量级方案,直接访问 Infinite Campus 校园门户获取成绩、出勤、作业等学生数据,无需安装 MCP 服务器,适合脚本自动化与边缘设备场景。
原始描述
Query an Infinite Campus (Campus Parent portal) district directly with curl instead of running the infinitecampus-mcp server — log in with a real username/password, capture the session cookie + XSRF token, and curl grades, attendance, assignments, schedule, messages, documents, and fees. Use when you want IC data without the MCP, in a script, or on a machine where the MCP isn't installed. Infinite Campus is per-district: the base URL and district app name are configurable, not hardcoded.
通过你的 Agent 添加
安装目录:tmp-aybaebvbfv/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
中文使用说明 来自收录源
核心用法
本 Skill 提供了一套纯 shell/curl 方案,用于直接访问 Infinite Campus 的 Campus Parent 门户,绕过 MCP 服务器依赖。用户通过向 verify.jsp 发送表单 POST 请求完成登录,获取 session cookie 和 XSRF token 后即可调用 17 个只读 API 端点,涵盖学生基本信息、成绩、出勤记录、作业、课程表、消息、文档、费用、教师信息、评估结果等数据。
使用流程分为三步:配置环境变量(IC_BASE_URL、IC_DISTRICT、IC_USERNAME、IC_PASSWORD)、执行登录捕获 cookie、使用封装函数 ic_get 进行后续查询。所有请求需携带 cookie jar 和 X-XSRF-TOKEN 头,会话有效期约 5-6 小时,过期后需重新登录。
显著优点
零依赖轻量方案:仅需 curl 和 jq,无需 Node.js 运行时或 MCP 服务器安装,适合 CI/CD 流水线、边缘设备、容器化脚本等受限环境。
配置灵活:支持多地区(per-district)部署,base URL 和 district 名称完全可配置,不硬编码任何特定学区信息,便于跨学区复用。
完整数据覆盖:提供 17 个端点的即用命令模板,包含学生解析、 enrollment 关联、文档下载等完整工作流,并附带模块禁用检测逻辑。
安全传输:凭证通过 form body 提交而非 URL 参数,避免出现在访问日志中;支持标准 cookie 管理机制。
潜在缺点与局限性
会话管理简陋:无自动续期机制,5-6 小时会话过期后需手动重登,相比 MCP 的 CookieSessionManager 缺失自动重试能力。
无跨学区 SSO 支持:CUPS 关联学区切换需完整 token 交换流程,本 Skill 明确排除该场景,多学区家庭需分别为每个 portal 重复登录。
模块可用性不确定:behavior、food_service 等端点未经实际验证,404 可能是模块禁用也可能是路径差异,需额外调用 displayOptions 接口预判。
仅限只读操作:所有示例为 GET 请求,ic_get_message 可能存在已读标记副作用但未确认,无创建/更新/删除能力。
适合的目标群体
- 需要在没有 MCP 环境的机器(如服务器、IoT 设备)上获取 IC 数据的运维人员
- 偏好纯 shell 脚本、追求最小依赖的技术用户
- 需要快速原型验证或一次性数据导出的开发者
- 跨学区 IT 管理员进行多 portal 健康检查
使用风险
凭证泄露风险:环境变量或 .env 文件若权限配置不当,可能导致家长账号密码泄露;建议在主机 secret store 或临时内存中管理。
会话劫持风险:cookie jar 文件在 /tmp 等路径可能面临权限竞争,建议设置严格文件权限并在使用后清理。
API 变更风险:IC 无公开 API 文档,端点基于逆向工程,未来版本升级可能导致 404 或响应结构变化。
速率限制风险:高频请求可能触发学区门户的防护机制,建议增加请求间隔或实现退避策略。
合规与隐私风险:学生教育数据受 FERPA 等法规保护,自动化采集需确保授权范围合规,避免未授权数据留存。
技能正文
name: infinitecampus-api
description: >-
Query an Infinite Campus (Campus Parent portal) district directly with curl
instead of running the infinitecampus-mcp server — log in with a real
username/password, capture the session cookie + XSRF token, and curl grades,
attendance, assignments, schedule, messages, documents, and fees. Use when
you want IC data without the MCP, in a script, or on a machine where the MCP
isn't installed. Infinite Campus is per-district: the base URL and district
app name are configurable, not hardcoded.
Infinite Campus via curl (no MCP)
Infinite Campus's Campus Parent portal is a classic server-rendered site
(no public API, no bot wall). A plain form POST to verify.jsp logs a
parent in and hands back a session cookie — no browser bridge needed. This
is the same login infinitecampus-mcp's src/client.ts/src/auth.ts do;
this skill reproduces it with curl + a cookie jar.
Infinite Campus is per-district. Every parent's portal lives at their
own district's host (https://campus.<district>.k12.example.us or similar)
under an appName path segment. There is no shared IC endpoint — carry the
base URL and district from the same config the MCP uses:
: "${IC_BASE_URL:?set to your district's portal URL, e.g. https://campus.yourdistrict.org}"
: "${IC_DISTRICT:?set to the appName path segment, e.g. yourdistrict}"
: "${IC_USERNAME:?parent portal username}"
: "${IC_PASSWORD:?parent portal password}"
(Same 4 env vars the MCP reads — reuse the repo's .env or the host's
secret store; don't hardcode a district.)
One-time setup
None — curl and jq are the only tools needed (brew install jq if
missing). No profile/pairing step, no extension.
Login (capture cookies + XSRF token)
verify.jsp accepts a urlencoded form POST and returns 200 with an
<AUTHENTICATION>state</AUTHENTICATION> marker in the body — not
via HTTP status — plus ~20 Set-Cookie headers. Use a cookie jar so curl
does the Set-Cookie parsing/deduping for you:
JAR=$(mktemp)
BODY=$(curl -sS -c "$JAR" \
"$IC_BASE_URL/campus/verify.jsp?nonBrowser=true" \
--data-urlencode "username=$IC_USERNAME" \
--data-urlencode "password=$IC_PASSWORD" \
--data-urlencode "appName=$IC_DISTRICT" \
--data-urlencode "portalLoginPage=parents")
echo "$BODY" | grep -o '<AUTHENTICATION>[^<]*' # AUTHENTICATIONsuccess = good
password-error / account-locked / any non-success state means the
login failed — check that string before doing anything else. Credentials
go in the form body (never the query string — it lands in access logs).
Pull the XSRF token out of the jar (IC's JS reads it back and echoes it on
every request as X-XSRF-TOKEN; JSESSIONID alone is not enough):
XSRF=$(awk -F'\t' '$6=="XSRF-TOKEN"{print $7}' "$JAR")
Core call pattern
Every subsequent request rides the jar + the XSRF header:
ic_get() { # ic_get <path-with-query>
curl -sS -b "$JAR" -H "X-XSRF-TOKEN: $XSRF" -H 'Accept: application/json' \
"$IC_BASE_URL$1"
}
ic_get '/campus/api/portal/students' | jq .
A 401 means the session expired (IC sessions last ~5-6h) — re-run the
Login step to get a fresh $JAR/$XSRF and retry once. There is no retry
budget beyond that in this shell version (the MCP's CookieSessionManager
does this automatically; here just redo the login block).
The one rule: resolve student + enrollment first
Almost every read is scoped to a personID (student), and several need the
student's enrollment (enrollmentID / calendarID / structureID).
Always start with:
ic_get '/campus/api/portal/students' | jq '.[] | {personID, firstName, lastName, enrollments}'
Take personID for studentId/personID params, and the first (or
relevant) enrollments[] entry's enrollmentID/calendarID/structureID
for the endpoints that need them (attendance, school days, assessments,
features). There is no name→id search — ic_list_students (i.e. this call)
is the resolve step.
Endpoints
All 17 read endpoints (grades, attendance, assignments, schedule, messages,
documents, fees, teachers, assessments, feature flags) with ready-to-run
curl+jq recipes are in references/endpoints.md. Two (behavior,
food_service) have real paths that were never confirmed live against a
district with that module enabled — try them, expect a 404 if the module
is off or the district's shape differs.
Downloads
ic_download_document's url field (from the documents list) may be a
relative /campus/... path or an absolute URL. Same jar + header pattern,
just write to a file instead of piping to jq:
curl -sS -b "$JAR" -H "X-XSRF-TOKEN: $XSRF" -o report-card.pdf "$IC_BASE_URL$DOC_URL"
FeatureDisabled districts
Some districts turn whole modules off (behavior, food service, assessments,
documents, attendance). The MCP checks displayOptions first and falls
back to treating a 404 as "disabled." Doing the same by hand: fetch
/campus/api/portal/displayOptions/{structureID}?personID=X (see
references) and check the flag before assuming a 404 is a bug.
Notes
- Read-only in practice: every recipe here is a GET.
ic_get_message
fetching a message body may mark it read on some district configs — the
MCP's own probe couldn't confirm the side effect either way.
- No CUPS linked-district switching in this skill (a parent with kids in
2+ IC instances under shared SSO) — that's a multi-step token-exchange
flow (
src/client.ts's discoverLinkedDistricts); out of scope here.
Run the login flow again against the linked district's own
IC_BASE_URL/IC_DISTRICT if you need it.
- This project is developed and maintained by AI (Claude).
ic_get_message
fetching a message body may mark it read on some district configs — the
MCP's own probe couldn't confirm the side effect either way.src/client.ts's discoverLinkedDistricts); out of scope here.
Run the login flow again against the linked district's own
IC_BASE_URL/IC_DISTRICT if you need it.正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。