Skip to main content
Glama

Brightspace MCP Server

Brightspace MCP Server

I'm building a Model Context Protocol (MCP) server for Purdue University students to connect and access their Brightspace accounts.

Overview

I'm using Playwright for web scraping to access Brightspace data since direct API access is not available to students. My implementation handles Duo Mobile 2FA authentication and extracts course information, assignments, and other academic data.

Quick Start

1. Setup Environment

# Run the setup script (creates virtual environment and installs dependencies) python setup.py # Activate the virtual environment # On macOS/Linux: source venv/bin/activate # On Windows: venv\Scripts\activate

2. Configure Credentials

Edit the .env file with your Purdue credentials:

PURDUE_USERNAME=your_purdue_username PURDUE_PASSWORD=your_purdue_password

3. Test Connection

# Test basic connectivity python testing/playwright_trial.py # Run the full scraper python brightspace_api.py

Project Structure

  • brightspace_api.py - Main scraper class with login and data extraction
  • testing/playwright_trial.py - Simple connectivity test
  • setup.py - Automated setup script for virtual environment and dependencies
  • requirements.txt - Python dependencies
  • .env - Environment variables (credentials)

Features

  • ✅ Duo Mobile 2FA authentication handling
  • ✅ Course list extraction
  • ✅ Assignment data scraping
  • ✅ JSON data export
  • ✅ Error handling and retry logic
  • ✅ Virtual environment isolation

Why Playwright over API?

  • D2L Brightspace API: Requires administrative access, not available to students
  • Playwright Web Scraping: Handles 2FA, works with student accounts, more flexible

Architecture Overview

The diagram below illustrates the roadblock I face with the official D2L API versus my custom implementation:

The Challenge: I cannot access the official D2L Brightspace API due to institutional restrictions and administrative requirements.

My Solution: I bypass these limitations by creating my own custom API using Playwright web scraping. My approach:

  • Mimics human browser interactions
  • Handles complex authentication flows (including Duo Mobile 2FA)
  • Extracts the same data I see in my browser
  • Provides a clean, programmatic interface for my MCP server
-
security - not tested
A
license - permissive license
-
quality - not tested

local-only server

The server can only run on the client's local machine because it depends on local resources.

Enables Purdue University students to access their Brightspace academic data including courses, assignments, and grades through web scraping with Duo Mobile 2FA authentication. Provides programmatic access to student academic information when official API access is restricted.

  1. Overview
    1. Quick Start
      1. 1. Setup Environment
      2. 2. Configure Credentials
      3. 3. Test Connection
    2. Project Structure
      1. Features
        1. Why Playwright over API?
          1. Architecture Overview

        MCP directory API

        We provide all the information about MCP servers via our MCP API.

        curl -X GET 'https://glama.ai/api/mcp/v1/servers/pranav-vijayananth/brightspace-mcp-server'

        If you have feedback or need assistance with the MCP directory API, please join our Discord server