quiz-docente-mcp
Allows a teacher's AI agent to manage Moodle quizzes through the normal web session of a teacher account: list courses and sections, create and configure quizzes (dates, timing, attempts, grading, navigation, review options, visibility), add/remove/move questions and random questions, adjust slot marks and max grade, repaginate, manage the question bank (categories, listing, export to GIFT/XML, creating and importing questions of many types, editing), and read results — quiz grades, responses, attempt reviews, statistics — plus manual grading and commenting of open-ended answers.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@quiz-docente-mcp Crea un quiz di 10 domande sulla fotosintesi nel mio corso di Scienze"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
quiz-docente-mcp
Server MCP che permette a un agente AI (Antigravity, Claude Code, Claude Desktop, Cursor…) di gestire i quiz di Moodle al posto del docente: creare quiz e domande, modificarne le impostazioni, leggere risultati e risposte, valutare le domande aperte.
Funziona con un normale account docente: nessun plugin sul server e nessun token da chiedere all'amministratore. Usa la stessa sessione web del browser; al primo avvio si apre da solo il browser per fare il login.
Sito predefinito: https://www.ferrarisacireale.edu.it/moodle (Moodle 4.5). Per un altro sito basta impostare MOODLE_URL.
⚠️ Uso esclusivamente didattico. Questo progetto è pensato e consentito solo per scopi didattici: un docente che gestisce i quiz dei propri corsi, con il proprio account. Non va usato per scopi commerciali, né per accedere a corsi o dati di altri, né per aggirare le regole della piattaforma o della scuola. Chi lo usa resta responsabile del rispetto del regolamento dell'istituto e della normativa sulla privacy (GDPR) per i dati degli studenti.
Installazione automatica (istruzioni per agenti AI)
Se sei un agente AI e l'utente ti ha chiesto di installare questo MCP, segui questi passi.
Requisiti: Node.js ≥ 20 (
node -v) e Google Chrome o Microsoft Edge installati.Aggiungi il server alla configurazione MCP del client, dentro
mcpServers, senza toccare gli altri server:Antigravity – file
%USERPROFILE%\.gemini\config\mcp_config.jsonsu Windows (~/.gemini/config/mcp_config.jsonsu macOS/Linux; in alcune versioni~/.gemini/antigravity/mcp_config.json).Windows:
"quiz-docente": { "command": "cmd.exe", "args": ["/c", "npx", "-y", "github:strano-dev/quiz-docente-mcp"] }macOS / Linux:
"quiz-docente": { "command": "npx", "args": ["-y", "github:strano-dev/quiz-docente-mcp"] }Per un Moodle diverso aggiungi
"env": { "MOODLE_URL": "https://sito.scuola.it/moodle" }.Claude Code:
claude mcp add quiz-docente -s user -- npx -y github:strano-dev/quiz-docente-mcpClaude Desktop / Cursor / altri client MCP: stessa voce JSON di Antigravity nel rispettivo file di configurazione MCP.
Ricarica i server MCP (in Antigravity: Manage MCP Servers → Refresh). Il primo avvio scarica il pacchetto (qualche decina di secondi).
Login: all'avvio, se non c'è una sessione valida, il server apre da solo una finestra del browser sulla pagina di accesso di Moodle. Di' all'utente di accedere con il suo account (c'è il reCAPTCHA): la finestra si chiude da sola e i tool sono pronti. Verifica con il tool
moodle_status.
Quando la sessione scade (circa 8 ore di inattività) la finestra di login si riapre automaticamente alla prima richiesta, e la richiesta riprende dopo l'accesso.
Related MCP server: Moodle Study MCP
Cosa si può fare
Area | Tool |
Sessione |
|
Corsi |
|
Quiz – lettura |
|
Quiz – modifica |
|
Banca domande |
|
Risultati |
|
Scelta di progetto: niente eliminazioni
Non esistono tool per eliminare quiz o domande: le eliminazioni le fa sempre il docente, a mano, da Moodle.
moodle_remove_quiz_slots toglie una domanda da un quiz ma la lascia nella banca domande.
Un quiz che ha già tentativi degli studenti non permette di aggiungere o togliere domande (vincolo di Moodle).
Identificativi
courseid: id del corso (course/view.php?id=…)cmid: id del quiz come modulo del corso (mod/quiz/view.php?id=…)slot_id: posizione di una domanda nel quiz, damoodle_get_quizcategory_id,question_id: dai tool della banca domande, che accettanocourseid(banca del corso) oppurecmid(banca propria del quiz)
Configurazione
Variabile | Default | Significato |
|
| URL del sito Moodle |
|
|
|
| – |
|
|
| dove vengono salvati sessione e profilo del browser di login |
| – | percorso di chrome.exe / msedge.exe se non vengono trovati |
|
| attesa massima per l'accesso |
La sessione è salvata in ~/.moodle-mcp/session.json e contiene il cookie di accesso: non condividerla.
Login manuale da terminale: npx -y -p github:strano-dev/quiz-docente-mcp quiz-docente-mcp-login.
Sviluppo
git clone https://github.com/strano-dev/quiz-docente-mcp
cd quiz-docente-mcp
npm install
npm test # test unitari (Vitest)
npm run check # typecheck + test con copertura + build: da eseguire prima di ogni commit
npm run build # compila src/ in dist/ (dist/ è versionata: serve a npx per avviare senza build)
npm run login # login manuale
npm start # avvia il server MCP su stdioRegola: si procede sempre in TDD
Ogni modifica al codice segue il ciclo Test-Driven Development, senza eccezioni:
Red – scrivi prima un test in
test/che descrive il comportamento voluto e verifica che fallisca.Green – scrivi in
src/il codice minimo che lo fa passare.Refactor – migliora il codice tenendo tutti i test verdi.
Regole pratiche:
ogni bug si corregge partendo da un test che lo riproduce;
nessuna nuova funzione o nuovo tool MCP senza i relativi test;
i test unitari non chiamano mai il Moodle reale:
test/helpers/fake-moodle.tssimula il sito intercettandofetch,test/helpers/moodle-html.tsgenera pagine sintetiche con la stessa struttura di Moodle 4.5 (nessun dato reale), Playwright viene sostituito con un mock;prima di ogni commit
npm run checkdeve passare; le soglie minime di copertura (righe 90%, rami 80%) sono configurate invitest.config.tse fanno fallire la suite se non rispettate;dopo aver modificato
src/ricompila (npm run build) e versiona anchedist/.
File di test | Cosa copre |
| cookie, redirect, sessione scaduta, |
| lettura e invio dei form Moodle (checkbox avanzate, select, editor, date, durate, errori) |
| corsi e sezioni |
| struttura del quiz, impostazioni, creazione, slot, domande casuali, voto massimo, pagine |
| categorie, elenco/export, conversione JSON → Moodle XML, import con upload, modifica domande |
| voti, risposte, revisione tentativi, valutazione manuale, statistiche |
| finestra di login (Chrome/Edge), timeout, lock contro finestre multiple |
| elenco tool, modalità sola lettura, errori, login automatico con nuovo tentativo, mappatura argomenti |
| comando di login e variabili d'ambiente |
Come funziona
Moodle non espone ai docenti API per creare quiz e domande, quindi il server usa gli stessi endpoint dell'interfaccia web, ricavati analizzando il traffico del browser:
Funzione | Endpoint Moodle |
corsi, sezioni, quiz di un corso | AJAX |
struttura del quiz |
|
punteggio, rimozione, spostamento delle domande nel quiz |
|
aggiunta domande, voto massimo, ripaginazione | POST |
domande casuali | AJAX |
impostazioni e creazione quiz | form |
categorie |
|
elenco e lettura domande |
|
creazione / import domande | upload |
modifica domanda | form |
voti e risposte | `mod/quiz/report.php?mode=overview |
revisione e valutazione manuale |
|
Testato su Moodle 4.5.11. I report voti/risposte sono stati verificati solo su quiz senza tentativi di studenti (le anteprime del docente non compaiono nei report).
Licenza
MIT (vedi LICENSE). Resta valida l'indicazione d'uso esclusivamente didattico riportata all'inizio.
Available Tools
29 toolsmoodle_add_questions_to_quizAdd questions to quizB
Adds existing question-bank questions to a quiz (at the end, or to a given page).
Inputs: cmid (required), question_ids (required), page.
moodle_add_random_questionsAdd random questionsB
Adds N random-question slots drawing from a question category (each student gets different questions).
Inputs: cmid (required), count (required), category_id (required), page, +2 more.
moodle_create_question_categoryCreate question categoryC
Creates a question category (optionally under a parent category).
Inputs: name (required), cmid, info, courseid, +1 more.
moodle_create_questionsCreate questionsA
Creates one or more questions in a question-bank category from structured definitions (multichoice, truefalse, shortanswer, numerical, essay, match, description). Returns the new question ids.
Inputs: questions (required), category_id (required), cmid, courseid.
moodle_create_quizCreate quizA
Creates a new quiz in a course section. New quizzes are hidden by default (visible=false) unless visible=true is passed. Returns the new cmid.
Inputs: name (required), section (required), courseid (required), intro, +22 more.
moodle_export_questionsExport a question categoryBRead-only
Exports all questions of a category in GIFT (compact, readable) or Moodle XML (complete).
Inputs: category_id (required), cmid, format, courseid, +1 more.
moodle_get_attempt_reviewAttempt reviewARead-only
Detailed review of a single attempt: per question text, answer given, state, mark, feedback, whether manual grading is needed.
Inputs: attempt_id (required).
moodle_get_questionGet questionBRead-only
Full definition of a question (text, answers, fractions, feedback, settings) as Moodle XML. Embedded images are omitted unless include_files=true.
Inputs: question_id (required), cmid, courseid, include_files.
moodle_get_quizGet quizCRead-only
Quiz structure (slots with slot id, page, question id, name, type, mark), totals, editability, plus the main settings.
Inputs: cmid (required).
moodle_get_quiz_gradesQuiz gradesBRead-only
Overview report: each attempt with state, times, total grade and per-question marks, plus attempt ids for moodle_get_attempt_review.
Inputs: cmid (required), attempts.
moodle_get_quiz_responsesQuiz responsesCRead-only
Responses report: the answer each student gave to each question (optionally with the right answer and question text).
Inputs: cmid (required), attempts, include_right_answer, include_question_text.
moodle_get_quiz_settingsGet quiz settingsBRead-only
All quiz settings (timing, attempts, grading, layout, behaviour, review options, visibility). include_raw=true also returns every raw form field.
Inputs: cmid (required), include_raw.
moodle_get_quiz_statisticsQuiz statisticsCRead-only
Statistics report (facility index, discrimination, etc.) of a quiz.
Inputs: cmid (required).
moodle_grade_attempt_questionGrade a question in an attemptB
Manually sets the mark (and optional comment) of one question in a student attempt, e.g. essay questions.
Inputs: mark (required), slot (required), attempt_id (required), comment.
moodle_import_questionsImport questions (GIFT / XML / Aiken)A
Imports questions from text in GIFT, Moodle XML, Aiken, missing-word or Cloze (multianswer) format into a category. Supports every question type. Returns the new question ids.
Inputs: format (required), content (required), category_id (required), cmid, +2 more.
moodle_list_coursesList my coursesCRead-only
Courses the user is enrolled in (id, name, category).
Inputs: classification.
moodle_list_question_categoriesList question categoriesBRead-only
Question categories of the course (or quiz) question bank with ids and question counts.
Inputs: cmid, courseid.
moodle_list_questionsList questions in a categoryCRead-only
Questions of one category: id, name, type, status, version, usage count.
Inputs: category_id (required), cmid, courseid.
moodle_list_quizzesList quizzes of a courseBRead-only
All quizzes in a course with cmid, visibility and section.
Inputs: courseid (required).
moodle_list_sectionsList course sectionsBRead-only
Sections (topics) of a course with their numbers, needed to choose where to create a quiz.
Inputs: courseid (required).
moodle_loginSign in to MoodleA
Opens a browser window on the Moodle login page; the user signs in (reCAPTCHA) and the session is saved for the next calls. Normally not needed: the server opens the login window by itself when the session is missing or expired. Blocks until the login completes or times out.
Inputs: no named parameters.
moodle_move_quiz_slotReorder quiz questionB
Moves a slot after another slot (after_slot_id) or to the beginning (after_slot_id omitted).
Inputs: cmid (required), slot_id (required), page, after_slot_id.
moodle_remove_quiz_slotsRemove questions from quizADestructive
Removes slots from a quiz (the questions stay in the question bank). Use slot ids from moodle_get_quiz.
Inputs: cmid (required), slot_ids (required).
moodle_repaginate_quizRepaginate quizB
Re-paginates the quiz with N questions per page (0 = all on one page).
Inputs: cmid (required), questions_per_page (required).
moodle_set_quiz_max_gradeSet quiz maximum gradeB
Sets the maximum grade of the quiz (e.g. 10), rescaling the sum of marks.
Inputs: cmid (required), max_grade (required).
moodle_set_slot_markSet question mark in quizC
Sets the maximum mark of one quiz slot.
Inputs: cmid (required), mark (required), slot_id (required).
moodle_statusSession statusARead-only
Checks whether the saved Moodle session is valid and who is signed in.
Inputs: no named parameters.
moodle_update_questionUpdate questionB
Edits an existing question (Moodle saves it as a new version). Only the given fields change. "answers" replaces the whole answer list (multichoice/shortanswer/numerical); "correct" is for truefalse.
Inputs: question_id (required), cmid, name, text, +10 more.
moodle_update_quiz_settingsUpdate quiz settingsC
Changes quiz settings; only the given fields are modified. Returns the settings after saving.
Inputs: cmid (required), name, intro, review, +21 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 29 tools
Most tools have crisply separated purposes: quiz structure vs settings vs grades vs responses vs statistics vs attempt review are clearly delineated, as are the slot-manipulation tools. The main overlaps are moodle_create_questions vs moodle_import_questions (both create questions, differing only in input format) and moodle_get_quiz vs moodle_get_quiz_settings, but the descriptions make the boundary reasonably clear.
Every tool follows the same moodle_verb_noun snake_case pattern with a consistent server prefix (moodle_get_quiz, moodle_list_questions, moodle_create_quiz, moodle_set_slot_mark). Verb choice is predictable by intent: list_* for enumeration, get_* for single-resource detail, create/update/remove/add/move/set for mutations.
At 29 tools the surface is heavy and sits above the comfortable range, though the breadth follows from a genuinely large domain (quizzes, slots, question bank, grading, reports). Almost every tool maps to a distinct Moodle operation, so the size is defensible, but several could be consolidated (e.g. get_quiz/get_quiz_settings, create/import questions).
Read and authoring coverage is strong across quizzes, slots, questions and grading, but destructive lifecycle operations are entirely absent: no delete_quiz, delete_question, delete_question_category, or delete/duplicate quiz, and no enrollment/participant listing. These gaps will force agents to fall back on the Moodle web UI for common cleanup tasks.
Maintenance
Related MCP Connectors
Create, edit and publish Educaplay educational games and quizzes from any AI assistant.
Create, edit, translate, and export SCORM eLearning modules from a connected AI assistant.
Teachable MCP server for ChatGPT, Claude and any AI agent: update lecture, create coupon, send email, reply to comment and list enrollments in your own Teachable account. Cotlet works in the account through your Cloud Browser, a real Chrome where you sign in to Teachable yourself; Cotlet does not store your password and you need no Teachable API key. About the official Teachable API: Teachable has a public API, but only on the Growth plan and up, and it reads courses and lecture content and manages users, enrollments, pricing plans and transactions (checked 11 Oct 2026). Lesson editing, coupons, emails to students and comments are not in it. Setup and FAQ: https://cotlet.dev/integrations/teachable-api-mcp-server
Build forms, quizzes, and surveys from your AI assistant. Create, edit, publish, and read responses.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to interact with Moodle LMS via the Moodle REST API, supporting management of courses, users, enrollments, grades, and content.1GPL 3.0
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to read your Moodle courses, list materials, quizzes, and search content to plan exam preparation through natural language.1-
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to query and manage Moodle LMS data, including assignment deadlines, unread messages, unfinished quizzes, and enrolled courses, using natural language via OpenAI or local LLMs.-
- AlicenseBqualityAmaintenanceEnables an AI assistant to handle teacher tasks in Moodle: view enrolments, submissions, missing work, grade with feedback, and post announcements.22MIT