Canvas MCP Server
local-only server
The server can only run on the client’s local machine because it depends on local resources.
Integrations
Provides access to Canvas Learning Management System API, allowing users to list and manage courses, access assignments and submissions, view announcements, retrieve course syllabi and modules, manage users and enrollments, and generate course summaries
Canvas MCP Server
This repository contains a Message Control Protocol (MCP) server implementation for interacting with the Canvas Learning Management System API. The server is designed to work with Claude Desktop and potentially other MCP clients.
Overview
The Canvas MCP Server provides a local interface to Canvas LMS API, allowing you to:
- List and manage courses
- Access assignments and submissions
- View announcements
- Retrieve course syllabi and modules
- Manage users and enrollments
- Generate course summaries
Prerequisites
- Python 3.x
- Virtual environment (venv)
- Canvas API Token
- Canvas API URL (e.g., https://canvas.illinois.edu/api/v1)
Installation
- Clone this repository:
- Create and activate a virtual environment:
- Install dependencies:
Configuration
1. Create Environment File
Create a .env
file in the root directory with the following variables:
Replace the values with:
- Your Canvas API Token (How to get your Canvas API token)
- Your university's Canvas API URL
2. Configure Start Script
The start_canvas_server.sh
script is already configured to:
- Load environment variables from the
.env
file - Activate the virtual environment
- Run the cached server implementation
Make the start script executable:
3. Claude Desktop Configuration
- Install Claude Desktop if you haven't already.
- Create or edit the Claude Desktop configuration file:
- Add the Canvas MCP server configuration:
Replace /Users/YOUR_USERNAME/path/to/canvas-mcp
with the absolute path to where you cloned this repository.
- Restart Claude Desktop to load the new configuration.
Available Tools
The server provides the following tools for Canvas LMS interaction:
Course Management
list_courses
: List all courses for the authenticated userget_course_details
: Get detailed information about a specific coursesummarize_course
: Generate a comprehensive summary of a course
Assignments
list_assignments
: List all assignments for a courseget_assignment_details
: Get detailed information about a specific assignmentget_assignment_description
: Get the full description of an assignment
Submissions
list_submissions
: List all submissions for a specific assignment
Users
list_users
: List all users enrolled in a course
Resources
list_announcements
: List all announcements for a courseget_course_syllabus
: Get the syllabus for a courseget_course_modules
: Get all modules for a course
Usage with Claude Desktop
This MCP server is designed to work seamlessly with Claude Desktop:
- Claude Desktop will automatically start the server when needed
- You'll see the Canvas API tools in the Claude Desktop interface (hammer icon 🔨)
- You can ask Claude to perform Canvas operations like "Show me my courses" or "Get the syllabus for my Biology course"
For manual testing, you can start the server directly:
Technical Details
Server Implementation
The server uses:
fastmcp
: A Python library for building MCP servershttpx
: For asynchronous HTTP requests to the Canvas API- Caching mechanisms to improve performance for course lookups
The main implementation file is canvas_server_cached.py
, which provides:
- Efficient caching of course information
- Pagination handling for Canvas API requests
- Error handling and reporting
- Support for both course IDs and course codes
Dependencies
The server requires the following Python packages:
httpx
: For HTTP requestsfastmcp
: For MCP server implementationrequests
: For some HTTP operations- Other standard libraries for encoding and networking
Troubleshooting
If you encounter issues:
- Server Won't Start
- Check that your
.env
file exists and contains valid credentials - Verify the virtual environment path in
start_canvas_server.sh
- Ensure all dependencies are installed
- Check that your
- Authentication Errors
- Verify your Canvas API token is valid and not expired
- Check that you have the necessary permissions in Canvas
- Connection Issues
- Ensure your Canvas API URL is correct
- Check your internet connection
- Verify your institution hasn't restricted API access
- Debugging
- Check the server logs in the Claude Desktop console
- Try running the server manually to see error output
Security Considerations
- Your Canvas API token grants access to your Canvas account
- Never commit your
.env
file to version control - Consider using a token with limited permissions if possible
- The server runs locally on your machine and doesn't expose your credentials externally
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 available for use under standard open-source terms.
Created by Vishal Sachdev
This server cannot be installed
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.
- Overview
- Prerequisites
- Installation
- Configuration
- Available Tools
- Usage with Claude Desktop
- Technical Details
- Troubleshooting
- Security Considerations
- Contributing
- License