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.
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.
🌟 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
-
Clone the repository:
git clone <your-repo-url> cd LMS-MCP -
Install dependencies:
# Using uv (recommended) uv sync # Or using pip pip install -e . -
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)
- Visit Google AI Studio
- Sign in with your Google account
- Click "Create API Key"
- Copy the API key to your
.envfile
🔧 Setup with AI Assistants
🤖 Claude Desktop Setup
-
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 -
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" } } } } -
Restart Claude Desktop
-
Test the connection:
Can you check my LMS attendance?
💻 Cursor IDE Setup
-
Open Cursor IDE
-
Go to Settings (Ctrl/Cmd + ,)
-
Navigate to Extensions → MCP
-
Add new MCP server:
{ "name": "LMS Automation", "command": "python", "args": ["./main.py"], "cwd": "/path/to/LMS-MCP", "env": { "PYTHONPATH": "/path/to/LMS-MCP" } } -
Restart Cursor
-
Test in chat:
@lms-automation login to LMS and check my marks
🆚 VS Code with GitHub Copilot Setup
-
Install MCP Extension:
- Open VS Code
- Go to Extensions (Ctrl+Shift+X)
- Search for "MCP Client" and install
-
Configure MCP server:
Create
.vscode/settings.jsonin your project:{ "mcp.servers": [ { "name": "lms-automation", "command": "python", "args": ["main.py"], "cwd": "${workspaceFolder}", "env": { "PYTHONPATH": "${workspaceFolder}" } } ] } -
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 solvinglogout_lms- Logout and clear session
📊 Academic Data
check_attendance- Get attendance records by subjectget_marks- Retrieve marks and gradesget_timetable- Access class schedule
📝 Applications
create_application- Submit university applicationsview_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
.envfile - 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_HOURSsetting
❌ Browser Issues
- Ensure Chrome is installed and updated
- Check
BROWSER_HEADLESSsetting - 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
- Initialization - Load configuration and setup browser
- Authentication - Login with CAPTCHA solving
- Session Management - Save/restore login sessions
- Data Extraction - Navigate and scrape academic data
- Response Formatting - Structure data for AI consumption
🤝 Contributing
We welcome contributions! Here's how to get started:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - 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
- Documentation: Wiki
- Issues: GitHub Issues
- Discussions: GitHub Discussions
<div align="center">
Made with ❤️ for PAF-IAST students
⭐ Star this repo | 🐛 Report Bug | 💡 Request Feature
</div>
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。