Tuesday, 25 November 2025

#Module 5 – CRUD Operations using MCP

Module 5 – MCP Commands for CRUD Operations

Module 5 – CRUD Operations using MCP

This module covers how to perform Create, Read, Update, Delete (CRUD) operations using Model Context Protocol (MCP) for the Attendance Tracking System.

๐Ÿ“Œ CRUD Targets

  • Courses
  • Semesters
  • Subjects
  • Staff
  • Students
  • Timetable
  • Attendance Records

▶️ CREATE Commands

# Create a new course
mcp call academic_tracker.create '{
  "id": "C3",
  "name": "M.Tech – Data Science",
  "semesters": 4
}'
# Create a new student
mcp call academic_tracker.create '{
  "id": "STU1201",
  "name": "Rahul",
  "courseId": "C1",
  "semesterId": "S3"
}'

๐Ÿ“– READ Commands

# Read all students of a semester
mcp call academic_tracker.read '{
  "entity": "students",
  "filter": { "semesterId": "S1" }
}'
# Get timetable for Semester 5
mcp call academic_tracker.read '{
  "entity": "timetable",
  "filter": { "semesterId": "S5" }
}'

♻️ UPDATE Commands

# Update a student's semester
mcp call academic_tracker.update '{
  "entity": "students",
  "id": "STU1201",
  "data": { "semesterId": "S4" }
}'
# Change staff assigned to a subject
mcp call academic_tracker.update '{
  "entity": "subjects",
  "id": "SUB101",
  "data": { "staffId": "T3" }
}'

๐Ÿ—‘️ DELETE Commands

# Delete a student
mcp call academic_tracker.delete '{
  "entity": "students",
  "id": "STU1201"
}'
# Delete subject timetable entry
mcp call academic_tracker.delete '{
  "entity": "timetable",
  "id": "TT1"
}'

๐Ÿงพ Sample Output (JSON Returned from MCP)

{
  "status": "success",
  "message": "Student updated successfully",
  "data": {
    "id": "STU1201",
    "name": "Rahul",
    "courseId": "C1",
    "semesterId": "S4"
  }
}

๐ŸŽ‰ Module 5 Completed!

CRUD operations are now fully operational in MCP for your attendance system.

No comments:

Post a Comment

#MCP Index

MCP Tutorial – Module Index MCP Tutorial – 12 Modules Latest Edition for AU-CSE Final year Students Module 1 Introducti...