Skip to main content
Glama
Canvas MCP Server

Canvas MCP Server

by cabrt

Canvas MCP Server

A read-only Model Context Protocol server that gives an AI assistant full structured access to a Canvas LMS account — courses, assignments, grades, deadlines, files, rubrics, and submission feedback.

Instead of opening Canvas and clicking through six courses to figure out what's due, you ask: "what's due this week and what am I behind on?" and get an answer grounded in live data.


The problem

Canvas holds everything a student needs, spread across a UI that requires a lot of navigation to answer simple cross-course questions. "What's due in the next two weeks?" means visiting every course individually. There's an API, but it's awkward in ways that make naive integrations break:

  • Array parameters require bracket notation (include[]=total_scores), silently ignored otherwise

  • Pagination is driven entirely by Link headers — page-number guessing skips and duplicates records

  • Rate limits are enforced by a leaky-bucket quota exposed in response headers

  • Every text field is HTML, not plain text — unusable in a model context without cleaning

  • Enrollments span all past semesters, so "my courses" needs term-aware filtering

This server absorbs that complexity and exposes 23 clean tools.

Related MCP server: Canvas LMS MCP Server

Design decisions

Two-phase loading. List endpoints return lightweight representations; full content is fetched on demand. Pulling every assignment description across six courses wastes an enormous amount of context for a question like "what's due Friday." List calls stay cheap, detail calls are explicit.

Link-header pagination. paginate() is an async generator that follows Link: rel="next" until exhausted or a caller-supplied limit is hit, yielding items individually so callers can stop early without over-fetching.

Rate-limit awareness, not just retry. The client reads X-Rate-Limit-Remaining and pre-emptively backs off when the quota drops below 50, in addition to exponential backoff on 429s. Reacting only to 429s means you've already been throttled.

Current-semester detection. _is_current_course() filters enrollments by term dates so tools operate on the active semester without the user passing IDs around.

HTML stripping at the boundary. Canvas returns HTML in every description, announcement, and discussion body. It's converted to plain text before reaching the model — script and style blocks removed, <br> mapped to newlines.

Singleton HTTP client. One httpx.AsyncClient with connection pooling for the process lifetime, rather than a new connection per tool call.

Read-only by design. No tool mutates Canvas state. An LLM cannot submit an assignment, post to a discussion, or alter a grade — the blast radius of a bad generation is zero.

Tools

Core — get_my_courses, get_todo, get_all_upcoming(days), get_all_grades

Course content — get_course, get_assignments, get_assignment, get_announcements, get_announcement, get_discussions, get_discussion, get_quizzes, get_quiz, get_calendar_events, get_rubrics, get_rubric

Files & modules — get_files, get_file, get_modules, get_module_items, get_page

Submissions — get_submission (includes instructor feedback and rubric assessment)

Aggregator — get_full_course_context (entire course in one call, for deep questions)

Setup

uv sync
cp .env.example .env    # then add your token

Generate a token at Canvas → Account → Settings → New Access Token.

CANVAS_TOKEN=your_canvas_api_token_here
CANVAS_BASE_URL=https://your-institution.instructure.com

Register with an MCP client (Claude Code shown):

claude mcp add canvas -- uv --directory /path/to/canvas-mcp run server.py

Stack

Python 3.11+ · mcp · httpx (async) · python-dotenv · typed dataclass models throughout

Notes

Your access token carries your full Canvas privileges. It lives in .env, which is gitignored — don't commit it, and revoke it from Canvas settings if it's ever exposed.

Built against the Canvas API as deployed by Northeastern University. Institutions can disable endpoints, so tool availability may vary.

Available Tools

23 tools
get_all_gradesA

Get grades for all active courses.

Returns: {"grades": [{course_id, course_name, current_score, current_grade}, ...], "count": N}

Inputs: no named parameters.

get_all_upcomingA

Get upcoming assignments across all active courses.

Args: days: How many days ahead to look (default 14)

Returns: {"assignments": [{id, name, due_at, course_name, ...}, ...], "count": N}

Inputs: days.

get_announcementA

Get a single announcement with full body.

Args: course_id: Canvas course ID announcement_id: Canvas announcement (discussion topic) ID

Returns: {id, title, message, posted_at, author, attachments}

Inputs: course_id (required), announcement_id (required).

get_announcementsB

Get announcements for a course (list view).

Args: course_id: Canvas course ID

Returns: {"announcements": [{id, title, posted_at, author}, ...], "count": N}

Inputs: course_id (required).

get_assignmentA

Get a single assignment with full description and attachments.

Args: course_id: Canvas course ID assignment_id: Canvas assignment ID

Returns: {id, name, description, due_at, points_possible, submission_types, attachments, ...}

Inputs: course_id (required), assignment_id (required).

get_assignmentsA

Get all assignments for a course.

Args: course_id: Canvas course ID

Returns: {"assignments": [{id, name, due_at, points_possible, ...}, ...], "count": N}

Inputs: course_id (required).

get_calendar_eventsC

Get calendar events for a course.

Args: course_id: Canvas course ID

Returns: {"events": [{id, title, start_at, end_at, description, ...}, ...], "count": N}

Inputs: course_id (required).

get_courseB

Get full course details including syllabus.

Args: course_id: Canvas course ID

Returns: {id, name, code, term, syllabus, description, start_at, end_at, ...}

Inputs: course_id (required).

get_discussionA

Get a single discussion topic with full message body.

Args: course_id: Canvas course ID discussion_id: Canvas discussion topic ID

Returns: {id, title, message, posted_at, author, attachments, ...}

Inputs: course_id (required), discussion_id (required).

get_discussionsC

Get all discussion topics for a course.

Args: course_id: Canvas course ID

Returns: {"discussions": [{id, title, posted_at, author, ...}, ...], "count": N}

Inputs: course_id (required).

get_fileB

Get file metadata and download URL.

Args: file_id: Canvas file ID

Returns: {id, display_name, size, content_type, url, created_at, updated_at}

Inputs: file_id (required).

get_filesA

List all files in a course.

Args: course_id: Canvas course ID

Returns: {"files": [{id, display_name, size, content_type, url}, ...], "count": N}

Inputs: course_id (required).

get_full_course_contextA

Get EVERYTHING for a course in one call: details, syllabus, assignments, announcements, discussions, modules, files, and grades.

Args: course_id: Canvas course ID

Returns: {course, assignments, announcements, discussions, modules, files, grades}

Inputs: course_id (required).

get_module_itemsB

Get items within a module.

Args: course_id: Canvas course ID module_id: Canvas module ID

Returns: {"items": [{id, title, type, content_id, html_url, ...}, ...], "count": N}

Inputs: course_id (required), module_id (required).

get_modulesA

Get module structure for a course.

Args: course_id: Canvas course ID

Returns: {"modules": [{id, name, position, items_count, state}, ...], "count": N}

Inputs: course_id (required).

get_my_coursesA

Get current semester courses (auto-detected as active).

Returns: {"courses": [{id, name, code, term}, ...], "count": N}

Inputs: no named parameters.

get_pageA

Get a wiki page's content with embedded file links.

Args: course_id: Canvas course ID page_url: Page URL slug (e.g., "syllabus" or "week-1-notes")

Returns: {title, body, created_at, updated_at}

Inputs: page_url (required), course_id (required).

get_quizA

Get a single quiz with full details.

Args: course_id: Canvas course ID quiz_id: Canvas quiz ID

Returns: {id, title, description, due_at, points_possible, time_limit, question_count, ...}

Inputs: quiz_id (required), course_id (required).

get_quizzesA

Get all quizzes for a course.

Args: course_id: Canvas course ID

Returns: {"quizzes": [{id, title, due_at, points_possible, time_limit, ...}, ...], "count": N}

Inputs: course_id (required).

get_rubricA

Get a single rubric with full criteria.

Args: course_id: Canvas course ID rubric_id: Canvas rubric ID

Returns: {id, title, points_possible, criteria: [{description, points, ratings}, ...]}

Inputs: course_id (required), rubric_id (required).

get_rubricsA

Get all rubrics for a course.

Args: course_id: Canvas course ID

Returns: {"rubrics": [{id, title, points_possible, ...}, ...], "count": N}

Inputs: course_id (required).

get_submissionB

Get your submission for an assignment, including feedback and comments.

Args: course_id: Canvas course ID assignment_id: Canvas assignment ID

Returns: {id, score, grade, submitted_at, workflow_state, comments, attachments, ...}

Inputs: course_id (required), assignment_id (required).

get_todoA

Get Canvas-computed todo items (assignments needing action).

Returns: {"items": [{type, assignment_name, course_id, due_at, ...}, ...], "count": N}

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 23 tools

    Disambiguation4/5

    Most tools target distinct Canvas entities, but there is slight overlap between get_all_upcoming, get_todo, and get_calendar_events, which all deal with upcoming items. However, descriptions help clarify their differences.

    Naming Consistency5/5

    All tools follow a consistent 'get_<entity>' pattern with singular/plural differentiation for single vs. list retrieval. The naming is predictable and uniform.

    Tool Count4/5

    With 23 tools, the count is slightly above the typical range but each tool addresses a specific Canvas feature. The inclusion of get_full_course_context may be redundant, but overall the scope is reasonable.

    Completeness2/5

    The tool set is entirely read-only, lacking any create, update, or delete operations. For a Canvas server, this is a major gap that prevents agents from performing essential actions like submitting assignments or posting announcements.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers