Skip to main content
Glama

elearn-mcp

MCP server for elearn.ut.ac.ir (University of Tehran Moodle). One SSO login serves every student id of the user.

Unofficial and not affiliated with the University of Tehran. It acts only with your own login. Follow each course's rules: many courses require individual work, and anything uploaded with this tool is your own submission.

Setup

uv sync
security add-generic-password -s elearn-mcp -a <you>@ut.ac.ir -w   # SSO password

Register it in your MCP client as a stdio server: command uv run --project <repo> elearn-mcp, env ELEARN_USERNAME=<you>@ut.ac.ir. The password is read from ELEARN_PASSWORD or, if unset, from the macOS Keychain (service elearn-mcp, account = username). Never put it in a config file.

Variable

Default

Use

ELEARN_DOWNLOAD_DIR

~/Documents/elearn/downloads

assignment attachments

ELEARN_MATERIALS_DIR

~/Documents/elearn/materials

course materials + text copies

TELEGRAM_BOT_TOKEN, TELEGRAM_CHAT_ID

Keychain

Telegram notifications (set HTTPS_PROXY if Telegram is blocked)

KAVENEGAR_API_KEY, SMS_RECEPTOR, KAVENEGAR_SENDER

Keychain

SMS via Kavenegar

Secrets can live in the Keychain under service elearn-mcp with the variable name as account: security add-generic-password -s elearn-mcp -a TELEGRAM_BOT_TOKEN -w.

Related MCP server: mti-lms-mcp

Tools

Area

Tools

accounts, courses

list_accounts, list_courses, course_contents, external_link

assignments

list_deadlines, all_deadlines, get_assignment, download_attachments

files

download_module, download_course_materials, list_materials, read_material

grades, messages

grades, notifications

submission

prepare_submission -> confirm_submission(token), remove_submission(confirm=true)

notifications

send_notification, watch_now

background jobs

start_materials_job, start_watch_round, start_agents, job_status

Submitting always takes two calls. prepare_submission checks files and limits and returns a single-use token (10 min); confirm_submission uploads only if the files did not change. On these courses saving counts as "submitted for grading" (no draft mode).

read_material pages through text extracted from PDF, PPTX, DOCX and notebooks; Persian PDF text is normalised (letter forms, word breaks, reversed digits). Parentheses around Latin text on its own line can still come out swapped.

Watcher

uv run elearn-watch --channels macos,telegram --interval 900   # --once for a single round

Sends one Persian message per change: new assignment, deadline within 24 h (once), new grade, new site notification, new course file. State: ~/.local/state/elearn-mcp/state.json. The first round only reports close deadlines, so it does not flood.

Background jobs (Celery + Redis)

brew services start redis                 # local only (127.0.0.1)
ELEARN_USERNAME=<you>@ut.ac.ir uv run elearn-worker   # runs the jobs (thread pool, ELEARN_WORKERS=3)
ELEARN_USERNAME=<you>@ut.ac.ir ELEARN_WATCH_CHANNELS=macos,telegram uv run elearn-beat   # watcher every ELEARN_WATCH_INTERVAL s (900)
  • start_materials_job downloads a course in the background; job_status(job_id) returns the summary.

  • start_agents(parts) runs up to 6 parts in parallel. Each part is {"prompt", "workdir"}; the workdir must be inside ELEARN_JOBS_ROOT (default ~/Desktop/myprojects/elearn-runs). Each part runs ELEARN_AGENT_CMD (default elearn-agent, a script you provide on PATH) as <cmd> -p --output-format json --max-turns N with the prompt on stdin and ELEARN_AGENT_MODEL=<model> (when given); output goes to <workdir>/.jobs/<task id>.json. The caller reviews the results; nothing is submitted.

  • Jobs wait in Redis while the worker is down and run when it starts again.

Development

uv run pytest -q && uv run ruff check . && uv run ruff format --check .

Tests use sanitized real pages in tests/fixtures and never touch the network. Site facts and the verified login/upload flow are in PLAN.md.

Available Tools

23 tools
all_deadlinesB

List deadlines of every student id, each with an 'account' key, sorted by due.

Inputs: days_back. Returns: result

confirm_submissionB

Upload a prepared submission; the token is single use.

Inputs: token (required).

course_contentsC

List the sections and items of one course.

Inputs: account (required), course_id (required). Returns: result

download_attachmentsC

Download every attachment of one assignment; returns the file paths.

Inputs: cmid (required), account (required). Returns: result

download_course_materialsC

Download every resource and folder of a course; returns the manifest summary.

Inputs: account (required), course_id (required), extract.

download_moduleC

Download the files of a course resource or folder; returns the file paths.

Inputs: cmid (required), module (required), account (required). Returns: result

get_assignmentC

Fetch and parse one assignment page.

Inputs: cmid (required), account (required).

gradesC

List the grades of one student id.

Inputs: account (required). Returns: result

job_statusC

Return the state and result of a background job.

Inputs: job_id (required).

list_accountsA

List the student ids owned by the SSO user.

Inputs: no named parameters. Returns: result

list_coursesC

List enrolled courses for one student id.

Inputs: account (required). Returns: result

list_deadlinesC

List upcoming deadlines for one student id.

Inputs: account (required), limit, days_back. Returns: result

list_materialsC

List the downloaded materials of a course (paths are relative to the course dir).

Inputs: account (required), course_id (required). Returns: result

notificationsC

List recent notifications of one student id.

Inputs: account (required), limit. Returns: result

prepare_submissionB

Check a submission without uploading; returns a token for confirm_submission.

Inputs: cmid (required), paths (required), account (required).

read_materialB

Read the text of one course material, paged by offset/max_chars.

Inputs: path (required), account (required), course_id (required), offset, +1 more.

remove_submissionC

Remove the submitted files of an assignment; returns the new status.

Inputs: cmid (required), account (required), confirm.

send_notificationC

Send a notification through the given channels (default: macos).

Inputs: text (required), channels.

start_agentsB

Run the parts in parallel on the free worker model; review results with job_status.

Inputs: parts (required), model.

start_materials_jobC

Start a background job that downloads a course's materials; returns the job id.

Inputs: account (required), course_id (required), extract.

start_watch_roundC

Start a background watcher round; returns the job id.

Inputs: channels.

watch_nowC

Run one watcher round now and notify on changes.

Inputs: channels. Returns: result

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    C2.9/5.0

    Scored across 23 tools

    Disambiguation4/5

    Most tools have distinct purposes, but a few execution-mode pairs blur boundaries: watch_now vs start_watch_round and download_course_materials vs start_materials_job. Descriptions usually clarify the difference, though list_materials (downloaded materials only) vs download_course_materials is a subtle trap.

    Naming Consistency3/5

    Many names follow verb_noun (list_courses, download_attachments, prepare_submission), but several are bare nouns or noun phrases (grades, notifications, course_contents, external_link, job_status). All use snake_case, so it is readable, but the convention is mixed.

    Tool Count3/5

    23 tools is on the heavy side for a student e-learning client. Several synchronous/background pairs and niche orchestration tools (start_agents, start_watch_round) could be consolidated without losing functionality.

    Completeness4/5

    The surface covers the core lifecycle: accounts, courses, deadlines, grades, notifications, course contents, material downloads/reads, assignment fetching, submission preparation/confirmation/removal, and background jobs. Minor gaps remain, such as no job cancellation and no all-accounts course listing, but workarounds exist.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Connects any MCP-compatible AI assistant to a student's Moscow Technological Institute portal (lms.mti.moscow) over stdio or HTTP. Enables reading schedules, courses, assignments, grades, notifications, messages, curriculum and finance data, and safely submitting coursework with dry-run confirmation.
      MIT
    • A
      license
      A
      quality
      A
      maintenance
      A local stdio MCP server that lets students query their HSE (NIU VShE) accounts: SmartLMS courses, materials, assignments, grades and internal messages, plus the ELK personal cabinet — schedule, academic record, services, requests and notifications. It also assembles day/week summaries, deadline alerts and change tracking, with optional write tools for submitting assignments kept off by default.
      21
      485 npm
      1
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI clients over stdio MCP to query XJTLU Learning Mall Core (Moodle) courses, download course materials and attachments, inspect deadline sources, and view upcoming deadlines.
      MIT