Canvas Student MCP server

Provides a bridge to Canvas LMS, enabling students to retrieve and manage course data like assignments, files, and to-do items through a lightweight Python tool with rich, optimized formatting.
Back to servers
Setup instructions
Provider
Jon-Vii
Release date
Mar 17, 2025
Language
Python

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.

Installation

Prerequisites

  • Python 3.10 or newer
  • Claude Desktop
  • UV Python package manager (recommended but optional)

Installation Options

Simple Installation (Recommended)

  1. Clone the repository
  2. Run the installation script:
# 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.

Manual Installation

  1. Clone the repository
  2. Install dependencies:
# 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]"

Configuration

Claude Desktop Setup

Edit your Claude Desktop configuration file located at:

  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • macOS: ~/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 project
  • your_canvas_api_token with your Canvas API token
  • your-institution.instructure.com with your institution's Canvas URL

Canvas API Authentication

Create 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

Usage

Starting the Server

For standard usage:

python canvas_student.py

For guaranteed PDF support:

python run_server.py

Interacting with Canvas via Claude

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.

Example Queries

Here are some examples of what you can ask Claude:

  • "Show me all my courses"
  • "Find exams in my Data Communication course"
  • "What assignments are due in the next week?"
  • "Search for content about 'machine learning' across all my courses"
  • "Show me the content of Lab1.pdf from course 27849"
  • "Show me my to-do items and missing assignments"
  • "What quizzes do I have coming up in my courses?"
  • "Show me the details for quiz 12345 in course 67890"

File Content Handling

The MCP server can handle different file types in the following ways:

  • Text Files (.txt, .md, .csv, .json): Content displayed directly in Claude
  • PDFs and Images: URLs provided for viewing or downloading
  • Canvas Previews: When available, preview content can be shown

Troubleshooting

Common Issues

If you encounter problems:

  1. Check the Claude Desktop logs:

    • Windows: %APPDATA%\Claude\logs\mcp-server-canvas.log
    • macOS: ~/Library/Logs/Claude/mcp-server-canvas.log
  2. Verify the path in your configuration is correct

  3. Make sure you're using Python 3.10 or newer

Authentication Issues

If you have authentication problems:

  1. 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".

  2. URL Format: Ensure your Canvas URL is correctly formatted:

    • Should start with https://
    • Should NOT include /api/v1/
    • Should NOT have a trailing slash
    • Example: https://canvas.institution.edu (correct)
    • Example: https://canvas.institution.edu/ (incorrect - has trailing slash)
  3. 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:

    • Your .env file
    • Your system environment
    • The Claude Desktop configuration
  4. Permissions: Ensure your Canvas user account has sufficient permissions for the actions you're trying to perform.

PDF Limitations

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.

How to install this MCP server

For Claude Code

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.

For Cursor

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.

Adding an MCP server to Cursor globally

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"
            }
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.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

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later