Brightspace MCP Server
A Model Context Protocol (MCP) server that allows you to access your Purdue University Brightspace account through Claude Desktop. Ask Claude about your courses, assignments, and grades in natural language!
Overview
Since students can't access the official D2L Brightspace API, this project uses Playwright for web scraping to extract Brightspace data. It handles Duo Mobile 2FA authentication and integrates seamlessly with Claude Desktop through the Model Context Protocol.
Features
✅ Automated Duo Mobile 2FA - Handles Purdue's two-factor authentication
✅ Course List Extraction - Get all your enrolled courses
✅ MCP Integration - Works with Claude Desktop for natural language queries
✅ Secure Credentials - Environment-based credential management
🟡 Assignment Scraping - In development
🟡 Grade Tracking - Planned feature
Prerequisites
Python 3.12 (required for compatibility)
macOS (tested on macOS, may work on other platforms)
Purdue Career Account with Brightspace access
Duo Mobile app configured for your account
Claude Desktop installed (Download here)
Installation
Step 1: Clone and Setup
Step 2: Configure Credentials
Create a .env file in the project root:
⚠️ Important: Never commit your .env file to git! It's already in .gitignore.
Step 3: Test the Scraper (Optional)
Before setting up Claude Desktop, you can test if the scraper works:
This will:
Open a browser window
Navigate to Purdue Brightspace
Prompt you to approve Duo Mobile authentication
Scrape your course list
Save data to
brightspace_data.json
Step 4: Configure Claude Desktop
Open Claude Desktop
Go to:
File→Settings→DeveloperClick:
Edit ConfigAdd this configuration to the opened file:
⚠️ Important: Replace /absolute/path/to/ with your actual project path. For example:
To get your absolute path, run this in the project directory:
Save the configuration file
Restart Claude Desktop completely
Step 5: Test the Integration
Open Claude Desktop and try these commands:
If you see the hello tool, the integration is working! 🎉
Project Structure
How It Works
Authentication Flow
MCP Integration
Available MCP Tools
Once configured, you can ask Claude to:
hello- Test that the MCP server is workingMore tools coming soon (get_courses, get_assignments, etc.)
Troubleshooting
MCP Server Not Showing in Claude
Verify paths are absolute in
claude_desktop_config.jsonCheck Python version: Must be Python 3.12 (
python --version)Restart Claude Desktop completely
Check Claude Desktop logs:
~/Library/Logs/Claude/main.log
Authentication Fails
Check credentials in
.envfileTest manually: Run
python testing/playwright_trial.pyApprove Duo Mobile quickly when prompted (60-second timeout)
Check network connection to Purdue servers
No Courses Found
Run the scraper directly:
python brightspace_api.pyCheck the debug screenshot:
homepage_debug.pngVerify you're enrolled in courses on Brightspace
CSS selectors may have changed - open an issue if this happens
Development
Testing the Scraper
Modifying the MCP Server
The MCP server is in mcp_server.py. To add new tools:
Add tool definition in
@app.list_tools()Add tool handler in
@app.call_tool()Implement scraper method in
brightspace_api.pyRestart Claude Desktop
Important Notes
Terms of Service: This project respects Purdue's terms of service and only accesses your own data
Rate Limiting: Uses reasonable scraping intervals to avoid server load
Security: Credentials are stored locally in
.envand never committed to gitMaintenance: CSS selectors may need updates if Brightspace changes their UI
Contributing
Contributions are welcome! Please:
Fork the repository
Create a feature branch
Test your changes
Submit a pull request
License
See LICENSE file for details.
Support
For issues or questions:
Check the Troubleshooting section above
Open an issue on GitHub
Contact Purdue IT if you have Brightspace access issues
Acknowledgments
Built with:
Playwright - Browser automation
MCP Python SDK - Model Context Protocol
Claude Desktop - AI assistant integration
Note: This is an unofficial project and is not affiliated with Purdue University or D2L Corporation.