About School Database MCP Server
A demonstration MCP server for managing a mock school database with SQLite. It is intended for educational use and combines database tools with student behavior classification and email alerts.
Key features
- 01Inspect schema and table relationships
- 02Run parameterized SELECT, INSERT, and UPDATE queries
- 03Record and classify behavior notes
- 04Check student behavior alerts
- 05Send alert emails
Use cases
- 01Inspect mock school data and schema
- 02Record and classify student incidents
- 03Review behavior patterns for alerts
- 04Notify relevant parties by email
MCP support
Exposes school database inspection, query, behavior tracking, and alert tools to MCP clients over stdio.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMESchool Database MCP Server
A Model Context Protocol (MCP) server for managing a mock school database with automated behavior tracking and alert system.
Overview
This project implements a school management system backend that provides tools for:
- Managing student and teacher data
- Recording and classifying student behavior incidents
- Automated behavior alert system with email notifications
- Database querying and schema inspection
The server uses SQLite for data storage and integrates with external services (like Gmail) for notifications.
Features
Core Database Management
- Schema Inspection: Get complete database structure with table relationships
- Safe Query Execution: Execute SELECT, INSERT, and UPDATE queries with parameter binding
- Sample Data: View sample records from any table
Behavior Management Workflow
- Add Behavior Notes: Record student behavior incidents with pending classification
- LLM Classification: Automatically classify behaviors as positive, negative, or neutral
- Alert System: Monitor students for concerning behavior patterns
- Email Notifications: Automatically send alerts to relevant parties
Available Tools
get_database_schema- Inspect database structure and relationshipsexecute_query- Run SQL queries safelyadd_behavior_note_pending_classification- Record new behavior incidentsupdate_behavior_classification- Classify behavior after LLM analysisget_pending_classifications- List unclassified behavior notescheck_student_alerts_enhanced- Check if students need behavior alertssend_behavior_alert_email_immediately- Send automated email alerts
Database Schema
The system includes tables for:
- Students: Student information and contact details
- Teachers: Teacher information
- Behavior Notes: Incident records with classification and alerts
- Classes: Course and enrollment information
- Grades: Academic performance tracking
Installation
Prerequisites
- Python 3.12+
- SQLite3
Setup
- Clone the repository
- Install dependencies:
pip install mcp>=1.9.2 - Run the server:
python school_db_mcp.py
Usage
Starting the Server
python school_db_mcp.py
The server runs as an MCP server using stdio for communication.
Example Workflow
-
Inspect the database structure:
{ "tool": "get_database_schema", "arguments": {"include_sample_data": true} } -
Add a behavior incident:
{ "tool": "add_behavior_note_pending_classification", "arguments": { "student_name": "John Doe", "teacher_id": 1, "description": "Student was disruptive during class", "location": "Classroom 101" } } -
Classify the behavior:
{ "tool": "update_behavior_classification", "arguments": { "note_id": 1, "behavior_type": "negative", "reasoning": "Disruptive behavior affects learning environment" } } -
Check for alerts:
{ "tool": "check_student_alerts_enhanced", "arguments": { "student_id": 123, "days_back": 7 } }
Security Features
- Query Sanitization: Only SELECT, INSERT, and UPDATE queries allowed
- Parameter Binding: Prevents SQL injection attacks
- Input Validation: Validates all tool inputs before processing
Integration
This server is designed to work with:
- Gmail MCP Server: For sending behavior alert emails
- LLM Systems: For automated behavior classification
- School Management Systems: As a backend data service
Development
Project Structure
school-db-server/
├── school_db_mcp.py # Main server implementation
├── pyproject.toml # Project configuration
├── README.md # This file
└── school_data # SQLite database file (created on first run)
Key Classes
SchoolDatabaseMCP: Main server class handling MCP protocol- Database operations use SQLite with row factory for dict-like access
- Async/await pattern for all tool operations
Notes
- This is a demonstration/toy project showcasing MCP server development
- Uses mock data for educational purposes
- Designed to integrate with other MCP servers in a larger system
- Includes comprehensive error handling and logging
License
This project is for educational and demonstration purposes.
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.