K12 Safety MCP Server
Overview
The K12 Safety MCP Server exposes the complete K12 Education tool registry, covering Emergency Operation Plan (EOP) operations, scenario-specific annex kickoffs, role lookup helpers, and Quick Reference Guide (QRG) workflows. With 28 registered tools, it is the largest MCP server in the platform.
Server Metadata
| Property | Value |
|---|---|
| Factory | createK12SafetyMcpServer() |
| Source | packages/domain-k12/src/mcp-server.ts |
| Version | 1.0.0 |
| Tool Count | 28 (21 EOP/annex/role tools + 7 QRG) |
| Skip Flag | MASTRA_SKIP_K12_MCP |
| Tool Registry | packages/domain-k12/src/tools.ts |
Factory Implementation
// packages/domain-k12/src/mcp-server.ts
import { MCPServer } from '@mastra/mcp';
import { k12SafetyTools } from './tools.ts';
export const createK12SafetyMcpServer = () =>
new MCPServer({
name: 'K12 Safety MCP Server',
version: '1.0.0',
description:
'Provides tools for assessing K12 content safety signals and retrieving escalation guidance.',
tools: k12SafetyTools,
});
Tool Registry
The tool registry at packages/domain-k12/src/tools.ts exports 28 tools. The QRG tools are spread from packages/domain-k12/src/qrg/index.ts; the remaining tools live in the top-level K12 package.
EOP, Annex, and Role Tools (21)
| Tool ID | Description |
|---|---|
k12-lkp-task-status-by-session-or-request | Query monitoring rows by sessionId or requestId to show status history |
k12-lkp-task-request-result | Fetch the persisted request row and attached response fields |
k12-insert-task-in-monitoring-table | Insert a status/monitoring row into K12SAFETY.log_EOP_TaskStatus |
k12-insert-task-request-log | Insert a full workflow request into K12SAFETY.log_EOP_TaskRequests |
k12-update-task-request-response | Record the workflow's final response payload into the request log |
k12-update-task-status | Update an existing monitoring row's status and message |
k12-cancel-task-request | Request cancellation for an in-flight workflow run |
k12-annex-editing-kickoff | Main entry point to kick off the EOP/Annex editing workflow |
k12-district-planning-kickoff | Start the district-planning annex scenario workflow |
k12-facility-planning-kickoff | Start the facility-planning annex scenario workflow |
k12-functional-annex-kickoff | Start the functional-annex scenario workflow |
k12-hazard-annex-kickoff | Start the hazard-annex scenario workflow |
k12-functional-annex-suggest-roles-kickoff | Suggest EOP roles for functional-annex planning |
k12-hazard-annex-suggest-roles-kickoff | Suggest EOP roles for hazard-annex planning |
k12-functional-annex-suggest-responsibilities-kickoff | Suggest responsibilities for functional-annex planning |
k12-hazard-annex-suggest-responsibilities-kickoff | Suggest responsibilities for hazard-annex planning |
k12-annex-editing-status | Poll the status of an in-flight EOP editing workflow |
k12-annex-editing-result | Retrieve the final result of a completed EOP editing workflow |
k12-get-emergency-operation-plan-snapshot | Get an EOP snapshot from MOEOP for contextual prompts |
k12-get-selected-eop-roles | Read selected EOP role assignments for a plan/context |
k12-get-eop-role-universe | Read the available EOP role universe |
QRG Tools (7)
These tools are defined in packages/domain-k12/src/qrg/index.ts and spread into the main tool registry:
| Tool ID | Description |
|---|---|
k12-qrg-generation-kickoff | Start a QRG generation workflow from an EOP |
k12-qrg-generation-status | Poll the status of a QRG generation workflow |
k12-qrg-generation-result | Retrieve the final generated QRGs |
k12-qrg-editing-kickoff | Start a QRG editing workflow |
k12-qrg-editing-status | Poll the status of a QRG editing workflow |
k12-qrg-editing-result | Retrieve the result of a QRG editing workflow |
k12-qrg-cancel | Cancel an in-flight QRG generation or editing workflow |
Implementation Notes
QRG Sub-Module Pattern
The QRG tools are maintained in a separate sub-module (./qrg/index.ts) for organizational clarity but are spread into the top-level registry using the object spread operator:
// packages/domain-k12/src/tools.ts
import { annexEditingKickoffTool } from './annex-editing-kickoff.ts';
import { insertTaskRequestTool } from './insert-task-request-tool.ts';
import { qrgTools } from './qrg/index.ts';
export const k12SafetyTools = {
'k12-annex-editing-kickoff': annexEditingKickoffTool,
'k12-insert-task-request-log': insertTaskRequestTool,
// Other EOP, annex scenario, status/result, and role tools...
...qrgTools, // 7 QRG tools merged into the flat registry
};
This means all 28 tools appear as a flat list in the MCP server -- there is no sub-grouping visible to MCP clients.
Domain Gating
The K12 Safety MCP server is only loaded when MASTRA_TARGET includes k12 (or is set to all). It can also be explicitly disabled via MASTRA_SKIP_K12_MCP regardless of the target.
Database Dependencies
Most K12 tools require an active Azure SQL connection. The tools use the K12SAFETY schema with tables including:
log_EOP_TaskRequests-- Full request/response payloadslog_EOP_TaskStatus-- Status monitoring rowslog_Jobs-- General job trackingqrg_requests,qrg_generations,qrg_generated_items-- QRG lifecycle
MOEOP Integration
The k12-get-emergency-operation-plan-snapshot tool calls an external MOEOP (Missouri EOP) API to fetch plan documents. This requires the K12_MOEOP_API_ENDPOINT environment variable to be configured.
Code Locations
- Server factory:
packages/domain-k12/src/mcp-server.ts - Tool registry:
packages/domain-k12/src/tools.ts - QRG sub-module:
packages/domain-k12/src/qrg/index.ts - Individual tools:
packages/domain-k12/src/*.ts - Tests:
tests/shared/unit/mcp-servers/mcp-servers.test.ts(K12 Safety MCP Server describe block) - Tool-level tests:
packages/domain-k12/tests/tools/