What to use
Option A: Direct HTTP fetch (quickest)
Use the bundled fetch helper to pull JSON from OSU Content APIs.
-
node ohio-state-api/scripts/osu-fetch.mjs https://content.osu.edu/v2/api/v1/dining/locations
- - Fetch by service + path:
- INLINECODE1
Note: --path can be passed with or without a leading / (both work).
If the response is large, add --extract <dot.path> (e.g. --extract data) to print only a subtree.
Option A2: curl (no Node required)
If you just want raw JSON and have curl available, reference ohio-state-api/references/OSU_API.md:
-
curl -sS -H 'accept: application/json' 'https://content.osu.edu/v2/api/v1/dining/locations'
- INLINECODE9
Optional: pipe to jq for readability:
Option B: MCP server (best for MCP-compatible clients)
This skill bundles the original MCP server under ohio-state-api/mcp-server/.
Build it:
Then configure your MCP client to run:
- - command: INLINECODE14
- args: INLINECODE15
After it’s running, use tools like:
- -
get_bus_routes, INLINECODE17 - INLINECODE18 ,
search_buildings, INLINECODE20 - INLINECODE21 , INLINECODE22
- INLINECODE23 , INLINECODE24
- INLINECODE25
- INLINECODE26
(See ohio-state-api/mcp-server/README.md and the tool definitions in ohio-state-api/mcp-server/src/ for the full list.)
Recommended workflow for “get OSU data” requests
- 1. Identify the service area (dining, bus, buildings, events, etc.).
- Prefer a list/search endpoint first, then follow IDs into detail endpoints.
- For time-based data, always include both:
- the query window (absolute dates/times), and
- the retrieval timestamp.
- 4. When returning data to a user, summarize key fields and attach the raw JSON as an artifact when possible.
Common base URLs (public)
These are used by the bundled MCP server and work with osu-fetch.mjs:
- - Athletics: INLINECODE30
- Bus: INLINECODE31
- Buildings: INLINECODE32
- Calendar: INLINECODE33
- Classes: INLINECODE34
- Dining: INLINECODE35
- Directory: INLINECODE36
- Events: INLINECODE37
- Food trucks: INLINECODE38
- Library: INLINECODE39
- Merchants: INLINECODE40
- Parking: INLINECODE41
- Rec sports: INLINECODE42
- Student orgs: INLINECODE43
Examples (copy/paste)
-
curl -sS -H 'accept: application/json' 'https://content.osu.edu/v2/api/v1/dining/locations'
-
curl -sS -H 'accept: application/json' 'https://content.osu.edu/v2/parking/garages/availability'
- - Buildings “search” (filter client-side with
jq):
- INLINECODE47
Extra reference
- - API reference: INLINECODE48
使用方法
选项A:直接HTTP获取(最快)
使用内置的fetch助手从OSU内容API拉取JSON数据。
- node ohio-state-api/scripts/osu-fetch.mjs https://content.osu.edu/v2/api/v1/dining/locations
- node ohio-state-api/scripts/osu-fetch.mjs --service dining --path /locations
注意:--path参数可以带或不带前导/(两种方式均可)。
如果响应数据较大,可添加--extract <点路径>(例如--extract data)仅打印子树。
选项A2:curl(无需Node)
如果只需要原始JSON且已安装curl,可参考ohio-state-api/references/OSU_API.md:
- curl -sS -H accept: application/json https://content.osu.edu/v2/api/v1/dining/locations
- curl -sS -H accept: application/json https://content.osu.edu/v2/classes/search?q=cse&p=1
可选:通过管道传递给jq以提高可读性:
- - curl -sS -H accept: application/json https://content.osu.edu/v2/api/v1/dining/locations | jq .
选项B:MCP服务器(最适合MCP兼容客户端)
本技能将原始MCP服务器打包在ohio-state-api/mcp-server/目录下。
构建方法:
- - cd ohio-state-api/mcp-server && npm install && npm run build
然后配置MCP客户端运行:
- - 命令:node
- 参数:[/ABSOLUTE/PATH/TO/ohio-state-api/mcp-server/build/index.js]
运行后,可使用以下工具:
- - getbusroutes、getbusvehicles
- getbuildings、searchbuildings、getbuildingdetails
- getdininglocations、getdiningmenu
- getcampusevents、geteventsbydaterange
- searchclasses
- getparking_availability
(完整列表请参见ohio-state-api/mcp-server/README.md及ohio-state-api/mcp-server/src/中的工具定义。)
获取OSU数据请求的推荐工作流程
- 1. 确定服务领域(餐饮、公交、建筑、活动等)。
- 优先使用列表/搜索端点,然后通过ID进入详情端点。
- 对于基于时间的数据,始终包含:
- 查询窗口(绝对日期/时间),以及
- 检索时间戳。
- 4. 向用户返回数据时,总结关键字段,并尽可能附上原始JSON作为附件。
常用基础URL(公开)
以下URL由内置MCP服务器使用,并可与osu-fetch.mjs配合使用:
- - 体育:https://content.osu.edu/v3/athletics
- 公交:https://content.osu.edu/v2/bus
- 建筑:https://content.osu.edu/v2/api
- 日历:https://content.osu.edu/v2/calendar
- 课程:https://content.osu.edu/v2/classes
- 餐饮:https://content.osu.edu/v2/api/v1/dining
- 目录:https://content.osu.edu
- 活动:https://content.osu.edu/v2
- 餐车:https://content.osu.edu/v2/foodtruck
- 图书馆:https://content.osu.edu/v2/library
- 商户:https://content.osu.edu/v2
- 停车:https://content.osu.edu/v2/parking/garages
- 休闲体育:https://content.osu.edu/v3
- 学生组织:https://content.osu.edu/v2/student-org
示例(可复制粘贴)
- curl -sS -H accept: application/json https://content.osu.edu/v2/api/v1/dining/locations
- curl -sS -H accept: application/json https://content.osu.edu/v2/parking/garages/availability
- curl -sS -H accept: application/json https://content.osu.edu/v2/api/buildings | jq -r .data.buildings[] | select((.name // ) | test(union;i)) | \(.buildingNumber)\t\(.name)
额外参考
- - API参考文档:ohio-state-api/references/OSU_API.md