Skip to main content
Glama

DAMI Moodle Robot MCP Server v0.2.2

Zero-dependency MCP STDIO server for Xiaozhi/imcp. This version does not use @modelcontextprotocol/sdk, so it is lighter and easier for hosted MCP gateways to run from GitHub with npx.

imcp Manual STDIO configuration

Mode: STDIO

Command: npx

Arguments:

-y
--package
github:trantuandat0305/damirobot-mcp-server
damirobot-mcp-server

If the gateway still cannot load schemas, try the shorter argument form:

-y
github:trantuandat0305/damirobot-mcp-server

Environment variables:

VOICE=1
MOODLE_BASE_URL=https://elearning.anhngumsmy.com
DEFAULT_COURSEID=4
MOODLE_API_TOKEN=PUT_YOUR_TOKEN_HERE
REQUEST_TIMEOUT_MS=15000
MOODLE_TOOL_ENDPOINT=https://elearning.anhngumsmy.com/local/damirobot_api/api/tool.php

# Optional stricter whitelist.
# Leave empty to allow any non-empty speakerId produced by Xiaozhi voiceprint recognition.
# Example: ALLOWED_SPEAKER_IDS=id_1,id_2
ALLOWED_SPEAKER_IDS=

Related MCP server: moodle-mcp

Speaker authorization gate

All student-data tools are mandatory fail-closed before Moodle is called.

  • Missing/null/invalid speakerId: denied.

  • Sentinel values such as null, undefined, unknown, anonymous, guest, none: denied.

  • speakerId must come from Xiaozhi top-level params.speakerId; _meta.speakerId is accepted as fallback.

  • arguments.speakerId is deliberately ignored, so the LLM/tool arguments cannot grant access to themselves.

  • When ALLOWED_SPEAKER_IDS is empty, any valid Xiaozhi-recognized speakerId is accepted. This supports adding a new registered speaker without firmware changes or MCP code changes.

  • When ALLOWED_SPEAKER_IDS is configured, only exact IDs in that list are accepted.

  • test_connection remains available without speaker recognition because it exposes no student data.

  • There is no environment-variable bypass for the student-data guard.

Context isolation

The MCP server tracks the current recognized speaker so follow-up questions can work safely.

  • Same authorized speakerId: student follow-up context may be reused.

  • Different authorized speakerId: student/course/group follow-up context is cleared before the next data call.

  • Missing/denied speaker: all speaker-bound context is cleared.

This prevents a later speaker from inheriting the previous speaker's selected student.

Tests

npm run check
npm test

The regression suite verifies fail-closed behavior, argument spoof rejection, malformed speaker IDs, optional explicit allowlists, speaker-switch context isolation, same-speaker follow-up context, and the non-sensitive test_connection exception.

GitHub Actions runs these checks on pushes and pull requests to main.

Tools

  • test_connection

  • find_student

  • get_student_summary

  • get_student_attendance

  • get_missing_homework

  • get_student_suspend_status

  • get_student_dami_status

  • get_student_latest_scores

  • get_student_goal_status

  • get_student_fulltest_history

  • get_course_risk_students

Safety

  • Student-data tools require an authorized Xiaozhi speaker identity.

  • Read-only: only calls the Moodle DAMI Robot API.

  • Does not write, update, delete, suspend, check-in, or feed DAMI.

  • No token is stored in code. Put token only in environment variables.

Available Tools

11 tools
find_studentA

Tìm học viên theo tên/email/userid và lớp/course/group. Dùng khi giáo viên vừa nhắc tên học viên hoặc khi cần phân biệt trùng tên.

Inputs: email, userid, groupid, courseid, +3 more.

get_course_risk_studentsA

Dùng khi hỏi trong lớp/course có ai rủi ro, ai thiếu bài, ai chăm chỉ thấp, ai sắp bị đình chỉ hoặc cần nhắc nhở.

Inputs: limit, groupid, courseid, group_name, +1 more.

get_missing_homeworkB

Dùng khi hỏi học viên còn thiếu bài/nợ bài/chưa làm bài online nào. Không dùng cho câu hỏi thiếu bao nhiêu điểm.

Inputs: email, userid, groupid, courseid, +3 more.

get_student_attendanceA

Dùng khi hỏi điểm danh, đi học, nghỉ/vắng, trễ, cảnh báo C/D, nghỉ buổi nào hoặc lịch sử điểm danh gần đây của học viên.

Inputs: email, limit, userid, groupid, +4 more.

get_student_dami_statusB

Dùng khi hỏi điểm chăm chỉ/chuyên cần, giờ học, ngày học, streak, EXP, level DAMI, energy hoặc xếp hạng của học viên.

Inputs: email, userid, groupid, courseid, +3 more.

get_student_fulltest_historyB

Dùng khi hỏi lịch sử FULL TEST/LR, các bài FULL TEST gần nhất, 3-5 bài gần đây, điểm tăng hay giảm, xu hướng điểm hoặc tiến bộ qua các FULL TEST.

Inputs: email, limit, userid, groupid, +4 more.

get_student_goal_statusA

Dùng khi hỏi mục tiêu điểm thi, ngày thi, còn thiếu bao nhiêu điểm để đạt mục tiêu, đã đạt mục tiêu chưa hoặc tiến độ mục tiêu của học viên.

Inputs: email, userid, groupid, courseid, +3 more.

get_student_latest_scoresB

Dùng khi hỏi điểm gần nhất, điểm LR/Speaking/Writing, full test mới nhất, phần/part yếu nhất, phần/part mạnh nhất của học viên.

Inputs: email, userid, groupid, courseid, +3 more.

get_student_summaryA

Dùng khi giáo viên hỏi tổng quan/tình hình học tập của một học viên: điểm danh, bài thiếu, đình chỉ/bảo lưu, điểm gần nhất, DAMI level/EXP.

Inputs: email, userid, groupid, courseid, +3 more.

get_student_suspend_statusA

Dùng khi hỏi học viên có bị đình chỉ, khóa nick, bảo lưu, vi phạm, chờ xóa hoặc nguy cơ bị khóa chưa.

Inputs: email, userid, groupid, courseid, +3 more.

test_connectionA

Kiểm tra kết nối từ Xiaozhi/imcp MCP server tới DAMI Moodle Robot API. Chỉ dùng để test kỹ thuật.

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 11 tools

    Disambiguation5/5

    Each tool targets a distinct aspect of student data (e.g., attendance, scores, risk, suspensions). Descriptions are specific and clearly delineate when to use each, minimizing ambiguity.

    Naming Consistency5/5

    All tools follow a consistent verb_noun pattern with snake_case (e.g., get_student_attendance, find_student). The 'find_' variant is acceptable as it differs only in retrieval style.

    Tool Count5/5

    With 11 tools, the set covers the core student information needs without being excessive. Each tool serves a clear purpose within the educational domain.

    Completeness4/5

    The tools cover most common queries (attendance, scores, goals, risk, suspensions, summary). Missing a generic 'list students in course' tool, but the set is otherwise well-rounded for a read-only assistant.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers