LMS MCP Server

LMS MCP Server

Automates interactions with the PAF-IAST University LMS to provide AI assistants with access to academic data like attendance, marks, and schedules. It features smart authentication with CAPTCHA solving and secure session management for seamless integration with tools like Claude and Cursor.

Category
Visit Server

README

šŸŽ“ LMS MCP Server - PAF-IAST University Automation

A powerful Model Context Protocol (MCP) server that automates PAF-IAST LMS interactions with AI assistants like Claude, Cursor, and VS Code Copilot.

Python MCP License

🌟 Features

šŸ” Smart Authentication

  • Automated login with advanced CAPTCHA solving
  • Google Gemini Vision API integration for enhanced accuracy
  • Secure session management with encryption
  • Automatic session persistence and restoration

šŸ“Š Academic Data Access

  • Attendance Tracking - Real-time attendance records by subject
  • Marks & Grades - Comprehensive exam scores and assessments
  • Timetable Management - Class schedules and academic calendar
  • Application System - Submit and track university applications

šŸ¤– AI-Powered Automation

  • Headless browser operation for efficiency
  • Intelligent form handling and DOM navigation
  • Robust error handling and retry mechanisms
  • Multi-method CAPTCHA solving (Vision AI + OCR)

šŸ›”ļø Security & Privacy

  • Environment-based configuration
  • Encrypted session storage
  • No hardcoded credentials
  • Secure API key management

šŸš€ Quick Start

šŸ“‹ Prerequisites

  • Python 3.11+
  • Git
  • Chrome Browser (for automation)
  • Google Gemini API Key (optional, for enhanced CAPTCHA solving)

šŸ“¦ Installation

  1. Clone the repository:

    git clone <your-repo-url>
    cd LMS-MCP
    
  2. Install dependencies:

    # Using uv (recommended)
    uv sync
    
    # Or using pip
    pip install -e .
    
  3. Configure environment:

    # Copy the example environment file
    cp .env.example .env
    
    # Edit with your credentials (see Configuration section)
    notepad .env  # Windows
    nano .env     # Linux/Mac
    

āš™ļø Configuration

šŸ“ Environment Setup

Edit your .env file with the following settings:

# Required: Your PAF-IAST credentials
LMS_USERNAME=your_student_id_here
LMS_PASSWORD=your_password_here

# Optional: Enhanced CAPTCHA solving
GEMINI_API_KEY=your_gemini_api_key_here

# Browser settings
BROWSER_HEADLESS=true  # Set to false for debugging

# Session settings
SESSION_EXPIRY_HOURS=24
ENCRYPT_SESSIONS=true

šŸ”‘ Getting Google Gemini API Key (Optional but Recommended)

  1. Visit Google AI Studio
  2. Sign in with your Google account
  3. Click "Create API Key"
  4. Copy the API key to your .env file

šŸ”§ Setup with AI Assistants

šŸ¤– Claude Desktop Setup

  1. Locate Claude configuration file:

    # Windows
    %APPDATA%\Claude\claude_desktop_config.json
    
    # macOS
    ~/Library/Application Support/Claude/claude_desktop_config.json
    
    # Linux
    ~/.config/Claude/claude_desktop_config.json
    
  2. Add MCP server configuration:

    {
      "mcpServers": {
        "lms-automation": {
          "command": "python",
          "args": ["C:/path/to/your/LMS-MCP/main.py"],
          "env": {
            "PYTHONPATH": "C:/path/to/your/LMS-MCP"
          }
        }
      }
    }
    
  3. Restart Claude Desktop

  4. Test the connection:

    Can you check my LMS attendance?
    

šŸ’» Cursor IDE Setup

  1. Open Cursor IDE

  2. Go to Settings (Ctrl/Cmd + ,)

  3. Navigate to Extensions → MCP

  4. Add new MCP server:

    {
      "name": "LMS Automation",
      "command": "python",
      "args": ["./main.py"],
      "cwd": "/path/to/LMS-MCP",
      "env": {
        "PYTHONPATH": "/path/to/LMS-MCP"
      }
    }
    
  5. Restart Cursor

  6. Test in chat:

    @lms-automation login to LMS and check my marks
    

šŸ†š VS Code with GitHub Copilot Setup

  1. Install MCP Extension:

    • Open VS Code
    • Go to Extensions (Ctrl+Shift+X)
    • Search for "MCP Client" and install
  2. Configure MCP server:

    Create .vscode/settings.json in your project:

    {
      "mcp.servers": [
        {
          "name": "lms-automation",
          "command": "python",
          "args": ["main.py"],
          "cwd": "${workspaceFolder}",
          "env": {
            "PYTHONPATH": "${workspaceFolder}"
          }
        }
      ]
    }
    
  3. Use with Copilot Chat:

    • Open Copilot Chat (Ctrl+Shift+I)
    • Type: @mcp:lms-automation login and get my attendance

šŸ› ļø Available MCP Tools

šŸ” Authentication

  • login_to_lms - Login with credentials and CAPTCHA solving
  • logout_lms - Logout and clear session

šŸ“Š Academic Data

  • check_attendance - Get attendance records by subject
  • get_marks - Retrieve marks and grades
  • get_timetable - Access class schedule

šŸ“ Applications

  • create_application - Submit university applications
  • view_application_status - Check application status

šŸ”§ Utilities

  • solve_captcha - Manual CAPTCHA solving

šŸ’” Usage Examples

Basic Login and Data Retrieval

# Login to LMS
Login to PAF-IAST LMS with my credentials

# Check attendance
What's my current attendance status?

# Get marks
Show me my latest marks and grades

# View timetable
What's my class schedule for today?

Advanced Queries

# Comprehensive report
Generate a summary report of my academic performance including attendance, marks, and upcoming classes

# Specific subject
What's my attendance percentage for Computer Science subjects?

# Application tracking
Check the status of my scholarship application

šŸ” Troubleshooting

Common Issues

āŒ Login Failed

  • Verify credentials in .env file
  • Check if CAPTCHA solving is working
  • Ensure university LMS is accessible

āŒ CAPTCHA Not Solving

  • Add Gemini API key for better accuracy
  • Check internet connection
  • Verify image preprocessing

āŒ Session Expired

  • Sessions expire after 24 hours by default
  • Re-login will create a new session
  • Check SESSION_EXPIRY_HOURS setting

āŒ Browser Issues

  • Ensure Chrome is installed and updated
  • Check BROWSER_HEADLESS setting
  • Install required browser drivers

Debug Mode

Enable debug mode for troubleshooting:

# In .env file
DEBUG_MODE=true
SAVE_SCREENSHOTS=true
BROWSER_HEADLESS=false

šŸ—ļø Architecture

🧱 Core Components

LMS-MCP/
ā”œā”€ā”€ main.py              # MCP server entry point
ā”œā”€ā”€ lms_automation.py    # Core automation logic
ā”œā”€ā”€ captcha_solver.py    # CAPTCHA solving algorithms
ā”œā”€ā”€ session_manager.py   # Session persistence
ā”œā”€ā”€ config.py           # Configuration management
ā”œā”€ā”€ models/             # Data models
│   ā”œā”€ā”€ attendance.py
│   ā”œā”€ā”€ marks.py
│   └── timetable.py
└── utils/              # Utility functions
    ā”œā”€ā”€ encryption.py
    ā”œā”€ā”€ image_processor.py
    └── web_scraper.py

šŸ”„ Workflow

  1. Initialization - Load configuration and setup browser
  2. Authentication - Login with CAPTCHA solving
  3. Session Management - Save/restore login sessions
  4. Data Extraction - Navigate and scrape academic data
  5. Response Formatting - Structure data for AI consumption

šŸ¤ Contributing

We welcome contributions! Here's how to get started:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit changes (git commit -m 'Add amazing feature')
  4. Push to branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Setup

# Clone your fork
git clone https://github.com/yourusername/LMS-MCP.git
cd LMS-MCP

# Install development dependencies
uv sync --dev

# Run tests
python -m pytest

# Run linting
black . && flake8 .

šŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


āš ļø Disclaimer

This tool is for educational purposes and personal use only. Users are responsible for:

  • Complying with university policies
  • Securing their own credentials
  • Using the tool responsibly
  • Not overloading university servers

šŸ“ž Support


<div align="center">

Made with ā¤ļø for PAF-IAST students

⭐ Star this repo | šŸ› Report Bug | šŸ’” Request Feature

</div>

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured