Skip to content

Repository files navigation

canvas-mcp-tool

Study more, work less badge

npm version npm downloads GitHub last commit GitHub issues


Leverage natural language badge on Canvas badge to quickly scan through your courses, find assignments and related content & stay up to date with your academics.

📋 Available Tools
  • list_assignments - List assignments for a course
  • get_assignment - Get assignment details
  • list_courses - List your enrolled courses
  • get_course - Get details about a specific course
  • get_profile - Get your user profile
  • list_users - List users in a course
  • get_dashboard_cards - Get your dashboard cards
  • list_calendar_events - List calendar events
  • get_file_metadata - Get information about a Canvas file
  • get_file_content - Extract text content from Canvas files (DOCX, TXT, and more)
Claude Code

Claude Desktop

{
  "mcpServers": {
    "canvas": {
      "command": "npx",
      "args": ["-y", "canvas-mcp-tool"],
      "env": {
        "CANVAS_API_URL": "https://your-schools-canvas-url.com",
        "CANVAS_API_TOKEN": "your_token_here",
        "CANVAS_API_VERSION": "v1",
        "CANVAS_API_TIMEOUT": "30000",
        "CANVAS_MAX_RETRIES": "3"
      }
    }
  }
}

Claude Code (Recommended)

# Simple usage (if env vars are already set in your shell):
claude mcp add canvas -- npx -y canvas-mcp-tool
# Or inline specify all required and optional variables:
CANVAS_API_URL="https://your-schools-canvas-url.com" \
CANVAS_API_TOKEN="your_canvas_api_token_here" \
CANVAS_API_VERSION="v1" \
CANVAS_API_TIMEOUT=30000 \
CANVAS_MAX_RETRIES=3 \
claude mcp add canvas -- npx -y canvas-mcp-tool

Gemini CLI

Add to your ~/.gemini/settings.json:

{
  "mcpServers": {
    "canvas": {
      "command": "npx",
      "args": ["-y", "canvas-mcp-tool"],
      "env": {
        "CANVAS_API_URL": "https://your-schools-canvas-url.com",
        "CANVAS_API_TOKEN": "your_token_here",
        "CANVAS_API_VERSION": "v1",
        "CANVAS_API_TIMEOUT": "30000",
        "CANVAS_MAX_RETRIES": "3"
      }
    }
  }
}

Note: Gemini CLI requires all environment variables to be explicitly defined in the configuration.

Configuration

After installation, you'll need to configure your Canvas URL and API token:

Getting a Canvas API Token

Warning: Your Canvas API token is sensitive - treat it like a password and never share it or commit it to source control.

  1. Log into your Canvas account
  2. Go to Account → Settings
  3. Scroll to "Approved Integrations"
  4. Click "+ New Access Token"
  5. Enter a purpose and click "Generate Token"
  6. Copy the token and use in it your preferred setup.

For Claude Desktop

You can add these to your shell profile (~/.zshrc, ~/.bashrc, etc.) so they're loaded automatically:

# ~/.zshrc or ~/.bashrc
export CANVAS_API_URL="https://your-schools-canvas-url.com"
export CANVAS_API_TOKEN="your_canvas_api_token_here"
export CANVAS_API_VERSION="v1"
export CANVAS_API_TIMEOUT=30000
export CANVAS_MAX_RETRIES=3

Local Setup

  1. Clone this repository

  2. Install dependencies:

    npm install
  3. Create a .env file with your Canvas credentials:

    cp .env.example .env
  4. Edit .env and add your Canvas API token:

    CANVAS_API_URL=https://your-schools-canvas-url.com
    CANVAS_API_TOKEN=your_canvas_api_token_here
    

    Add optional cache and logging settings (defaults shown):

    CACHE_ENABLED=true          # Enable response caching (set to false to disable)
    CACHE_TTL=300               # Cache time-to-live in seconds
    LOG_LEVEL=info              # Logging level: debug, info, warn, error
    LOGGING_ENABLED=true        # Enable logging (set to false to disable)
    

Build

npm run build

About

No description, website, or topics provided.

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages