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.
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.
Get AI-powered assistance with:
Enhance your teaching with:
→ Get Started as an Educator
Complete FERPA compliance through systematic data anonymization when working with student data:
ENABLE_DATA_ANONYMIZATION=true
)All student data is anonymized before it reaches AI systems. See Educator Guide for configuration details.
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.
# Install uv package manager (faster than pip)
pip install uv
# Install the package
uv pip install -e .
# 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.
Add to ~/Library/Application Support/Claude/claude_desktop_config.json
:
{
"mcpServers": {
"canvas-api": {
"command": "canvas-mcp-server"
}
}
}
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
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.
Student Tools (New!)
Shared Tools (Both Students & Educators)
Educator Tools
đź“– View Full Tool Documentation for detailed information about all available tools.
This MCP server works seamlessly with any MCP-compatible client:
Students:
Educators:
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
Built with current Python ecosystem best practices:
src/
layout with pyproject.toml
uv
package manager with locked dependenciespyproject.toml
scriptshttpx
client with connection pooling and rate limitingModern Python packages (see pyproject.toml
):
fastmcp
: MCP server frameworkhttpx
: Async HTTP clientpython-dotenv
: Environment configurationpydantic
: Data validation and settingspython-dateutil
: Date/time handlingmypy
support for type safetyruff
and black
for formatting and lintingFor contributors, see the Development Guide for detailed architecture and development reference.
If you encounter issues:
.env
file, virtual environment path, and dependencies.env
file to version controlEducators 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:
This server is published to the Model Context Protocol Registry for easy installation.
Publishing is automated via GitHub Actions:
# Update version in pyproject.toml
# Update CHANGELOG if applicable
git commit -am "chore: bump version to X.Y.Z"
git push
git tag vX.Y.Z
git push origin vX.Y.Z
vishalsachdev
canvas-mcp
publish-mcp.yml
Alternative: Use API token (legacy method - not recommended):
PYPI_API_TOKEN
secret in repository settingspassword: $
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
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
Contributions are welcome! Feel free to:
This project is licensed under the MIT License - see the LICENSE file for details.
Created by Vishal Sachdev