Pensum
Provides read-only tools for accessing Canvas LMS data, including courses, assignments, upcoming work, planner items, priority dashboards, grades and grade breakdowns, assignment details, syllabi, announcements, modules, course files, and instructor contact information.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Pensum: The Canvas connector for AI
pensum (Latin): the day's assigned work.
Pensum is a Canvas LMS MCP server: self-hosted, remote, and it works with any Canvas school. Deploy it once and use it from Claude on the web, the desktop app and your phone as a custom connector. Most Canvas MCP servers run locally, on one computer, inside one desktop app. This one runs on a host you control and answers over HTTPS, so every Claude client you use can reach it.
Single user. One deployment serves one Canvas account: yours.
Read-only toward Canvas. It never writes to Canvas. Its one write tool,
profile_save, saves your own course profile to your own storage.Any school. Set
CANVAS_DOMAINto your school's Canvas hostname. There are no school defaults.Two skills (
canvas-setup,canvas-due) that turn the tools into a reliable "what's due today" check.
Also runs locally over stdio if that's all you need.
Companion project: Excerpta, a page-accurate book indexer and MCP server for PDF books and McGraw-Hill e-textbooks you own. Pensum works without it; when both connectors are present, canvas-setup links the textbooks named in your syllabi to Excerpta's book ids.
Contents
Related MCP server: Canvas MCP Server
Tools
Canvas tools (always available, all read-only):
Tool | What it does |
| Checks the token, shows the account, and reports the timezone the server uses for dates. Run it first. |
| Your courses, optionally for one term. Returns the course ids other tools take. |
| Assignments for one course, with your submission status and discussion checkpoints. |
| Everything due from now through N days ahead, across all active courses. |
| Your Canvas planner (To Do) for a range of local days: assignments, quizzes, discussions and their checkpoints, pages with to-do dates, calendar events, peer reviews, planner notes. |
| Pending work across courses, ranked by urgency. |
| Current score and letter grade per course. |
| A course grade split by assignment group, weighted only if the course is. |
| One assignment's full description, rubric, checkpoints and submission state. |
| A course syllabus as plain text. |
| Recent instructor announcements. |
| A course's modules and items, with completion state. |
| Files posted in a course, optionally filtered by name. |
| Teacher and TA contact details for a course. |
Profile tools (always registered, so profile_get can report when no storage is set up):
Tool | What it does |
| Reads your saved course profile. Reports |
| Saves (replaces) your course profile. The only write tool. Keeps the previous 5 versions and returns a diff. |
Dated responses include timezone, timezone_source (env, canvas or fallback) and today_local, so clients without a clock still get the right day.
Quick start
1. Get a Canvas token
In Canvas: Account > Settings > Approved Integrations > + New Access Token. Copy it. Canvas shows it only once.
Check your school's policy on personal access tokens. Some schools restrict them or set an expiry. When a token expires or you revoke it, make a new one and update
CANVAS_API_TOKEN.
The token can do anything your Canvas account can do. This server only reads with it, but guard it like a password.
2. Configure
cp .env.example .env
openssl rand -hex 32 # paste the output into MCP_AUTH_TOKENFill in the three required values:
Variable | Value |
| The token from step 1 |
| Your school's Canvas hostname, e.g. |
| A random secret of at least 24 characters. Every client must present it. |
Everything else is optional. See Configuration reference.
3. Deploy
The server needs a public HTTPS URL for Claude on the web and phone to reach it.
Railway (the repo includes railway.json):
Fork this repo and create a Railway project from your fork. Railway builds the
Dockerfileand health-checks/health.Under Variables, add
CANVAS_API_TOKEN,CANVAS_DOMAIN,MCP_AUTH_TOKENand, for claude.ai,AUTH_IN_PATH=true(why). Railway setsPORTitself.Under Networking, generate a domain. Your MCP URL is
https://<your-domain>/mcp.For profile storage without Supabase, see Profile storage.
Docker (any host that runs containers):
docker build -t pensum .
docker volume create pensum-data
docker run -d --name pensum -p 3000:3000 --env-file .env \
-e PROFILE_PATH=/data/profile.json -v pensum-data:/data pensum
curl http://localhost:3000/health # {"ok":true}Put it behind HTTPS (a reverse proxy or tunnel) before you connect a remote client. If more than one proxy sits in front of it, set TRUST_PROXY to the number of hops.
4. Connect Claude
claude.ai (web, desktop app and mobile). Add a custom connector in Claude's connector settings (available on plans that support custom connectors). Many accounts can't attach a custom header to a connector, so set AUTH_IN_PATH=true on the server and use this URL:
https://<your-domain>/mcp/<MCP_AUTH_TOKEN>Name the connector Canvas; the skills refer to "the Canvas connector". Connectors you add on claude.ai are also available in Claude's desktop and mobile apps.
Claude Code (header auth, no AUTH_IN_PATH needed):
claude mcp add --transport http canvas https://<your-domain>/mcp \
--header "Authorization: Bearer <MCP_AUTH_TOKEN>"Other MCP clients that can set headers (Cursor, VS Code with GitHub Copilot, Gemini CLI and others): URL https://<your-domain>/mcp, header Authorization: Bearer <MCP_AUTH_TOKEN>.
ChatGPT (Developer Mode; not tested yet). ChatGPT can't send a custom header, so set AUTH_IN_PATH=true on the server, create a connector with authentication set to No auth, and use https://<your-domain>/mcp/<MCP_AUTH_TOKEN> as its URL. The skills are written for Claude, so in ChatGPT you get the tools without them.
Local only (stdio). No server, no MCP_AUTH_TOKEN. Build once (npm ci && npm run build), then point a desktop client at it:
{
"mcpServers": {
"canvas": {
"command": "node",
"args": ["/absolute/path/to/pensum/dist/index.js"],
"env": {
"TRANSPORT": "stdio",
"CANVAS_API_TOKEN": "replace_me",
"CANVAS_DOMAIN": "your-school.instructure.com"
}
}
}
}5. Check it
Ask Claude: "Use the Canvas connector's canvas_whoami tool." You should see your name and a timezone. If timezone_source is fallback, set TIMEZONE (for example America/New_York).
Then install the skills and run canvas-setup once.
Authentication: header or URL path
The MCP endpoint is public, so the token is what keeps it private. There are two ways to send it:
Bearer header (always on) | Token in path ( | |
URL |
|
|
Sent as |
| part of the URL |
Works with | Claude Code, most MCP clients | claude.ai and ChatGPT connectors that can't set headers |
Risk | Header rarely ends up anywhere visible | URLs leak more easily: screenshots, shared settings, browser history, proxy logs |
Both use a constant-time comparison. The server redacts the token from its own log lines. The bearer header keeps working when AUTH_IN_PATH is on. With AUTH_IN_PATH=true the token must be URL-safe (letters, digits, ., _, ~, -); openssl rand -hex 32 output is.
If the token leaks, rotate it: generate a new MCP_AUTH_TOKEN, redeploy, and update every connector. OAuth is not supported in this version.
After 10 failed auth attempts from one IP within 10 minutes, that IP gets 429 for 10 minutes. A request with the correct token is never blocked.
Profile storage
The canvas-setup skill learns rules a plain due-date list gets wrong (weekly rhythms, discussion checkpoints, undated deadlines, external tools that auto-zero at the deadline) and saves them as your profile. The server stores it in the first of these that is configured:
Storage | Set | Notes |
|
| Survives redeploys. Keeps 5 previous versions. |
|
| A JSON file with the current profile and 5 previous versions, written atomically. |
| nothing |
|
A container's filesystem is wiped on every redeploy. For file storage on a host, mount a persistent volume at /data and set PROFILE_PATH=/data/profile.json. The image creates /data owned by its non-root user (UID/GID 10001).
Docker: a named volume (
-v pensum-data:/data, as above) picks up that ownership. For a bind mount, make the host folder writable by UID 10001 (sudo chown 10001:10001 <folder>).Railway: add a volume with mount path
/data. Railway mounts volumes as root, so per Railway's volume docs a non-root image needs Railway's ownRAILWAY_RUN_UID=0variable to write there. That runs the container as root. If you'd rather not, use Supabase storage instead.
Textbooks: Excerpta
Pensum has no textbook tools. Book lookup lives in a separate project, Excerpta: you index PDF books and McGraw-Hill e-textbooks you have the right to use into your own Supabase project, and its MCP server returns exercises, pages and passages with printed page numbers.
The two are independent. If Excerpta is also connected, canvas-setup matches textbooks named in a syllabus to Excerpta's book ids and records them in your profile (courses[].textbooks). If it isn't, the titles are still recorded and the skill mentions Excerpta once.
Skills
The skills/ folder holds two skills that use the connector. Details in skills/README.md.
Skill | Use it for | In Claude Code | On claude.ai |
| Build your course profile at the start of each term, after add/drop, or to repair a missed item |
|
|
| Everything still to do on a day (default today), with early warnings |
|
|
Claude Code: this repo is also a plugin marketplace.
/plugin marketplace add LukePAndersen/pensum
/plugin install pensum@pensumOn recent Claude Code versions, one step also works: /plugin install pensum --marketplace LukePAndersen/pensum. Plugin skills are namespaced, so you run them as /pensum:canvas-due and so on, or just ask ("what's due tomorrow?").
claude.ai: zip one skill folder (for example cd skills && zip -r canvas-due.zip canvas-due) and upload the skill folder as a zip in Claude's skill settings. Repeat for each skill. Uploaded skills keep their plain names (canvas-due) and are picked up when you ask in plain words.
The plugin contains skills only. It does not configure the connector, because the URL and token are yours; add the connector as in step 4.
Configuration reference
Variable | Required | Default | Meaning |
| yes | Canvas personal access token | |
| yes | Canvas hostname, e.g. | |
| when | Client secret, at least 24 characters | |
| no |
|
|
| no |
| Listen port; most hosts set it |
| no |
| Also accept |
| no |
| Reverse-proxy hops in front of the server, used to find the client IP for the rate limit. |
| no | Canvas profile time zone, else | IANA zone used to bucket every date |
| no | none | Comma-separated term names whose courses are hidden. Hidden courses are listed in |
| no | Profile file path when Supabase is not configured, e.g. | |
| no |
| |
| with | Service-role JWT or |
A bad or missing value stops the server at startup with a message naming each variable to fix.
Local development
Node 22 or newer.
npm ci
npm run build
npm test # builds, then runs test/*.test.mjs (no network)
node --env-file=.env dist/index.js # HTTP server on PORT
npm run stdio # stdio transport (CANVAS_* must be in the environment)Routes: GET /health returns {"ok":true} and nothing else. POST /mcp is the Streamable HTTP endpoint (stateless, JSON responses); GET and DELETE on it return 405. With AUTH_IN_PATH=true, the same routes also exist at /mcp/<MCP_AUTH_TOKEN>.
Security
Short version: one deployment is one person's Canvas data, and anyone with MCP_AUTH_TOKEN can read your courses and grades through it. Keep the token, the Canvas token and the Supabase key out of git and chats, rotate them if they leak, and prefer the header over the URL path when your client allows it. Read SECURITY.md for the threat model and how to report a vulnerability.
License and trademarks
MIT. See LICENSE.
Not affiliated with Instructure. Canvas is a trademark of Instructure, Inc.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Connect AI assistants to Edusign attendance, courses, learners, documents, and API docs via OAuth.
Manage your Canvas coursework with quick access to courses, assignments, and grades. Track upcomin…
Study from your own classes: synced Canvas coursework, notes, flashcards and study progress.
Design and edit Bloom canvases from AI coding agents with browser OAuth.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI systems to interact with Canvas Learning Management System data, allowing users to access courses, assignments, quizzes, planner items, files, and syllabi through natural language queries.2241 PyPI7MIT
- AlicenseBqualityCmaintenanceEnables AI assistants to manage Canvas LMS courses, announcements, rubrics, assignments, modules, pages, and student data via the Canvas API.6065 npm12MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to access Canvas LMS course content, including assignments, modules, announcements, and files, to help students manage their coursework.ISC
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to access Canvas LMS academic data such as courses, assignments, grades, and events via MCP tools.-