Sponsored by Deepsite.site

Canvas LMS

Created By
ahnopologetic8 months ago
A minimal but better Canvas LMS MCP (Machine Conversation Protocol) server for easy access to education data through your Canvas LMS instance. This server provides a bridge between AI systems (like Cursor) and Canvas Learning Management System.
Content

Canvas LMS MCP Server

A minimal Canvas LMS MCP (Machine Conversation Protocol) server for easy access to education data through your Canvas LMS instance. This server provides a bridge between AI systems (like Cursor) and Canvas Learning Management System.

Features

  • List planner items (assignments, quizzes, etc.)
  • Get and list assignments
  • Get and list quizzes
  • Get and list courses
  • Get course syllabus
  • Get course modules
  • List files

Installation

Prerequisites

  • Python 3.13+
  • Canvas LMS API token
  • uv package manager (recommended)

Installation Methods

The easiest way to install and run canvas-lms-mcp is using uvx:

uvx canvas-lms-mcp

This will run the server in an isolated environment without installing it permanently.

To install the tool permanently:

uv tool install canvas-lms-mcp

Option 2: Install from Source

  1. Clone the repository:

    git clone https://github.com/yourusername/canvas-lms-mcp.git
    cd canvas-lms-mcp
    
  2. Install with uv:

    # Install uv if you don't have it yet
    curl -LsSf https://astral.sh/uv/install.sh | sh
    
    # Create a virtual environment and install dependencies
    uv venv
    uv pip install -e .
    

    Alternatively, use traditional methods:

    python -m venv .venv
    source .venv/bin/activate  # On Windows: .venv\Scripts\activate
    pip install -e .
    

Configuration

Set the following environment variables:

export CANVAS_API_TOKEN="your_canvas_api_token"
export CANVAS_BASE_URL="https://your-institution.instructure.com"  # Default: https://canvas.instructure.com

You can get your Canvas API token from your Canvas account settings.

Running the Server

Start the server with uv:

uv run src/canvas_lms_mcp/main.py

If installed with uvx tool:

canvas-lms-mcp

By default, the server runs on http://localhost:8000. You can use the FastMCP interface at http://localhost:8000/docs to interact with the API.

Available Tools

The server provides the following tools for interacting with Canvas LMS:

Courses

list_courses

List courses that the user is actively enrolled in.

Parameters:

  • page (optional, default=1): Page number (1-indexed)
  • items_per_page (optional, default=10): Number of items per page

get_course

Get a single course by ID.

Parameters:

  • course_id (required): Course ID
  • include (optional): List of additional data to include

get_course_syllabus

Get a course's syllabus.

Parameters:

  • course_id (required): Course ID

get_course_modules

Get modules for a course.

Parameters:

  • course_id (required): Course ID
  • include (optional): List of additional data to include

Assignments

list_assignments

List assignments for a course.

Parameters:

  • course_id (required): Course ID
  • bucket (required): Filter assignments by ("past", "overdue", "undated", "ungraded", "unsubmitted", "upcoming", "future")
  • order_by (required): Field to order assignments by ("due_at", "position", "name")
  • page (optional, default=1): Page number (1-indexed)
  • items_per_page (optional, default=10): Number of items per page

get_assignment

Get a single assignment by ID.

Parameters:

  • course_id (required): Course ID
  • assignment_id (required): Assignment ID

Quizzes

list_quizzes

List quizzes for a course.

Parameters:

  • course_id (required): Course ID
  • include (optional): List of additional data to include
  • page (optional, default=1): Page number (1-indexed)
  • items_per_page (optional, default=10): Number of items per page

get_quiz

Get a single quiz by ID.

Parameters:

  • course_id (required): Course ID
  • quiz_id (required): Quiz ID

Files

list_files

List files for a course or folder.

Parameters:

  • course_id (optional): Course ID
  • folder_id (optional): Folder ID
  • include (optional): List of additional data to include
  • page (optional, default=1): Page number (1-indexed)
  • items_per_page (optional, default=10): Number of items per page

Planner Items

list_planner_items

List planner items for the authenticated user.

Parameters:

  • start_date (required): Start date in ISO 8601 format
  • end_date (required): End date in ISO 8601 format
  • context_codes (optional): List of context codes (e.g., ["course_123"])
  • page (optional, default=1): Page number (1-indexed)
  • items_per_page (optional, default=10): Number of items per page

Integration with Cursor

Cursor is an AI-powered IDE that can interact with the Canvas LMS MCP server to provide education data directly within your development environment.

Setting Up Cursor Integration

  1. Install the Cursor IDE from https://cursor.sh/

  2. Create a .cursor/mcp.json file in your project directory with the following content:

    {
        "mcpServers": {
            "canvas": {
                "command": "uvx",
                "args": [
                     "canvas-lms-mcp"
                ],
                "env": {
                    "CANVAS_API_TOKEN": "your_canvas_api_token",
                    "CANVAS_BASE_URL": "https://your-institution.instructure.com"
                }
            }
        }
    }
    

    Replace:

    • your_canvas_api_token with your actual Canvas API token
    • your-institution.instructure.com with your Canvas institution URL
  3. Restart Cursor for the changes to take effect.

Cursor Time Integration (Optional)

You can also integrate a time server for timezone-related queries by adding a "time" server to your mcp.json:

"time": {
    "command": "uvx",
    "args": [
        "mcp-server-time",
        "--local-timezone=America/New_York"
    ]
}

This allows you to use time-related functions with your Canvas data.

Usage Examples

Once connected, you can ask Cursor AI about your Canvas data:

  • "What assignments do I have due next week?"
  • "Show me the syllabus for my Biology course"
  • "List all my upcoming quizzes"
  • "What's on my schedule for tomorrow?"

Example conversation:

YOU: What assignments do I have due soon?

CURSOR: I'll check your upcoming assignments.

Based on your Canvas data, here are your upcoming assignments:
- "Final Project" for CS101 due on December 10, 2023
- "Lab Report #5" for BIOL200 due on December 7, 2023
- "Research Paper" for ENGL301 due on December 15, 2023

Development

For detailed development instructions, please see the DEVELOPMENT.md file.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Server Config

{
  "mcpServers": {
    "canvas": {
      "command": "uvx",
      "args": [
        "canvas-lms-mcp"
      ],
      "env": {
        "CANVAS_API_TOKEN": "your_canvas_api_token",
        "CANVAS_BASE_URL": "https://your-institution.instructure.com"
      }
    }
  }
}
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
WindsurfThe new purpose-built IDE to harness magic
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Amap Maps高德地图官方 MCP Server
CursorThe AI Code Editor
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Playwright McpPlaywright MCP server
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
ChatWiseThe second fastest AI chatbot™
DeepChatYour AI Partner on Desktop
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Serper MCP ServerA Serper MCP Server
Tavily Mcp
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.