The Canvas Student MCP integrates with Canvas LMS through the Model Context Protocol (MCP) standard, allowing you to interact with your Canvas courses, assignments, and content through Claude. It serves as a bridge between the Canvas API and LLM clients, making it easier to access and work with your educational materials.
# Navigate to the canvas-student directory
cd src/canvas-student
# Run the installer Python script
python install.py
The script will automatically detect your package manager (UV or pip), install the package with PDF support, and guide you through the next steps.
# Navigate to the canvas-student directory
cd src/canvas-student
# Install with UV (including PDF support)
uv pip install -e ".[pdf]"
# Or with standard pip
pip install -e ".[pdf]"
Edit your Claude Desktop configuration file located at:
%APPDATA%\Claude\claude_desktop_config.json
~/Library/Application Support/Claude/claude_desktop_config.json
Add the following configuration:
{
"mcpServers": {
"canvas": {
"command": "python",
"args": ["ABSOLUTE_PATH_TO/src/canvas-student/main.py"],
"env": {
"CANVAS_API_TOKEN": "your_canvas_api_token",
"CANVAS_BASE_URL": "https://your-institution.instructure.com"
}
}
}
}
Make sure to replace:
ABSOLUTE_PATH_TO
with the absolute path to your projectyour_canvas_api_token
with your Canvas API tokenyour-institution.instructure.com
with your institution's Canvas URLCreate a .env
file with your Canvas credentials:
CANVAS_API_TOKEN=your_token_here
CANVAS_BASE_URL=https://your-institution.instructure.com
CANVAS_CLIENT_ID=your_oauth_client_id # Optional for OAuth
CANVAS_CLIENT_SECRET=your_oauth_client_secret # Optional for OAuth
REDIRECT_URI=http://localhost:8000/oauth/callback # Optional for OAuth
For standard usage:
python canvas_student.py
For guaranteed PDF support:
python run_server.py
Once configured, you can chat with Claude to access your Canvas information. The MCP icon will appear in Claude's interface when the connection is active.
Here are some examples of what you can ask Claude:
The MCP server can handle different file types in the following ways:
If you encounter problems:
Check the Claude Desktop logs:
%APPDATA%\Claude\logs\mcp-server-canvas.log
~/Library/Logs/Claude/mcp-server-canvas.log
Verify the path in your configuration is correct
Make sure you're using Python 3.10 or newer
If you have authentication problems:
Check your API token: Make sure your Canvas API token is valid and not expired. You can create a new token from your Canvas account settings under "Approved Integrations".
URL Format: Ensure your Canvas URL is correctly formatted:
https://
/api/v1/
https://canvas.institution.edu
(correct)https://canvas.institution.edu/
(incorrect - has trailing slash)Environment Variables: If you're getting "CLIENT_ID not configured" errors but are using API token authentication, check that your API token is correctly set in either:
.env
filePermissions: Ensure your Canvas user account has sufficient permissions for the actions you're trying to perform.
The current implementation provides links to PDFs but cannot fully extract and display their content within Claude. This limitation is due to restrictions on Claude's internet access.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "canvas" '{"command":"python","args":["ABSOLUTE_PATH_TO/src/canvas-student/main.py"],"env":{"CANVAS_API_TOKEN":"your_canvas_api_token","CANVAS_BASE_URL":"https://your-institution.instructure.com"}}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"canvas": {
"command": "python",
"args": [
"ABSOLUTE_PATH_TO/src/canvas-student/main.py"
],
"env": {
"CANVAS_API_TOKEN": "your_canvas_api_token",
"CANVAS_BASE_URL": "https://your-institution.instructure.com"
}
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"canvas": {
"command": "python",
"args": [
"ABSOLUTE_PATH_TO/src/canvas-student/main.py"
],
"env": {
"CANVAS_API_TOKEN": "your_canvas_api_token",
"CANVAS_BASE_URL": "https://your-institution.instructure.com"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect