Canvas LMS MCP Server

Canvas LMS MCP Server

Enables AI systems to interact with Canvas Learning Management System data, allowing users to access courses, assignments, quizzes, planner items, files, and syllabi through natural language queries.

Category
访问服务器

README

Canvas LMS MCP Server

smithery badge 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

Installing via Smithery

To install Canvas LMS Server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @ahnopologetic/canvas-lms-mcp --client claude

Prerequisites

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

Installation Methods

Option 1: Install with uvx (Recommended)

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.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选