School Attendance MCP Server

School Attendance MCP Server

Enables managing school attendance records and interacting with GitHub repositories, including committing files, fetching repository information, and marking student attendance status through natural language.

Category
Visit Server

README

School Attendance MCP Server

An MCP (Model Context Protocol) server that provides tools for managing school attendance and interacting with GitHub repositories.

Features

  • MCP Protocol Implementation: Custom-built MCP server using NestJS
  • GitHub Integration: Tools for committing files and fetching repository information
  • Attendance Management: Tool for marking student attendance
  • Codex Compatible: Works with Cursor/codex and other MCP clients

Setup

1. Install Dependencies

npm install

2. Environment Variables

Create a .env file in the root directory:

GITHUB_PERSONAL_ACCESS_TOKEN=your_github_token_here

Getting a GitHub Token:

  1. Go to https://github.com/settings/tokens
  2. Generate a new token (classic)
  3. Select repo scope (for full repository access)
  4. Copy the token to your .env file

3. Running the Server

Development mode:

npm run start:dev

Production mode:

npm run build
npm run start:prod

Start (default):

npm run start

The server starts on http://localhost:3001 and exposes:

  • MCP Endpoint: http://localhost:3001/mcp
  • Status Endpoint: http://localhost:3001/mcp/status

Available Tools

1. mark_attendance

Mark attendance for a student with date and status.

Parameters:

  • studentId (string): Student ID
  • date (string): Date in YYYY-MM-DD format
  • status (string): present, absent, or late

Example:

{
  "name": "mark_attendance",
  "arguments": {
    "studentId": "12345",
    "date": "2024-01-15",
    "status": "present"
  }
}

2. commit_changes

Commit files to a GitHub repository.

Parameters:

  • repoOwner (string): GitHub username/organization
  • repoName (string): Repository name
  • branchName (string): Branch name (e.g., main, master)
  • commitMessage (string): Commit message
  • filesToCommit (array): Array of files with path and content

Example:

{
  "name": "commit_changes",
  "arguments": {
    "repoOwner": "username",
    "repoName": "my-repo",
    "branchName": "main",
    "commitMessage": "Add new file",
    "filesToCommit": [
      {
        "path": "test.txt",
        "content": "Hello World"
      }
    ]
  }
}

3. get_repo_info

Get information about a GitHub repository.

Parameters:

  • repoOwner (string): GitHub username/organization
  • repoName (string): Repository name

Example:

{
  "name": "get_repo_info",
  "arguments": {
    "repoOwner": "username",
    "repoName": "my-repo"
  }
}

Connecting to Codex/Cursor

Configuration

Add to ~/.cursor/mcp.json:

{
  "mcpServers": {
    "school-attendance-mcp": {
      "url": "http://localhost:3001/mcp",
      "requestInit": {
        "headers": {
          "Content-Type": "application/json"
        }
      }
    }
  }
}

Testing Connection

curl http://localhost:3001/mcp/status

Expected response:

{
  "status": "OK",
  "tools": [
    "mark_attendance",
    "commit_changes",
    "get_repo_info",
    "create_branch",
    "list_branches",
    "get_file_contents",
    "list_commits"
  ]
}

Implementation Details

Architecture

Codex/Cursor
    ↓
MCP Protocol (JSON-RPC over HTTP)
    ↓
NestJS Application
    ↓
MCP Controller → Services (Attendance, GitHub)
    ↓
GitHub API (via @octokit/rest SDK)

Key Components

  1. MCP Controller (src/mcp/mcp.controller.ts):

    • Custom MCP protocol implementation
    • Handles initialize, tools/list, tools/call methods
    • JSON-RPC 2.0 message format
    • CORS enabled for codex connectivity
  2. Services (src/services/):

    • attendance.service.ts: Attendance management
    • github.service.ts: GitHub operations using @octokit/rest
  3. App Module (src/app.module.ts):

    • Main application module
    • Configures NestJS modules and dependencies
    • Uses @nestjs/config for environment variables
  4. Dependencies:

    • @nestjs/core, @nestjs/common: NestJS framework
    • @nestjs/platform-express: Express adapter for NestJS
    • @nestjs/config: Configuration management
    • @octokit/rest: GitHub API SDK

MCP Protocol Methods

The server implements the following MCP protocol methods:

  • initialize: Server initialization and capability negotiation
  • tools/list: Returns list of available tools with schemas
  • tools/call: Executes a tool with provided arguments

Request Format

All requests follow JSON-RPC 2.0 format:

{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "name": "tool_name",
    "arguments": { ... }
  },
  "id": 1
}

Response Format

All responses follow MCP protocol format:

{
  "jsonrpc": "2.0",
  "result": {
    "content": [
      {
        "type": "text",
        "text": "Result message"
      }
    ]
  },
  "id": 1
}

Testing

See TESTING.md for detailed testing instructions.

Quick test:

# Check server status
curl http://localhost:3001/mcp/status

# List tools
curl -X POST http://localhost:3001/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"tools/list","id":1}'

Project Structure

school-attendance-mcp/
├── src/
│   ├── main.ts                # Application entry point
│   ├── app.module.ts          # Root application module
│   ├── mcp/
│   │   └── mcp.controller.ts  # MCP protocol controller
│   └── services/
│       ├── attendance.service.ts # Attendance service
│       └── github.service.ts     # GitHub service
├── .env                       # Environment variables
├── nest-cli.json              # NestJS CLI configuration
├── tsconfig.json              # TypeScript configuration
├── package.json               # Dependencies
├── README.md                  # This file
└── TESTING.md                 # Testing guide

Notes

  • Built with NestJS framework for better structure and maintainability
  • The MCP protocol is implemented manually (no MCP SDK used)
  • GitHub operations use @octokit/rest SDK
  • Server binds to 0.0.0.0 for external accessibility
  • CORS is enabled to allow codex connections
  • Uses dependency injection for better testability and modularity

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured