v1.0.7 - File Upload Support
What's New
File Upload Tool 📁
New upload_course_file tool enables uploading files from the local filesystem to Canvas courses.
Features
- Canvas 3-step upload protocol - Handles the complete upload flow transparently
- Comprehensive validation - File existence, readability, size limits (100MB), extension whitelist
- MIME type detection - Automatic content-type detection from file extension
- Filename sanitization - Cleans special characters for safe Canvas storage
- Security-first - Whitelist approach blocks potentially dangerous file types
Usage Example
# Upload a PDF to Canvas
upload_course_file("CS101", "/path/to/syllabus.pdf")
# → "✅ Uploaded! File ID: 12345, Name: syllabus.pdf"
# Then add to a module
add_module_item("CS101", module_id, "File", content_id=12345)
# Or attach to a message
send_conversation("CS101", ["student_id"], "Subject", "Body", attachment_ids=["12345"])Parameters
course_identifier- Course code or IDfile_path- Local filesystem path to uploadfolder_path(optional) - Canvas folder destinationdisplay_name(optional) - Override filename in Canvason_duplicate- "rename" (default) or "overwrite"
New Files
src/canvas_mcp/core/file_validation.py- Validation utilitiessrc/canvas_mcp/tools/files.py- Upload tool implementationtests/tools/test_files.py- 33 unit tests
Testing
- 33 new tests for file upload functionality
- 183 total tests passing
Full Changelog: v1.0.6...v1.0.7