canvas-mcp

Canvas MCP Server

License: MIT

This repository contains a Model Context Protocol (MCP) server implementation for interacting with the Canvas Learning Management System API. The server is designed to work with Claude Desktop and other MCP-compatible clients.

Note: Recently refactored to a modular architecture for better maintainability. The legacy monolithic implementation has been archived.

Overview

The Canvas MCP Server bridges the gap between Claude Desktop and Canvas Learning Management System, providing both students and educators with an intelligent interface to their Canvas environment. Built on the Model Context Protocol (MCP), it enables natural language interactions with Canvas data.

For Students 👨‍🎓

Get AI-powered assistance with:

→ Get Started as a Student

For Educators 👨‍🏫

Enhance your teaching with:

→ Get Started as an Educator

đź”’ Privacy & Data Protection

For Educators: FERPA Compliance

Complete FERPA compliance through systematic data anonymization when working with student data:

All student data is anonymized before it reaches AI systems. See Educator Guide for configuration details.

For Students: Your Data Stays Private

Prerequisites

Supported MCP Clients

Canvas MCP works with any application that supports the Model Context Protocol. Popular options include:

Recommended:

AI Coding Assistants:

Development Platforms:

Enterprise:

See the official MCP clients list for more options.

Note: While Canvas MCP is designed to work with any MCP client, setup instructions in this guide focus on Claude Desktop. Configuration for other clients may vary.

Installation

1. Install Dependencies

# Install uv package manager (faster than pip)
pip install uv

# Install the package
uv pip install -e .

2. Configure Environment

# Copy environment template
cp env.template .env

# Edit with your Canvas credentials
# Required: CANVAS_API_TOKEN, CANVAS_API_URL

Get your Canvas API token from: Canvas → Account → Settings → New Access Token

Note for Students: Some educational institutions restrict API token creation for students. If you see an error like “There is a limit to the number of access tokens you can create” or cannot find the token creation option, contact your institution’s Canvas administrator or IT support department to request API access or assistance in creating a token.

3. Claude Desktop Setup

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "canvas-api": {
      "command": "canvas-mcp-server"
    }
  }
}

Verification

Test your setup:

# Test Canvas API connection
canvas-mcp-server --test

# View configuration
canvas-mcp-server --config

# Start server (for manual testing)
canvas-mcp-server

Available Tools

The Canvas MCP Server provides a comprehensive set of tools for interacting with the Canvas LMS API. These tools are organized into logical categories for better discoverability and maintainability.

Tool Categories

Student Tools (New!)

Shared Tools (Both Students & Educators)

  1. Course Tools - List and manage courses, get detailed information, generate summaries with syllabus content
  2. Discussion & Announcement Tools - Manage discussions, announcements, and replies
  3. Page & Content Tools - Access pages, modules, and course content

Educator Tools

  1. Assignment Tools - Handle assignments, submissions, and peer reviews with analytics
  2. Rubric Tools - Full CRUD operations for rubrics with validation, association management, and grading
  3. User & Enrollment Tools - Manage enrollments, users, and groups
  4. Analytics Tools - View student analytics, assignment statistics, and progress tracking
  5. Messaging Tools - Send messages and announcements to students

đź“– View Full Tool Documentation for detailed information about all available tools.

Usage with MCP Clients

This MCP server works seamlessly with any MCP-compatible client:

  1. Automatic Startup: MCP clients start the server when needed
  2. Tool Integration: Canvas tools appear in your AI assistant’s interface
  3. Natural Language: Interact naturally with prompts like:

Students:

Educators:

Project Structure

Modern Python package structure following 2025 best practices:

canvas-mcp/
├── pyproject.toml             # Modern Python project config
├── env.template              # Environment configuration template
├── src/
│   └── canvas_mcp/            # Main package
│       ├── __init__.py        # Package initialization
│       ├── server.py          # Main server entry point
│       ├── core/              # Core utilities
│       │   ├── config.py      # Configuration management
│       │   ├── client.py      # HTTP client
│       │   ├── cache.py       # Caching system
│       │   └── validation.py  # Input validation
│       ├── tools/             # MCP tool implementations
│       │   ├── courses.py     # Course management
│       │   ├── assignments.py # Assignment tools
│       │   ├── discussions.py # Discussion tools
│       │   ├── rubrics.py     # Rubric tools
│       │   └── other_tools.py # Misc tools
│       └── resources/         # MCP resources
└── docs/                     # Documentation

Documentation

Modern Architecture (2025)

Built with current Python ecosystem best practices:

Core Components

Dependencies

Modern Python packages (see pyproject.toml):

Performance Features

Development Tools

For contributors, see the Development Guide for detailed architecture and development reference.

Troubleshooting

If you encounter issues:

  1. Server Won’t Start - Verify your Configuration setup: .env file, virtual environment path, and dependencies
  2. Authentication Errors - Check your Canvas API token validity and permissions
  3. Connection Issues - Verify Canvas API URL correctness and network access
  4. Debugging - Check Claude Desktop console logs or run server manually for error output

Security & Privacy Features

API Security

Privacy Controls (Educators Only)

Educators working with student data can enable FERPA-compliant anonymization:

# In your .env file
ENABLE_DATA_ANONYMIZATION=true  # Anonymizes student names/emails before AI processing
ANONYMIZATION_DEBUG=true        # Debug anonymization (optional)

Students don’t need anonymization since they only access their own data.

For detailed privacy configuration, see:

Publishing to MCP Registry

This server is published to the Model Context Protocol Registry for easy installation.

Publishing is automated via GitHub Actions:

  1. Prepare a release:
    # Update version in pyproject.toml
    # Update CHANGELOG if applicable
    git commit -am "chore: bump version to X.Y.Z"
    git push
    
  2. Create and push a version tag:
    git tag vX.Y.Z
    git push origin vX.Y.Z
    
  3. Automated workflow:
    • Runs tests
    • Builds Python package
    • Publishes to PyPI
    • Publishes to MCP Registry using GitHub OIDC

Prerequisites for Publishing

Alternative: Use API token (legacy method - not recommended):

Manual Publishing (Alternative)

For manual publishing:

# Install MCP Publisher
curl -fsSL https://modelcontextprotocol.io/install.sh | sh

# Login using GitHub
mcp-publisher login github

# Publish server
mcp-publisher publish

Registry Validation

The server.json configuration is automatically validated against the MCP schema during CI/CD. To validate locally:

# Download schema
curl -s https://registry.modelcontextprotocol.io/v0/server.schema.json -o /tmp/mcp-schema.json

# Validate (requires jsonschema CLI)
pip install jsonschema
jsonschema -i server.json /tmp/mcp-schema.json

Contributing

Contributions are welcome! Feel free to:

License

This project is licensed under the MIT License - see the LICENSE file for details.


Created by Vishal Sachdev