OPlatformStudentMCP

dev-zeromoblt/OPlatformStudentMCP

3.2

If you are the rightful owner of OPlatformStudentMCP and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The OPlatform Student MCP Server is a Model Context Protocol server designed to interface with the Student API, leveraging Redis FT.SEARCH capabilities for advanced querying, including geo-radius queries.

Tools
2
Resources
0
Prompts
0

OPlatform Student MCP Server

MCP (Model Context Protocol) server for querying the Student API with Redis FT.SEARCH capabilities, including geo-radius queries.

Features

  • Get Student by ID: Retrieve complete student details using their unique Zrn identifier
  • Advanced Search: Redis FT.SEARCH powered queries with support for:
    • Full-text search on names and addresses
    • Tag-based filtering (status, grade, subscription, gender, campus)
    • Geo-radius queries (find students within X km/mi of a location)
    • Complex boolean queries with AND/OR operators
    • Pagination support

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Claude    │◄────►│  Student MCP     │◄────►│  Student API    β”‚
β”‚   Desktop   β”‚ stdioβ”‚  Server          β”‚ HTTP β”‚  (Redis Search) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                            β”‚
                            β–Ό
                     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                     β”‚ Smithy Gen  β”‚
                     β”‚ TypeScript  β”‚
                     β”‚ Models      β”‚
                     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Prerequisites

  • Node.js >= 18
  • TypeScript
  • Access to Student API endpoint
  • Valid JWT authentication token

Local Development Setup

1. Build Smithy Models and Install Dependencies

The project uses Smithy-generated TypeScript models packaged as a local tarball dependency.

Option A: Use the automated build script (Recommended)

cd /Users/zeroman/workplace/nowzone/OPlatformStudentMCP
./build-with-models.sh

This script will:

  1. Build the Smithy models from OPlatformModels
  2. Pack them as a tarball
  3. Copy the tarball to src/generated/
  4. Install all dependencies (including the packaged model)
  5. Build the TypeScript project

Option B: Manual steps

cd /Users/zeroman/workplace/nowzone/OPlatformStudentMCP

# Build and package Smithy models
npm run model

# Build the project
npm run build

3. Set Environment Variables

Create a .env file or export variables:

export STUDENT_API_ENDPOINT="https://api.zeromoblt.com"
export STUDENT_API_AUTH_TOKEN="your-jwt-token-here"

4. Test Locally with Claude Desktop

Create or update ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "student-search": {
      "command": "node",
      "args": ["/Users/zeroman/workplace/nowzone/OPlatformStudentMCP/dist/index.js"],
      "env": {
        "STUDENT_API_ENDPOINT": "https://api.zeromoblt.com",
        "STUDENT_API_AUTH_TOKEN": "your-jwt-token-here"
      }
    }
  }
}

Restart Claude Desktop to load the MCP server.

Quick Token Update (macOS):

Update your token quickly when it expires:

# 1. Copy JWT token from browser to clipboard
# 2. Run the update script
npm run update-token
# or: yarn update-token

# 3. Restart Claude Desktop

This automatically updates your Claude Desktop config with the token from clipboard. See for details.

Usage Examples

Get Student by ID

"Get student with ID ZST12345"

The MCP server will call:

{
  "tool": "get_student",
  "arguments": {
    "id": "ZST12345"
  }
}

Search Examples

Find all active students:

"Search for all active students"

β†’ Query: @status:{ACTIVE}

Find students by name:

"Find students named Basavaraju"

β†’ Query: @name:Basavaraju

Find students in a specific grade:

"Find all students in class 10 or class 11"

β†’ Query: @grade:{CLASS_10|CLASS_11}

Geo-radius search:

"Find students named Kumar within 5km of Empire State Building (40.748817, -73.985428)"

β†’ Query: @name:Kumar with lat=40.748817, lng=-73.985428, radius=5, unit=km

Complex queries:

"Find active class 12 students at campus ZCA00123"

β†’ Query: @status:{ACTIVE} @grade:{CLASS_12} @campusId:{ZCA00123}

Redis Search Query Syntax

TEXT Fields (full-text search)

  • @name:Basavaraju - Contains "Basavaraju"
  • @givenName:Raj* - Starts with "Raj"
  • @familyName:"Kumar Singh" - Exact phrase

TAG Fields (exact match)

  • @status:{ACTIVE} - Single value
  • @status:{ACTIVE|PENDING_DUES} - OR condition
  • @grade:{CLASS_11|CLASS_12} - Multiple values

Available Fields

TEXT: name, givenName, familyName, middleName, geoAddress

TAG: status, grade, subscription, gender, campusId, primaryParentId, secondaryParentId

GEO: location (use with longitude, latitude, radius parameters)

NUMERIC: birthdate, startDate, updatedAt

Operators

  • * - Wildcard
  • | - OR (within tags)
  • - - NOT
  • () - Grouping

See src/schemas/redis-schema.txt for complete reference.

Docker Build

Important: Before building the Docker image, you must build and pack the Smithy models:

cd /Users/zeroman/workplace/nowzone/OPlatformStudentMCP

# Build and pack models
npm run model

# Build Docker image
docker build -t student-mcp:latest .

The Dockerfile expects src/generated/smithy-o-platform-client.tgz to exist before the build.

Kubernetes Deployment

Prerequisites

  1. Configure Pulumi secrets:
cd /Users/zeroman/workplace/nowzone/now-zeromoblt
pulumi config set studentApiEndpoint https://api.zeromoblt.com
pulumi config set --secret studentApiAuthToken "your-jwt-token"
  1. Import deployment in index.ts:
import "./deployments/student-mcp";
  1. Deploy:
pulumi up

View Logs

kubectl logs -n student-mcp-dev -l app=student-mcp-server -f

Project Structure

OPlatformStudentMCP/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ index.ts              # MCP server entry point
β”‚   β”œβ”€β”€ client/
β”‚   β”‚   └── apiClient.ts      # Student API HTTP client
β”‚   β”œβ”€β”€ tools/
β”‚   β”‚   β”œβ”€β”€ getStudent.ts     # Get student by ID tool
β”‚   β”‚   └── searchStudents.ts # Search students tool
β”‚   └── schemas/
β”‚       └── redis-schema.txt  # Redis search documentation
β”œβ”€β”€ package.json
β”œβ”€β”€ tsconfig.json
β”œβ”€β”€ Dockerfile
└── README.md

Environment Variables

VariableRequiredDescription
STUDENT_API_ENDPOINTYesStudent API base URL
STUDENT_API_AUTH_TOKENNoDefault JWT authentication token (can be overridden per-request)

Authentication

The server supports two authentication modes:

  1. Per-Request Token (Recommended): Pass authToken parameter with each tool call

    • Allows dynamic token refresh
    • More secure (token not hardcoded)
    • Example: { "id": "ZST123", "authToken": "eyJ..." }
  2. Default Environment Token: Set STUDENT_API_AUTH_TOKEN environment variable

    • Used when no token provided in request
    • Simpler for single-user scenarios

See for detailed authentication guide.

API Reference

Tools

get_student

Retrieve a student by their unique Zrn identifier.

Input:

{
  id: string  // Zrn format: Z[A-Z]{2}[0-9]{5,10}
}

Output: Full student object with all fields from Smithy model.

search_students

Search students using Redis FT.SEARCH syntax.

Input:

{
  query: string,          // Required: Redis FT.SEARCH query
  offset?: number,        // Pagination offset
  limit?: number,         // Results per page (max 100)
  longitude?: number,     // Geo search: center longitude
  latitude?: number,      // Geo search: center latitude
  radius?: number,        // Geo search: radius distance
  unit?: "km" | "mi"      // Geo search: distance unit
}

Output:

{
  students: StudentDetails[],
  total: number
}

Testing Queries

You can ask Claude questions like:

  • "How many active students are there?"
  • "Find all class 12 students at campus ZCA00123"
  • "Show me students within 10km of coordinates (17.367737, 78.563020)"
  • "List students with pending dues"
  • "Find students named Kumar in grades 11 or 12"

Troubleshooting

MCP Server Not Connecting

  1. Check Claude Desktop config path
  2. Verify environment variables are set
  3. Check logs: tail -f ~/Library/Logs/Claude/mcp*.log

Authentication Errors

  • Verify JWT token is valid and not expired
  • Check token has proper permissions for Student API

Build Errors

  • "Cannot find module '@smithy/o-platform-client'": Run npm run model to build and pack the Smithy models
  • Missing tarball in Docker build: Run npm run model before docker build
  • OPlatformModels build fails: Ensure Smithy models compile: cd ../OPlatformModels && ./gradlew clean build

Development

Watch Mode

npm run watch

Run Locally

npm run dev

License

MIT

Contributing

Generated from Smithy model at /Users/zeroman/workplace/nowzone/OPlatformModels/models/student.smithy