Summary
Add a Model Context Protocol (MCP) server that allows AI assistants (e.g. Claude) to answer data-specific questions against live or reporting-database LMS data in natural language.
Motivation
Operators, course teams, and analysts regularly need answers to questions like:
- "How many learners enrolled in Course X last week?"
- "Which problem in Course Y has the lowest success rate?"
- "Show me the grade distribution for a given subsection."
Today those answers require writing custom queries, navigating multiple admin dashboards, or waiting on a data team. An MCP server exposes structured, pre-validated tools so that Claude (or any MCP-compatible client) can answer these questions directly against LMS data — without the user needing to know the underlying schema.
Proposal
A standalone Python MCP server that:
- Connects to a MySQL read replica (or dedicated reporting DB) via a read-only service account
- Exposes a focused set of tools covering enrollment, grades, certificates, and learner progress
- Validates and sanitizes all inputs; enforces per-query timeouts
- Returns structured JSON that the AI client interprets and summarizes for the user
Architecture
AI assistant (MCP client, e.g. Claude)
│
▼
openedx-mcp-server (Python, mcp SDK)
│ read-only service account
▼
MySQL read replica ─── or ─── reporting DB (e.g. Aspects / data warehouse)
Safety constraints:
- DB user granted
SELECT only — no writes possible at the DB level
- No raw SQL passthrough; all queries are pre-written and parameterized
- Per-query timeout enforced (default 5 s)
- Aggregate tools return counts only; per-learner tools require explicit
include_pii=true and the caller is responsible for access control
V1 Scope
In scope: read-only queries against MySQL for enrollment, grades, certificates, and course metadata.
Out of scope for v1: writes of any kind, MongoDB queries, real-time event streams, unauthenticated PII export, data warehouse / Aspects integration (v2).
Tools
| Tool |
Description |
Key tables |
get_enrollment_stats |
Enrollment counts and trends for a course, filtered by date range and/or enrollment mode |
student_courseenrollment |
get_active_learners |
DAU / WAU / MAU counts for a course |
student_courseenrollment, courseware_studentmodule |
get_grade_distribution |
Grade histogram per course or subsection |
grades_persistentcoursegrade, grades_persistentsubsectiongrade |
get_problem_stats |
Per-problem success rates, attempt counts, difficulty ranking |
courseware_studentmodule |
get_learner_progress |
Unit-level completion and scores for a single learner in a course |
courseware_studentmodule, grades_persistentsubsectiongrade |
get_certificate_stats |
Certificates issued and passing-threshold breakdown |
certificates_generatedcertificate |
list_active_courses |
Running courses for an org with enrollment counts |
student_courseenrollment, course_overviews_courseoverview |
Task List
Setup
Tools
Quality
Additional Info
Summary
Add a Model Context Protocol (MCP) server that allows AI assistants (e.g. Claude) to answer data-specific questions against live or reporting-database LMS data in natural language.
Motivation
Operators, course teams, and analysts regularly need answers to questions like:
Today those answers require writing custom queries, navigating multiple admin dashboards, or waiting on a data team. An MCP server exposes structured, pre-validated tools so that Claude (or any MCP-compatible client) can answer these questions directly against LMS data — without the user needing to know the underlying schema.
Proposal
A standalone Python MCP server that:
Architecture
Safety constraints:
SELECTonly — no writes possible at the DB levelinclude_pii=trueand the caller is responsible for access controlV1 Scope
In scope: read-only queries against MySQL for enrollment, grades, certificates, and course metadata.
Out of scope for v1: writes of any kind, MongoDB queries, real-time event streams, unauthenticated PII export, data warehouse / Aspects integration (v2).
Tools
get_enrollment_statsstudent_courseenrollmentget_active_learnersstudent_courseenrollment,courseware_studentmoduleget_grade_distributiongrades_persistentcoursegrade,grades_persistentsubsectiongradeget_problem_statscourseware_studentmoduleget_learner_progresscourseware_studentmodule,grades_persistentsubsectiongradeget_certificate_statscertificates_generatedcertificatelist_active_coursesstudent_courseenrollment,course_overviews_courseoverviewTask List
Setup
tools/mcp/subdirectory in this repomcpSDK)Tools
get_enrollment_statsget_active_learnersget_grade_distributionget_problem_statsget_learner_progressget_certificate_statslist_active_coursesQuality
Additional Info