Canvas MCP

Canvas MCP is an intelligent academic management platform that integrates Canvas LMS, Google Calendar, Gmail, and an AI-powered Flashcard Builder to help students and educators manage their coursework, schedules, communications, and study materials in one unified interface.

Overview

Canvas MCP leverages the Model Context Protocol (MCP) to provide seamless integration between multiple services, allowing users to interact with their academic data through natural language conversations. The platform uses AI to understand user queries and automatically execute the appropriate actions across Canvas, Google Calendar, Gmail, and the flashcard system.

Core Features

🎓 Canvas LMS Integration

Canvas MCP provides comprehensive access to Canvas LMS functionality through the Canvas API. The integration supports all major Canvas features:

Course Management

  • Get Courses: Retrieve all courses for the authenticated user
  • Get Course Details: Access detailed information about specific courses
  • Create Courses: Create new Canvas courses (requires admin permissions)
  • Update Courses: Modify course properties (name, code, dates, visibility settings)
  • Delete Courses: Remove courses from the system
  • Get Daily Briefing: Receive a formatted summary of upcoming assignments due in the next 7 days

Assignment Management

  • Get Upcoming Assignments: Fetch assignments due within a specified number of days, sorted by priority score
  • Get Assignment Details: Retrieve comprehensive assignment information including descriptions, rubrics, due dates, points, and submission types
  • Create Assignments: Create new assignments with custom descriptions, due dates, points, and submission types
  • Update Assignments: Modify assignment properties (name, description, due date, points, publication status)
  • Delete Assignments: Remove assignments from courses

Quiz Management

  • Create Quizzes: Create new quizzes with customizable settings (time limits, allowed attempts, quiz types)
  • Get Quiz Details: Retrieve quiz information and questions
  • List Quizzes: Get all quizzes for a course
  • Update Quizzes: Modify quiz properties and settings
  • Delete Quizzes: Remove quizzes from courses
  • Quiz Submissions: Create, retrieve, update, and manage quiz submissions and scores

Content Management

  • Modules: Create, read, update, and delete course modules and module items
  • Pages: Manage wiki pages (create, read, update, delete) with HTML content support
  • Files: Upload, retrieve, update, and delete course files
  • Folders: Organize files with folder creation and management
  • Get Page Content: Extract HTML/text content from Canvas pages for flashcard generation

Communication & Collaboration

  • Discussions: Create, manage, and participate in discussion topics
  • Announcements: Create and manage course announcements with delayed posting support
  • Conversations: Send messages to users, manage conversations (mark read/unread, archive, star)
  • Get Discussion Entries: Retrieve posts and replies from discussion threads

Submission Management

  • Create Submissions: Submit assignments with various submission types (online upload, text entry, URL, etc.)
  • Get Submissions: Retrieve submission details and grades
  • List Submissions: View all submissions for an assignment
  • Update Submissions: Grade submissions, add comments, and manage submission status
  • Delete Submissions: Remove submissions from assignments

Organization

  • Assignment Groups: Create and manage assignment groups with weighted grading support
  • Course Modules: Organize course content into structured modules with prerequisites and unlock dates

📅 Google Calendar Integration

Canvas MCP seamlessly integrates with Google Calendar to help users manage their schedules and academic deadlines:

Calendar Management

  • List Calendars: Retrieve all calendars accessible to the user (primary calendar, shared calendars, etc.)
  • View Calendar Details: Access calendar information including timezone, access role, and description

Event Management

  • List Events: Query events from any calendar with flexible filtering options:
    • Time range filtering (start and end dates)
    • Text search queries
    • Maximum results limit (up to 2,500 events)
    • Support for recurring events (expanded into instances)
  • Get Event Details: Retrieve comprehensive event information including:
    • Title, description, and location
    • Start and end times (with timezone support)
    • Attendee lists and response statuses
    • All-day event support
    • Event status and HTML links
  • Create Events: Create new calendar events with:
    • Custom titles and descriptions
    • Flexible scheduling (timed events or all-day events)
    • Location information
    • Attendee management (invite multiple participants)
    • Timezone support (defaults to UTC, customizable)
  • Update Events: Modify existing events (title, description, time, location, attendees)
  • Delete Events: Remove events from calendars

Advanced Features

  • Timezone Support: All events are handled with proper timezone conversion and display
  • Recurring Events: Support for listing and managing recurring event instances
  • Event Search: Free-text search across event fields (title, description, location)
  • Priority Sorting: Events can be sorted by start time or last updated date

📧 Gmail API Integration

Canvas MCP provides comprehensive email management capabilities through the Gmail API:

Email Retrieval

  • List Emails: Retrieve emails with powerful filtering options:
    • Gmail search query support (e.g., is:unread, from:example@gmail.com, subject:test)
    • Maximum results limit (up to 500 emails)
    • Full Gmail search syntax support
  • Get Email Details: Retrieve complete email information including:
    • Subject, sender, and recipients
    • Email body (plain text and HTML)
    • Timestamps and labels
    • Read/unread status
    • Starred status
    • Thread ID for conversation tracking
  • Search Emails: Advanced email search with multiple filters:
    • Filter by sender (from)
    • Filter by recipient (to)
    • Filter by subject (partial match)
    • Filter by attachment presence (has_attachment)
    • Filter by read status (is_unread)
    • Filter by starred status (is_starred)
    • Filter by date range (after_date, before_date)

Email Management

  • Send Emails: Compose and send emails with:
    • Single or multiple recipients
    • CC and BCC support
    • Plain text or HTML body content
    • Custom subjects
  • Mark as Read/Unread: Change email read status for better organization
  • Delete Emails: Remove emails from the mailbox
  • Email Threading: Access conversation threads and related emails

Email Features

  • Label Support: Work with Gmail labels for organization
  • Snippet Preview: Quick preview of email content without opening the full message
  • Attachment Detection: Identify emails with attachments
  • Date Filtering: Filter emails by date ranges for efficient searching

🃏 Flashcard Builder

The Flashcard Builder is an AI-powered study tool that helps students create, manage, and review flashcards for accelerated learning:

Flashcard Generation

  • Automatic Generation from Canvas Content:
    • Extract content from Canvas pages, assignments, and course materials
    • Generate flashcards from course descriptions and assignment details
    • Support for HTML content extraction and text processing
    • Multiple generation methods:
    • Simple Method: Creates flashcards from sentence structures
    • Key Terms Method: Extracts key terms and creates definition-based flashcards
    • Enhanced Q&A Method: Identifies definition patterns, concept explanations, and key facts to create high-quality question-answer pairs
  • Custom Flashcard Creation: Manually create flashcards with custom questions and answers
  • Bulk Import: Add multiple flashcards to a set at once

Flashcard Management

  • Create Flashcard Sets: Organize flashcards by course and assignment
    • Link flashcard sets to specific Canvas courses
    • Optionally associate sets with assignments
    • Add student notes for context
  • Add Flashcards: Add individual or multiple flashcards to existing sets
  • Get Flashcard Sets: Retrieve flashcard sets by course or view all sets
  • Delete Flashcard Sets: Remove flashcard sets when no longer needed

Study & Review

  • Get Flashcards Needing Review: Retrieve flashcards that haven't been mastered yet
  • Record Reviews: Track student performance by recording correct/incorrect answers
  • Progress Tracking: Monitor study progress with detailed statistics:
    • Total number of reviews
    • Number of mastered flashcards
    • Number of flashcards needing review
    • Last reviewed timestamp
  • Spaced Repetition Support: The system tracks which flashcards need review based on performance

Advanced Features

  • HTML Content Processing: Automatically extracts plain text from HTML content in Canvas pages
  • Key Term Extraction: Identifies important terms and concepts from course materials
  • Definition Pattern Recognition: Detects definition patterns (e.g., "X is Y", "X refers to Y") to create accurate flashcards
  • Question-Answer Format Detection: Recognizes existing Q&A formats in content
  • List and Bullet Point Processing: Converts structured content into flashcards

Integration with Canvas

  • Seamless Content Import: Directly import content from Canvas pages and assignments
  • Course Context: Use course descriptions and assignment details to generate contextually relevant flashcards
  • Assignment Linking: Associate flashcard sets with specific assignments for targeted studying

Technology Stack

Frontend

  • Streamlit: The frontend is built using Streamlit, a Python framework for building interactive web applications. Streamlit provides a simple and intuitive interface for users to interact with the Canvas MCP platform. It enables rapid development of user interfaces with built-in components for forms, displays, and data visualization.

Backend

  • FastAPI: The backend API is built with FastAPI, a modern Python web framework for building APIs. FastAPI provides high performance, automatic API documentation, and type validation.
  • Render: The backend is hosted on Render, a cloud platform that provides seamless deployment and scaling of web services. Render handles the backend infrastructure, ensuring reliable and scalable API access.

Database & Authentication

  • Supabase: User information and authentication credentials are stored in Supabase, an open-source Firebase alternative. Supabase provides:
    • PostgreSQL database for storing user credentials and session data
    • Row-level security for data protection
    • Real-time capabilities
    • Authentication and authorization management
    • Secure credential storage for Google OAuth tokens (Gmail and Calendar)

AI & LLM Integration

  • OpenRouter: The platform uses OpenRouter to access large language models (LLMs) for natural language processing and conversation management. OpenRouter provides access to various LLM providers including Anthropic's Claude models.
  • Model Context Protocol (MCP): MCP is used to standardize communication between the AI assistant and various service integrations (Canvas, Google Calendar, Gmail, Flashcards).

APIs & Integrations

  • Canvas API: Integration with Canvas LMS through the official Canvas API using the canvasapi Python library
  • Google Calendar API: Integration with Google Calendar using the Google API Python client
  • Gmail API: Integration with Gmail using the Google API Python client with OAuth2 authentication
  • Google OAuth2: Secure authentication for Google services (Calendar and Gmail) using OAuth2 flow

Data Storage

  • JSON File Storage: Flashcards and progress data are stored locally in JSON files (data/flashcards/flashcards.json and data/flashcards/progress.json)
  • Token Storage: OAuth tokens for Google services are stored securely in Supabase database

Development & Deployment

  • Python 3.9+: The platform is built with Python and requires Python 3.9 or higher
  • Uvicorn: ASGI server for running the FastAPI backend
  • Environment Variables: Configuration management through environment variables for API keys, database credentials, and service URLs

Architecture

Canvas MCP follows a modular architecture:

  1. Frontend (Streamlit): User interface for interacting with the platform
  2. Backend API (FastAPI): RESTful API that handles requests and coordinates with MCP servers
  3. MCP Servers: Separate servers for each service (Canvas, Calendar, Gmail, Flashcards) that implement the Model Context Protocol
  4. Authentication Service: Manages user authentication and credential storage in Supabase
  5. AI Assistant: Uses OpenRouter and LLMs to understand user queries and execute appropriate tool calls
  6. Database (Supabase): Stores user credentials and session data securely

Getting Started

For detailed installation and setup instructions, please refer to the INSTALLATION_GUIDE.md and LOCAL_SETUP_GUIDE.md.

Key Benefits

  1. Unified Interface: Access Canvas, Google Calendar, Gmail, and flashcards from a single platform
  2. AI-Powered Assistance: Natural language interface for interacting with all services
  3. Automated Workflows: Automatically generate flashcards from Canvas content
  4. Seamless Integration: Direct integration with Canvas LMS and Google services
  5. Progress Tracking: Monitor study progress and flashcard mastery
  6. Time Management: Keep track of assignments and schedule events in Google Calendar
  7. Email Management: Efficiently manage academic emails and communications

Security & Privacy

  • OAuth2 Authentication: Secure authentication for Google services
  • Credential Encryption: User credentials are stored securely in Supabase with encryption
  • API Key Management: Environment-based configuration for API keys
  • Session Management: Secure session handling for user authentication
  • Row-Level Security: Supabase RLS policies ensure users can only access their own data

License

This project is licensed under the MIT License.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Support

For support, please open an issue on the GitHub repository or refer to the documentation in the docs/ directory.

Built With

Share this project:

Updates