Canvas LMS Integration
Status: Production
Overview
Section titled βOverviewβCanvas LMS integration provides real-time academic data for the School domain: courses, assignments, grades, announcements. Data flows through an MCP server to multiple consumers (dashboard, alerts, RAG pipeline).
Data Flow
Section titled βData FlowβCanvas LMS API β βΌcanvas-lms MCP Server (6 tools) β ββββΊ canvas_sync.py β assignments JSON + grades YAML + courses YAML β ββββΊ grade_alerts.py β Telegram notifications on grade changes β ββββΊ deadline-watcher.sh β 48h deadline alerts via Telegram β ββββΊ morning-briefing.sh β Academic alerts in daily briefing β ββββΊ rag_ingest.py β ChromaDB vector storeMCP Server Tools
Section titled βMCP Server Toolsβ| Tool | Purpose |
|---|---|
| list_courses | All enrolled courses |
| list_assignments | Assignments for a course (with due dates, points) |
| get_assignment | Single assignment details |
| get_grades | Current grades per course |
| list_announcements | Recent course announcements |
| get_course_pages | Course content pages (wiki) |
Canvas Sync
Section titled βCanvas Syncβ- Cron: daily at 7 AM
- Pulls all assignments across enrolled courses
- Saves to local JSON cache
- 120s timeout via perl alarm wrapper
- Handles courses with disabled pages gracefully
Grade Tracking
Section titled βGrade Trackingβ- Per-course: current grade, letter, trend, alerts
- Critical threshold: C- or below triggers alert
- Grade change detection: compares current vs previous sync
- Telegram alert on any grade change
RAG Pipeline
Section titled βRAG PipelineβComponents
Section titled βComponentsβ- ChromaDB β vector store (persistent local storage)
- Ollama nomic-embed-text β embedding model (137M params, local, zero cost)
- lightning-whisper-mlx β audio transcription (Apple Silicon optimized)
Scripts
Section titled βScriptsβ| Script | Purpose |
|---|---|
| rag_ingest.py | 512-token recursive chunking, 100 overlap, ingest to ChromaDB |
| rag_query.py | CLI cross-course semantic search with distance ranking |
| canvas_to_rag.sh | Cron-ready Canvas pages to ChromaDB sync |
| transcribe.py | Whisper audio transcription with auto-ingest |
Performance
Section titled βPerformanceβ- 88 chunks ingested across 3 courses
- Query accuracy: 0.24 distance for relevant results
- 5 courses returned 404 on pages (Canvas pages disabled by instructor)