Canvas MCP Server
A local server that enables interaction with Canvas Learning Management System API through Claude Desktop, allowing users to manage courses, access assignments, view announcements, and retrieve course materials.
README Documentation
Canvas MCP Server
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:
- Tracking upcoming assignments and deadlines
- Monitoring your grades across all courses
- Managing peer review assignments
- Accessing course content and discussions
- Organizing your TODO list
For Educators 👨🏫
Enhance your teaching with:
- Assignment and grading management
- Student analytics and performance tracking
- Discussion and peer review facilitation
- FERPA-compliant student data handling
- Bulk messaging and communication tools
🔒 Privacy & Data Protection
For Educators: FERPA Compliance
Complete FERPA compliance through systematic data anonymization when working with student data:
- Source-level data anonymization converts real names to consistent anonymous IDs (Student_xxxxxxxx)
- Automatic email masking and PII filtering from discussion posts and submissions
- Local-only processing with configurable privacy controls (
ENABLE_DATA_ANONYMIZATION=true
) - FERPA-compliant analytics: Ask "Which students need support?" without exposing real identities
- De-anonymization mapping tool for faculty to correlate anonymous IDs with real students locally
All student data is anonymized before it reaches AI systems. See Educator Guide for configuration details.
For Students: Your Data Stays Private
- Your data only: Student tools access only your own Canvas data via Canvas API's "self" endpoints
- Local processing: Everything runs on your machine - no data sent to external servers
- No tracking: Your Canvas usage and AI interactions remain private
- No anonymization needed: Since you're only accessing your own data, there are no privacy concerns
Prerequisites
- Python 3.10+ - Required for modern features and type hints
- Canvas API Access - API token and institution URL
- MCP Client - Claude Desktop (recommended) or other MCP-compatible client
Supported MCP Clients
Canvas MCP works with any application that supports the Model Context Protocol. Popular options include:
Recommended:
- Claude Desktop - Official Anthropic desktop app with full MCP support
AI Coding Assistants:
- Zed - High-performance code editor with built-in MCP support
- Cursor - AI-first code editor
- Windsurf IDE (by Codeium) - AI-powered development environment
- Continue - Open-source AI code assistant
Development Platforms:
- Replit - Cloud-based coding platform with MCP integration
- Sourcegraph Cody - AI coding assistant with MCP support
Enterprise:
- Microsoft Copilot Studio - MCP support in enterprise environments
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.
Quick Start (Automated Installation)
The fastest way to get started is with our automated installer:
# Clone the repository
git clone https://github.com/vishalsachdev/canvas-mcp.git
cd canvas-mcp
# Run the automated installer
python scripts/install.py
The installer will:
- ✅ Set up Python environment with
uv
package manager - ✅ Install all dependencies automatically
- ✅ Create environment configuration template
- ✅ Configure Claude Desktop integration
- ✅ Test the installation
Manual Installation
If you prefer manual setup:
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
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!)
- Personal assignment tracking and deadline management
- Grade monitoring across all courses
- TODO list and peer review management
- Submission status tracking
Shared Tools (Both Students & Educators)
- Course Tools - List and manage courses, get detailed information, generate summaries with syllabus content
- Discussion & Announcement Tools - Manage discussions, announcements, and replies
- Page & Content Tools - Access pages, modules, and course content
Educator Tools 4. Assignment Tools - Handle assignments, submissions, and peer reviews with analytics 5. Rubric Tools - Full CRUD operations for rubrics with validation, association management, and grading 6. User & Enrollment Tools - Manage enrollments, users, and groups 7. Analytics Tools - View student analytics, assignment statistics, and progress tracking 8. 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:
- Automatic Startup: MCP clients start the server when needed
- Tool Integration: Canvas tools appear in your AI assistant's interface
- Natural Language: Interact naturally with prompts like:
Students:
- "What assignments do I have due this week?"
- "Show me my current grades"
- "What peer reviews do I need to complete?"
- "Have I submitted everything for BADM 350?"
Educators:
- "Which students haven't submitted the latest assignment?"
- "Create an announcement about tomorrow's exam"
- "Show me peer review completion analytics"
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
├── scripts/
│ └── install.py # Automated installation
└── docs/ # Documentation
Documentation
- Tool Documentation - Complete reference for all available tools
- Pages Implementation Guide - Comprehensive Pages feature guide
- Course Documentation Template - Hybrid approach for efficient course documentation
- Development Guide - Architecture details and development reference
Technical Details
Modern Architecture (2025)
Built with current Python ecosystem best practices:
- Package Structure: Modern
src/
layout withpyproject.toml
- Dependency Management: Fast
uv
package manager with locked dependencies - Configuration: Environment-based config with validation and templates
- Entry Points: Proper CLI commands via
pyproject.toml
scripts - Type Safety: Full type hints and runtime validation
Core Components
- FastMCP Framework: Robust MCP server implementation with tool registration
- Async Architecture:
httpx
client with connection pooling and rate limiting - Smart Caching: Intelligent request caching with configurable TTL
- Configuration System: Environment-based config with validation and defaults
- Educational Focus: Tools designed for real teaching workflows
Dependencies
Modern Python packages (see pyproject.toml
):
fastmcp
: MCP server frameworkhttpx
: Async HTTP clientpython-dotenv
: Environment configurationpydantic
: Data validation and settingspython-dateutil
: Date/time handling
Performance Features
- Connection Pooling: Reuse HTTP connections for efficiency
- Request Caching: Minimize redundant Canvas API calls
- Async Operations: Non-blocking I/O for concurrent requests
- Smart Pagination: Automatic handling of Canvas API pagination
- Rate Limiting: Respect Canvas API limits with backoff
Development Tools
- Automated Setup: One-command installation script
- Configuration Testing: Built-in connection and config testing
- Type Checking:
mypy
support for type safety - Code Quality:
ruff
andblack
for formatting and linting
For contributors, see the Development Guide for detailed architecture and development reference.
Troubleshooting
If you encounter issues:
- Server Won't Start - Verify your Configuration setup:
.env
file, virtual environment path, and dependencies - Authentication Errors - Check your Canvas API token validity and permissions
- Connection Issues - Verify Canvas API URL correctness and network access
- Debugging - Check Claude Desktop console logs or run server manually for error output
Security & Privacy Features
API Security
- Your Canvas API token grants access to your Canvas account
- Never commit your
.env
file to version control - The server runs locally on your machine - no external data transmission
- Consider using a token with limited permissions if possible
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:
- Educator Guide - FERPA compliance and anonymization
- Student Guide - Privacy information for students
Contributing
Contributions are welcome! Feel free to:
- Submit issues for bugs or feature requests
- Create pull requests with improvements
- Share your use cases and feedback
License
This project is licensed under the MIT License - see the LICENSE file for details.
Created by Vishal Sachdev