Canvas LMS MCP server

Integrates with Canvas LMS to enable course management, student data analysis, and administrative task automation through a TypeScript-based API toolkit.
Back to servers
Setup instructions
Provider
R.Huijts
Release date
Mar 19, 2025
Language
TypeScript

The Canvas MCP Server enables AI assistants like Claude to interact with Canvas LMS. It provides a suite of tools for managing courses, announcements, rubrics, assignments, and student data through the Canvas API, making it easier to automate and enhance Canvas-related tasks.

Prerequisites

  • Node.js (v16 or higher)
  • A Canvas API token
  • Canvas instance URL (defaults to "https://fhict.instructure.com")

Installation

  1. Clone this repository and install dependencies:

    git clone <repository-url>
    cd canvas-mcp
    npm install
    
  2. Build the TypeScript project:

    npm run build
    
  3. Configure your environment variables:

    # Create a .env file
    echo "CANVAS_API_TOKEN=your_token_here" > .env
    # Optional: Set custom Canvas URL
    echo "CANVAS_DOMAIN=https://your-canvas-instance.com" >> .env
    

Claude Desktop Integration

  1. Open Claude Desktop's configuration file:

    MacOS:

    code ~/Library/Application\ Support/Claude/claude_desktop_config.json
    

    Windows:

    code %AppData%\Claude\claude_desktop_config.json
    
  2. Add the Canvas MCP server configuration:

    {
      "mcpServers": {
        "canvas": {
          "command": "node",
          "args": [
            "/path/to/canvas-mcp/build/index.js"
          ],
          "env": {
            "CANVAS_API_TOKEN": "your_token_here",
            "CANVAS_DOMAIN": "https://your-canvas-instance.com"
          }
        }
      }
    }
    
  3. Restart Claude Desktop to apply changes

Available Tools

list-courses

Lists all active courses for the authenticated user

  • No required parameters
  • Returns course names, IDs, and term information

post-announcement

Posts an announcement to a specific course

  • Required parameters:
    • courseId: string
    • title: string
    • message: string

list-rubrics

Lists all rubrics for a specific course

  • Required parameters:
    • courseId: string
  • Returns rubric titles, IDs, and descriptions

list-students

Gets a complete list of students enrolled in a course

  • Required parameters:
    • courseId: string
  • Optional parameters:
    • includeEmail: boolean (default: false)
  • Returns student names, IDs, and optional email addresses

list-assignments

Gets all assignments in a course with submission status

  • Required parameters:
    • courseId: string
  • Optional parameters:
    • studentId: string
    • includeSubmissionHistory: boolean (default: false)
  • Returns assignment details and submission status

list-assignment-submissions

Gets all student submissions for a specific assignment

  • Required parameters:
    • courseId: string
    • assignmentId: string
  • Optional parameters:
    • includeComments: boolean (default: true)
  • Returns submission details, grades, and comments

Available Prompts

analyze-rubric-statistics

Analyzes rubric statistics for formative assignments in a course and creates visualizations

  • Required parameters:
    • courseName: string (The name of the course to analyze)
  • Creates two comprehensive visualizations:
    1. Grouped stacked bar chart showing score distribution per criterion across all assignments
    2. Grouped bar chart showing average scores per criterion for all assignments
  • Provides comparative analysis across assignments and criteria
  • Includes progression analysis and trend identification

Troubleshooting

Common Issues

  1. Server not appearing in Claude Desktop:

    • Verify configuration file syntax
    • Check file paths are absolute
    • Ensure Canvas API token is valid
    • Restart Claude Desktop
  2. Connection errors:

    • Check Canvas API token permissions
    • Verify Canvas instance is accessible
    • Review Claude's MCP logs:
      # MacOS
      tail -f ~/Library/Logs/Claude/mcp*.log
      # Windows
      type %AppData%\Claude\Logs\mcp*.log
      

Debug Logging

The server logs errors to stderr. These can be viewed in Claude Desktop's logs or redirected when running manually:

node build/index.js 2> debug.log

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":"node","args":["/path/to/canvas-mcp/build/index.js"],"env":{"CANVAS_API_TOKEN":"your_token_here","CANVAS_DOMAIN":"https://your-canvas-instance.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": "node",
            "args": [
                "/path/to/canvas-mcp/build/index.js"
            ],
            "env": {
                "CANVAS_API_TOKEN": "your_token_here",
                "CANVAS_DOMAIN": "https://your-canvas-instance.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": "node",
            "args": [
                "/path/to/canvas-mcp/build/index.js"
            ],
            "env": {
                "CANVAS_API_TOKEN": "your_token_here",
                "CANVAS_DOMAIN": "https://your-canvas-instance.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