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
2. Configure Credentials
Edit the .env
file with your Purdue credentials:
3. Test Connection
Project Structure
brightspace_api.py
- Main scraper class with login and data extractiontesting/playwright_trial.py
- Simple connectivity testsetup.py
- Automated setup script for virtual environment and dependenciesrequirements.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
This server cannot be installed
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.