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 Assistance MCP Server built with FastMCP, PostgreSQL, and SQLAlchemy.
This project demonstrates how to create a Model Context Protocol (MCP) server that allows AI assistants such as Claude Desktop to manage student records through MCP tools.
Features
Create students
Retrieve all students
PostgreSQL database integration
SQLAlchemy ORM
Claude Desktop MCP integration
MCP Inspector support
Beginner-friendly project structure
Related MCP server: PostgreSQL API SSH MCP Server
Tech Stack
Python 3.11+
FastMCP
PostgreSQL
SQLAlchemy
Psycopg2
Claude Desktop
MCP Inspector
Project Structure
TeacherAssist-MCP/
│
├── app/
│ ├── db/
│ │ └── database.py
│ │
│ ├── models/
│ │ └── student.py
│ │
│ ├── services/
│ │ └── student_service.py
│ │
│ ├── mcp/
│ │ ├── server.py
│ │ └── tools/
│ │ └── student_tools.py
│ │
│ └── main.py
│
├── .env
├── requirements.txt
├── README.md
└── pyproject.tomlPrerequisites
Install:
Python 3.11 or newer
PostgreSQL
Git
Verify installations:
python --version
psql --version
git --versionClone Repository
git clone https://github.com/YOUR_USERNAME/TeacherAssist-MCP.git
cd TeacherAssist-MCPCreate Virtual Environment
Windows
python -m venv .venv
.venv\Scripts\activateLinux / macOS
python3 -m venv .venv
source .venv/bin/activateInstall Dependencies
Using pip:
pip install -r requirements.txtOr using uv:
uv syncPostgreSQL Setup
Create a database:
CREATE DATABASE teacherassist;Create a PostgreSQL user if needed:
CREATE USER teacheruser WITH PASSWORD 'password';
GRANT ALL PRIVILEGES ON DATABASE teacherassist TO teacheruser;Environment Variables
Create a .env file in the project root.
DATABASE_URL=postgresql://teacheruser:password@localhost:5432/teacherassistExample:
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/teacherassistDatabase Initialization
Start PostgreSQL.
Run the project once to create tables automatically if your project uses:
Base.metadata.create_all(bind=engine)Otherwise create tables manually.
Run MCP Server
Method 1
python -m app.mcp.serverMethod 2
uv run python -m app.mcp.serverExpected output:
Starting MCP server 'TeacherAssist MCP'
transport 'stdio'Test Using MCP Inspector
Install Inspector:
npx @modelcontextprotocol/inspectorRun:
npx @modelcontextprotocol/inspector python -m app.mcp.serveror
npx @modelcontextprotocol/inspector uv run python -m app.mcp.serverOpen the provided localhost URL.
Test tools:
create_student
get_students
Claude Desktop Integration
Locate Claude Desktop MCP configuration file.
Add:
{
"mcpServers": {
"Teacher-Assistance": {
"command": "D:\\path\\to\\project\\.venv\\Scripts\\python.exe",
"args": [
"-m",
"app.mcp.server"
],
"cwd": "D:\\path\\to\\project"
}
}
}Replace paths with your own installation paths.
Restart Claude Desktop.
Example Tool Usage
Create Student:
{
"student_id": 101,
"name": "Monirul Islam"
}Response:
{
"student_id": 101,
"name": "Monirul Islam"
}Get Students:
[
{
"student_id": 101,
"name": "Monirul Islam"
}
]Common Issues
PostgreSQL Connection Error
Verify:
PostgreSQL service is running
Database exists
Username/password are correct
DATABASE_URL is correct
ModuleNotFoundError: app
Run from project root:
cd TeacherAssist-MCP
python -m app.mcp.serverClaude Desktop Cannot Connect
Verify:
Virtual environment path is correct
cwdpoints to project rootMCP server starts manually
Claude Desktop has been restarted
Duplicate Key Error
duplicate key value violates unique constraintCause:
Student ID already exists.
Solution:
Use a new unique student_id.
Future Enhancements
Update Student
Delete Student
Add Marks
Grade Generation
Attendance Management
Student Reports
AI-powered Academic Analytics
FastAPI REST API
Authentication and Authorization
License
MIT License
Feel free to use, modify, and contribute.
Author
Monirul Islam
TeacherAssist-MCP is a beginner-friendly MCP project demonstrating how AI assistants can interact with PostgreSQL databases through the Model Context Protocol (MCP).
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.
Latest Blog Posts
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/monirul8888/TeacherAssist-MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server