Student MCP Server
Enables an AI assistant to help students by providing tools for math calculations, attendance tracking, marks analysis, reading PDF notes, searching lecture notes, and checking college regulations.
README
🎓 AI-Powered Student Assistant (Model Context Protocol + Groq + Web App)
An interactive, AI-driven educational platform built using Model Context Protocol (MCP), Groq LLM (llama-3.3-70b-versatile), Python 3.11+, and a modern Glassmorphic Web Dashboard.
🌟 Project Features
- Model Context Protocol (MCP): Standardized protocol connecting AI reasoning with local file tools & calculations.
- Groq LLM Power: Blazing fast inference for autonomous tool selection and response synthesis.
- 6 Built-in Educational MCP Tools:
- 🧮 Calculator: Evaluates math expressions, percentage weights, and GPA formulas.
- 📊 Attendance Tracker: Analyzes student attendance records from
attendance.csv, detects shortages (<75%), and predicts required classes. - 📈 Marks Analyzer: Computes averages, top scores, letter grades, and performance rankings from
marks.csv. - 📄 PDF Reader: Extracts text and searches content from lecture PDF files (
notes.pdf). - 🔍 Lecture Notes Search: Keyword and concept search across course revision notes.
- 📜 College Regulations Checker: Queries official college handbook (
rules.txt) for attendance rules, grading scales, and library policies.
- Interactive Web Interface (Frontend):
- Dark glassmorphism design with responsive tabs.
- Live MCP Protocol Visual Trace: Step-by-step pipeline view showing
User Prompt -> Groq LLM -> MCP Server -> Tool Run -> Answer. - Interactive Analytics Modules: Marks Report Card, Attendance Shortage Predictor, Searchable Rules Explorer, PDF Viewer, and MCP Tool Sandbox.
- Offline Simulation Mode: Browser fallback engine that works out-of-the-box even before adding an API key!
🏗️ Architecture Overview
User Query
│
▼
Frontend Web Dashboard (HTML/CSS/JS)
│
▼
FastAPI Server (backend/api.py)
│
▼
Groq LLM (llama-3.3-70b-versatile)
│
├─► Intercepts Query & Selects Tool
│
▼
MCP Client (backend/client.py)
│
▼
MCP Server (backend/server.py via FastMCP)
│
├─► calculator.py (Math & GPA)
├─► attendance.py (attendance.csv)
├─► marks.py (marks.csv)
├─► pdf_reader.py (notes.pdf)
├─► notes.py (notes.txt)
└─► rules.py (rules.txt)
│
▼
Groq Formats Natural Language Answer -> User
📁 Project Directory Structure
student_mcp/
├── backend/
│ ├── server.py # FastMCP / MCP Server tool registry
│ ├── client.py # Groq LLM tool router & MCP integrator
│ ├── api.py # FastAPI web bridge for Frontend
│ ├── calculator.py # Calculation logic
│ ├── attendance.py # Attendance CSV parser
│ ├── marks.py # Marks CSV calculator
│ ├── pdf_reader.py # PDF text extractor (PyPDF)
│ ├── notes.py # Lecture notes search
│ ├── rules.py # College handbook search
│ ├── prompts.py # System prompts & tool definitions
│ ├── requirements.txt # Dependencies list
│ ├── .env # Environment config (GROQ_API_KEY)
│ └── data/
│ ├── attendance.csv # Attendance dataset
│ ├── marks.csv # Marks dataset
│ ├── notes.pdf # Sample academic PDF notes
│ ├── notes.txt # Text notes reference
│ └── rules.txt # Official college regulations handbook
│
├── frontend/
│ ├── index.html # Interactive Student Assistant Web Dashboard
│ ├── styles.css # Dark mode, glassmorphism & micro-animations
│ └── app.js # App logic, chat UI, MCP protocol visual trace & tool sandbox
│
├── server.py # Root server entrypoint
├── client.py # Root terminal CLI client
├── create_pdf.py # Utility to generate notes.pdf
├── requirements.txt # Root dependencies
├── .env # Root environment variables
└── README.md # Complete documentation
⚡ Quick Start Guide
1. Install Dependencies
Ensure Python 3.11+ is installed, then run:
pip install mcp groq pandas pypdf python-dotenv fastapi uvicorn
Or install from requirements file:
pip install -r requirements.txt
2. Configure Groq API Key
- Sign up for a free account at https://console.groq.com.
- Create an API key (e.g.
gsk_xxxxxxxxxxxxxxxx). - Open
.envand paste your key:
GROQ_API_KEY=gsk_xxxxxxxxxxxxxxxx
3. Run the Applications
Option A: Launch Interactive Web Dashboard (Recommended)
- Start the backend FastAPI server:
python backend/api.py
(Runs on http://localhost:8000)
- Open
frontend/index.htmlin your web browser!
Option B: Run via Python CLI Client
Start the terminal client directly:
python client.py
Example queries to try:
"Calculate Rahul's average marks.""Check Priya's attendance in Computer Networks.""What is the minimum attendance required and condonation rule?""Search notes for Binary Search Tree.""Calculate (88 * 0.25 + 92 * 0.30 + 95 * 0.45)."
Option C: Run MCP FastMCP Server
python server.py
🚀 Deployment (Easy Options)
Below are minimal options to deploy and run the whole app (backend + frontend) with a single command.
- Local single-process (recommended for development)
- The backend now serves the frontend static files. Start only the backend:
# from project root
uvicorn backend.api:app --reload --host 0.0.0.0 --port 8000
# open http://localhost:8000 in your browser
- Docker (recommended for repeatable deploys)
Build and run the included Docker image:
docker build -t student-mcp .
docker run -p 8000:8000 student-mcp
- Cloud: push the Docker image to any container host (Render, Fly, Heroku Container Registry, Azure ACI) and deploy with their web UI.
Notes:
- Set
GROQ_API_KEYin environment (.env or container env) to enable Groq-powered question answering. - Use
requirements.txtto reproduce Python dependencies.
🛠️ MCP Tools Reference
| Tool Name | File | Description | Example Query |
|---|---|---|---|
calculate_expression |
calculator.py |
Evaluates math formulas, percentages, GPA | Calculate (92*0.4 + 88*0.6) |
check_attendance |
attendance.py |
Reads attendance.csv, checks shortage (<75%) |
Check Rahul's attendance |
get_marks_summary |
marks.py |
Reads marks.csv, computes student averages & grades |
Calculate Rahul's average marks |
read_pdf_notes |
pdf_reader.py |
Extracts text from notes.pdf via PyPDF |
Search PDF for Dijkstra |
search_lecture_notes |
notes.py |
Topic search across course notes | Search notes for OSI model |
search_college_rules |
rules.py |
Queries rules.txt for policies |
What is the attendance condonation policy? |
🎯 Verification & Testing
Run unit checks on individual modules:
python backend/calculator.py
python backend/attendance.py
python backend/marks.py
python backend/rules.py
Enjoy building with Model Context Protocol (MCP) and Groq! 🚀
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。