Canvas LMS

Links AI tools to Canvas school dashboards.

Canvas API MCP Server

Connect Claude to your Canvas LMS. Ask natural questions like "What assignments do I have due this week?" or "What's my current grade in Biology?" and get real answers pulled directly from your Canvas account.

Works with Claude Desktop and Claude Code (the CLI).


Quick Install

Requires: Node.js 18+, Git, and a Canvas personal access token (how to get one)

git clone https://github.com/Kdude43ver/Canvas-API-MCP.git
cd Canvas-API-MCP
bash install.sh

The install script will:

  • Install dependencies and build the project
  • Ask for your Canvas URL and API token
  • Add the server to Claude Code and/or Claude Desktop automatically

Manual Setup

1. Get your Canvas API token

  1. Log into your Canvas instance (e.g. https://yourschool.instructure.com)
  2. Click your profile picture → AccountSettings
  3. Scroll down to Approved Integrations
  4. Click + New Access Token
  5. Name it (e.g. Claude MCP) and click Generate Token
  6. Copy the token now — Canvas will never show it again

2. Clone and build

git clone https://github.com/Kdude43ver/Canvas-API-MCP.git
cd Canvas-API-MCP
npm install
npm run build

3. Create your .env file

cp .env.example .env

Edit .env:

CANVAS_TOKEN=your_token_here
CANVAS_BASE_URL=https://yourschool.instructure.com

4. Add to Claude Code

claude mcp add canvas \
  -e CANVAS_TOKEN=your_token_here \
  -e CANVAS_BASE_URL=https://yourschool.instructure.com \
  -- node /absolute/path/to/Canvas-API-MCP/dist/index.js

Replace /absolute/path/to/Canvas-API-MCP with the actual path (run pwd inside the repo to get it).

5. Add to Claude Desktop

Edit ~/.config/claude/claude_desktop_config.json on Linux/Mac, or %APPDATA%\Claude\claude_desktop_config.json on Windows. Create the file if it doesn't exist.

{
  "mcpServers": {
    "canvas": {
      "command": "node",
      "args": ["/absolute/path/to/Canvas-API-MCP/dist/index.js"],
      "env": {
        "CANVAS_TOKEN": "your_token_here",
        "CANVAS_BASE_URL": "https://yourschool.instructure.com"
      }
    }
  }
}

Restart Claude Desktop after saving. You should see a hammer icon in the chat interface indicating tools are available.


Available Tools

ToolWhat it does
list_coursesList all your active courses
get_courseFull details for a course (including syllabus)
list_assignmentsAll assignments for a course with due dates and point values
get_assignmentFull assignment details including description
list_upcoming_assignmentsAssignments due in the next N days across all your courses
get_gradesYour current and final grade for a course
list_submissionsSubmission status for every assignment in a course
list_announcementsRecent announcements for a course
list_discussionsDiscussion topics for a course
list_calendar_eventsUpcoming events and due dates in a date range
list_filesFiles available in a course with download links

Example Prompts

Once installed, try asking Claude:

  • "What assignments do I have due in the next 3 days?"
  • "List all my courses this semester."
  • "What's my current grade in each class?"
  • "Are there any announcements in my CS class?"
  • "Show me the discussion topics for course 12345."
  • "What files are available in my Biology course?"
  • "What's on my calendar this week?"

Verifying It Works (MCP Inspector)

Before adding to Claude, you can test the server directly:

npx @modelcontextprotocol/inspector node dist/index.js

Set CANVAS_TOKEN and CANVAS_BASE_URL in the Environment Variables section of the inspector, then call list_courses to confirm you get real data back.


Troubleshooting

"No courses found" or empty results

  • Double-check your CANVAS_BASE_URL — it should be your school's Canvas URL, not canvas.instructure.com
  • Make sure your token was copied correctly (no extra spaces)
  • Try generating a fresh token

Claude Desktop doesn't show Canvas tools

  • Confirm the path in claude_desktop_config.json is the absolute path to dist/index.js
  • Make sure you ran npm run build and that dist/index.js exists
  • Restart Claude Desktop fully (quit from the system tray, not just close the window)

Claude Code can't find the server

  • Run claude mcp list to see registered servers
  • Run claude mcp remove canvas then re-add it if something looks wrong

403 errors from Canvas

  • Your token may have expired — generate a new one in Canvas Settings
  • Some Canvas instances restrict API access; contact your school's IT department

Security

  • Your Canvas token is stored only in your local .env file (which is git-ignored) and/or your local Claude config files
  • The token gives read access to everything your Canvas account can see — treat it like a password
  • To revoke access: go to Canvas → Account → Settings → Approved Integrations → delete the token
  • Never share your .env file or commit it to version control

Development

# Install deps
npm install

# Build (uses esbuild, outputs to dist/)
npm run build

# Run directly (requires .env file)
node dist/index.js

# Dev mode with ts-node
npm run dev

The source is organized as:

src/
├── index.ts          # Entry point — loads env, starts server
├── server.ts         # McpServer setup, registers all tools
├── canvas-client.ts  # Axios wrapper: auth headers, pagination, rate-limit backoff
└── tools/
    ├── courses.ts        # list_courses, get_course
    ├── assignments.ts    # list_assignments, get_assignment, list_upcoming_assignments
    ├── grades.ts         # get_grades, list_submissions
    ├── announcements.ts  # list_announcements
    ├── discussions.ts    # list_discussions
    ├── calendar.ts       # list_calendar_events
    └── files.ts          # list_files

Похожие серверы