Skip to main content
The canvas files subcommand group lets you list files in a course, download a file to local temporary storage, and browse the course folder hierarchy. All output is printed as pretty-printed JSON.

canvas files list

List files in a Canvas course.
canvas files list 12345
canvas files list 12345 --search "syllabus"
canvas files list 12345 --sort size --order desc
canvas files list 12345 --search "lecture" --limit 25
course_id
string
required
Canvas course ID.
Filter files by name. Case-insensitive substring match.
--sort
string
Sort key for the returned files. Passed directly to the Canvas API. Common values include name, size, created_at, and updated_at.
--order
string
Sort order: asc (ascending) or desc (descending). Has no effect without --sort.
--limit
number
default:"100"
Maximum number of files to return.

Examples

List all files, sorted by size descending:
canvas files list 12345 --sort size --order desc
Search for PDF files:
canvas files list 12345 --search ".pdf"

canvas files download

Download a course file to local temporary storage. The response includes the local path to the downloaded file.
canvas files download 12345 67890
canvas files download 12345 67890 --force-refresh
course_id
string
required
Canvas course ID.
file_id
string
required
Canvas file ID. Use canvas files list to find file IDs.
--force-refresh
boolean
default:"false"
Re-download the file even if a cached local copy already exists.
Files are saved to a local temporary directory managed by the MCP server. The JSON response includes the path to the downloaded file on disk.

Examples

Download a file (uses cached copy if available):
canvas files download 12345 67890
Force a fresh download, bypassing the local cache:
canvas files download 12345 67890 --force-refresh

canvas files folders

List the folder hierarchy for a Canvas course.
canvas files folders 12345
canvas files folders 12345 --limit 50
course_id
string
required
Canvas course ID.
--limit
number
default:"150"
Maximum number of folders to return.

Examples

List all folders in a course:
canvas files folders 12345
Limit the folder list to the top 20 folders:
canvas files folders 12345 --limit 20

Build docs developers (and LLMs) love