TeacherAssist-MCP
Provides tools to create and retrieve student records from a PostgreSQL database, enabling AI assistants to manage student data through database operations.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@TeacherAssist-MCPadd student Alice Smith with ID 1001"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
๐ TeacherAssist-MCP
AI-powered Teacher Assistant MCP Server built with FastMCP, FastAPI, PostgreSQL, SQLAlchemy, ReportLab, and automated email notifications.
TeacherAssist-MCP allows AI assistants such as Claude Desktop to manage student records through Model Context Protocol (MCP) tools while also exposing a robust FastAPI REST API for traditional integrations.
๐ฅ Demo Video
โถ๏ธ Watch the complete project demo: TeacherAssist-MCP Demo Video
Related MCP server: postgres-mcp
๐ Project Overview
TeacherAssist-MCP is a modern AI-integrated teacher management system designed to simplify academic administration. It combines the power of FastAPI with FastMCP to provide both traditional REST APIs and AI-powered MCP tools.
With this system, educators and AI assistants can:
๐จโ๐ Manage student records
๐ Handle subjects and exams
๐ Store and retrieve marks
๐ Calculate GPA automatically
๐ Generate academic reports
๐ง Send automated email notifications
๐ค Integrate seamlessly with Claude Desktop via MCP
This project demonstrates how AI assistants can interact with PostgreSQL databases through MCP tools while maintaining a clean, scalable, and production-ready backend architecture.
โจ Features
๐จโ๐ Student Management
Create new student records
Retrieve all students
Store student information securely in PostgreSQL
Send automatic registration confirmation emails
๐ Academic Management
Create and manage subjects
Create and manage exams
Store student marks for each exam
๐ Reporting & GPA
Calculate GPA automatically
Generate student performance reports
Export reports as PDF using ReportLab
๐ค MCP Integration
Claude Desktop MCP integration
MCP Inspector support
AI-powered database interaction through FastMCP tools
๐ ๏ธ Tech Stack
Technology | Purpose |
Python 3.11+ | Core programming language |
FastAPI | REST API framework |
FastMCP | MCP server framework |
PostgreSQL | Relational database |
SQLAlchemy | ORM for database operations |
Psycopg2 | PostgreSQL adapter |
ReportLab | PDF report generation |
Gmail SMTP | Email notifications |
UV | Package management |
Claude Desktop | AI assistant integration |
๐ Project Structure
TeacherAssist-MCP/
โ
โโโ app/
โ โโโ db/ # Database configuration
โ โโโ models/ # SQLAlchemy models
โ โ โโโ student.py
โ โ โโโ subject.py
โ โ โโโ exam.py
โ โ โโโ mark.py
โ โโโ schemas/ # Pydantic schemas
โ โโโ routes/ # FastAPI routes
โ โโโ services/ # Business logic
โ โโโ mcp/ # MCP server and tools
โ โ โโโ server.py
โ โ โโโ tools/
โ โ โโโ student_tools.py
โ โ โโโ mark_tools.py
โ โโโ main.py # FastAPI entry point
โ
โโโ report-lab/ # Report generation utilities
โโโ reports/ # Generated reports
โโโ .env # Environment variables
โโโ pyproject.toml # Project dependencies
โโโ uv.lock # Dependency lock file
โโโ README.md # Project documentation
โโโ LICENSEโ๏ธ Prerequisites
Before running this project, make sure you have installed:
Python 3.11+
PostgreSQL
Git
UV Package Manager
Verify Installation
python --version
git --version
psql --version
uv --version๐ฅ Installation
1๏ธโฃ Clone the Repository
git clone https://github.com/YOUR_GITHUB_USERNAME/TeacherAssist-MCP.git
cd TeacherAssist-MCP2๏ธโฃ Install Dependencies
uv sync3๏ธโฃ Activate Virtual Environment
Windows
.venv\Scripts\activateLinux/macOS
source .venv/bin/activate๐๏ธ PostgreSQL Setup
Create a PostgreSQL database:
CREATE DATABASE teacherassist;๐ Environment Variables
Create a .env file in the project root and add the following:
DATABASE_URL=postgresql://postgres:password@localhost:5432/teacherassist
EMAIL_USER=[your_email@gmail.com](mailto:your_email@gmail.com)
EMAIL_PASSWORD=your_gmail_app_passwordGmail Configuration
To enable email notifications:
Enable 2-Step Verification in your Google Account.
Generate a Google App Password.
Use the generated password as EMAIL_PASSWORD.
Do NOT use your normal Gmail password.
โถ๏ธ Running the Application
Run FastAPI Server
uv run uvicorn app.main:app --reloadOpen Swagger UI:
http://127.0.0.1:8000/docsRun MCP Server
uv run python -m app.mcp.serverExpected output:
Starting MCP server 'TeacherAssist MCP'
transport 'stdio'๐งช Testing with MCP Inspector
Run the following command:
npx @modelcontextprotocol/inspector uv run python -m app.mcp.serverOpen the generated URL in your browser to inspect available MCP tools.
Available MCP Tools
create_student
get_students
create_mark
get_student_marks
๐ค Claude Desktop Integration
Add the following configuration to your Claude Desktop MCP config file:
{
"mcpServers": {
"Teacher-Assistance": {
"command": "C:\Monirul\TeacherAssist-MCP\.venv\Scripts\python.exe",
"args": [
"-m",
"app.mcp.server"
],
"cwd": "C:\Monirul\TeacherAssist-MCP"
}
}
}Replace the paths with your own project location, then restart Claude Desktop.
๐ก API Endpoints
Student Endpoints
Method | Endpoint | Description |
POST | /students | Create a new student |
GET | /students | Retrieve all students |
Subject Endpoints
Method | Endpoint | Description |
POST | /subjects | Create a subject |
GET | /subjects | Retrieve all subjects |
Exam Endpoints
Method | Endpoint | Description |
POST | /exams | Create an exam |
GET | /exams | Retrieve all exams |
Mark Endpoints
Method | Endpoint | Description |
POST | /marks | Create a mark entry |
GET | /marks/student/{student_id} | Get marks by student ID |
๐ API Examples
Create a Student
POST /studentsRequest Body:
{
"student_id": 101,
"name": "Monirul Islam",
"email": "[student@example.com](mailto:student@example.com)"
}Response:
{
"student_id": 101,
"name": "Monirul Islam",
"email": "[student@example.com](mailto:student@example.com)"
}A confirmation email will automatically be sent to the student.
Get Students
GET /studentsResponse:
[
{
"student_id": 101,
"name": "Monirul Islam",
"email": "[student@example.com](mailto:student@example.com)"
}
]๐ฌ Example Claude Desktop Prompts
Create a student with ID 1001, name Monirul Islam, email monirul@gmail.com
Show all students
Create marks for student ID 1001 in Mathematics exam
Calculate GPA for student ID 1001
Claude Desktop will automatically invoke the appropriate MCP tools.
๐ Common Issues & Solutions
ModuleNotFoundError: app
Run the MCP server from the project root:
uv run python -m app.mcp.serverPostgreSQL Connection Error
Ensure PostgreSQL service is running.
Verify the database exists.
Check database credentials in .env.
Confirm DATABASE_URL is correct.
Claude Desktop Cannot Connect
Verify the correct Python executable path.
Verify the correct cwd path.
Ensure the MCP server runs manually without errors.
Restart Claude Desktop after configuration changes.
Gmail Authentication Failed
Use a Google App Password instead of your normal Gmail password.
๐ Future Enhancements
โ๏ธ Update Student
๐๏ธ Delete Student
๐ Attendance Management
๐ Advanced GPA Analytics
๐ PDF Report Export
๐ Authentication & Authorization
๐ฅ Multi-user Support
๐ค AI-powered Student Performance Insights
๐ค Contributing
Contributions are welcome! Feel free to fork this repository, create a feature branch, and submit a pull request.
git checkout -b feature/your-feature-name๐ License
This project is licensed under the MIT License. See the LICENSE file for more details.
๐จโ๐ป Author
Monirul Islam
๐ GitHub: https://github.com/moonirul
๐ผ LinkedIn: https://linkedin.com/in/moonirul
โญ Support
If you find this project useful, please consider giving it a โญ star on GitHub. It helps the project reach more developers and supports future improvements.
TeacherAssist-MCP demonstrates how modern AI assistants can interact with PostgreSQL databases through FastMCP and the Model Context Protocol (MCP), while integrating FastAPI APIs, automated email notifications, GPA calculation, and report generation in a scalable and production-ready architecture.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceAn MCP server enabling AI assistants to perform CRUD operations on a Supabase database via a standardized interface.193MIT
- Flicense-qualityCmaintenanceMCP server for PostgreSQL database management, enabling AI-assisted schema exploration, stored procedure analysis, test data generation, and safe transaction management via Claude Desktop.
- Flicense-qualityCmaintenanceAn MCP server for AI assistants to programmatically create and manage Entity-Relationship Diagrams in StarUML, including full CRUD operations and PostgreSQL DDL generation.
- Alicense-qualityDmaintenanceA secure MCP server that lets AI assistants directly interact with PostgreSQL databases via tools like create_table, list_tables, and execute_sql, plus a web configurator for managing connections.1MIT
Related MCP Connectors
Read-only MCP server for ClassQuill, a tutoring-business-management platform.
GibsonAI MCP server: manage your databases with natural language
Analytical memory for AI agents: a real Postgres queried in plain English over MCP. One command.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/moonirul/TeacherAssist-MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server