UpGrad LXP MCP Server
# UpGrad LXP MCP Server
An MCP (Model Context Protocol) server that controls a Firefox browser via Playwright to automate navigating UpGrad's learning platform, extracting class transcripts, and downloading resources.
## Setup
```bash
npm install
npx playwright install firefox
```
## Usage
### With Claude Code / Claude Desktop
Add to your MCP configuration:
```json
{
"mcpServers": {
"upgrad-lxp": {
"command": "npx",
"args": ["tsx", "/path/to/upgrad-lxp-mcp/src/index.ts"],
"env": {
"UPGRAD_EMAIL": "your-email@example.com",
"UPGRAD_PASSWORD": "your-password",
"OUTPUT_DIR": "./output",
"HEADLESS": "false"
}
}
}
}
```
### Run directly
```bash
npm start
```
## Available Tools
| Tool | Description |
|------|-------------|
| `launch_browser` | Launch Firefox browser instance |
| `close_browser` | Close the browser |
| `login` | Log into UpGrad LXP |
| `check_login_status` | Check if currently logged in |
| `list_courses` | List available courses |
| `select_course` | Navigate into a course |
| `list_tracks` | List tracks/modules in a course |
| `select_track` | Navigate into a track |
| `list_past_classes` | List past classes in a track |
| `view_class_details` | Open a specific class's details |
| `extract_transcript` | Extract transcript from class details |
| `extract_resources` | Extract resource links from class details |
| `download_resource` | Download a resource file |
| `save_transcript` | Save transcript to disk |
| `screenshot` | Take a page screenshot |
| `get_page_content` | Get page text content |
| `navigate` | Navigate to a URL |
| `click` | Click an element |
| `scrape_all_past_classes` | Bulk scrape all past classes |
## Output Structure
```
output/
├── transcripts/ # Saved transcript files (.md, .txt, .json)
├── resources/ # Downloaded resource files (organized by class)
├── screenshots/ # Page screenshots
├── errors/ # Error screenshots for debugging
└── index.json # Manifest from bulk scraping
```
## Selector Updates
The CSS selectors in `src/helpers/selectors.ts` are initial guesses. After first launch:
1. Run the browser in headed mode (`headless: false`)
2. Log in and navigate to the target pages
3. Use browser DevTools to inspect the actual DOM
4. Update `selectors.ts` with the real selectors
TDQS
Scored across 22 tools
Most tools have clear, distinct purposes. The generic browser tools (navigate, click, get_page_content) could overlap with higher-level specific tools, but their descriptions clarify their lower-level role. The selector management tools are clearly separate. Minor overlap exists between extract_transcript and scrape_all_past_classes, but the bulk nature distinguishes them.
Most tools follow a verb_noun pattern (list_courses, select_track, extract_transcript), but a few use bare verbs (login, navigate, click, screenshot). The style is consistent with lowercase and underscores throughout. The variation is minor and does not hinder predictability.
With 22 tools, the server feels heavy. It combines generic browser tools, platform-specific tools, and meta-tools for selector management. While each serves a purpose, the set could be consolidated without losing functionality.
The domain of browsing courses and extracting transcripts/resources is well covered: login, listing, selection, extraction, saving, and bulk scraping are present. The absence of a logout tool is a minor gap, but closing the browser suffices. Selector management tools add robustness.