Skip to main content
Glama

hse-lms-mcp

Неофициальный SDK, CLI и MCP-сервер для SmartLMS ВШЭ (edu.hse.ru). Курсы, дедлайны, оценки, задания, форумы и файлы из LMS в коде, в терминале или у ИИ-агента: Claude, Cursor и любой MCP-клиент.

PyPI Python License CI Image Docs

Полная документация → alexeyshalaev.github.io/hse-lms-mcp

TIP

Пишете интеграцию с ИИ-ассистентом? Дайте ему одну страницу вместо всего сайта: весь API, правила, без которых код ломается (пароль пробуется один раз, тип модуля нужен для module(), запись только по явному разрешению), и ошибки, которые модели делают с этим API.

Проект не связан с НИУ ВШЭ. Работает только с вашим собственным аккаунтом и ходит в LMS как браузер: не чаще запроса в 0,7 с и только по https на edu.hse.ru и saml.hse.ru.


Quick start

uv tool install hse-lms-mcp
hse-lms login --setup        # почта и пароль ВШЭ, пароль уйдёт в системную связку ключей
hse-lms deadlines --ahead 14

Подключить к Claude Code:

claude mcp add hse-lms -- uvx hse-lms-mcp

И спросить агента: «какие у меня дедлайны на этой неделе и что уже сдано?»

До первого релиза на PyPI ставьте из GitHub: uv tool install git+https://github.com/AlexeyShalaev/hse-lms-mcp и uvx --from git+https://github.com/AlexeyShalaev/hse-lms-mcp hse-lms-mcp.


Related MCP server: Moodle MCP Server

Возможности

SDK (hse_lms.Lms)

CLI (hse-lms)

MCP-инструмент

Проверить сессию, войти заново

login(), whoami()

login

whoami

Мои курсы

courses()

courses

list_courses

Разделы и элементы курса

course(id)

course <id>

get_course

Дедлайны по всем курсам

deadlines()

deadlines

get_deadlines

Задание: описание, сроки, статус сдачи, отзыв

module(cmid, "assign")

module <cmid> --type assign

get_module

Страница, ссылка, тест, папка, файл

module(cmid, type)

module

get_module

Оценки по курсу

grades(id)

grades <id>

get_grades

Форум (объявления)

forum(cmid)

forum <cmid>

get_forum

Скачать файл

download(url_or_cmid)

download

download_file

Сдать задание (выключено по умолчанию)

submit_assignment(cmid, files)

submit

submit_assignment

Вход двумя способами, их можно сочетать:

  • логин и пароль ВШЭ: из переменных окружения, Docker-секрета, системной связки ключей или credentials.json. Пока жива SSO-сессия Keycloak, сессия LMS продлевается без пароля, а пароль пробуется максимум один раз;

  • кука MoodleSession из браузера (HSE_LMS_COOKIE).

Где запускать: локально через stdio, на своём сервере по HTTP с bearer-токеном (ghcr.io/alexeyshalaev/hse-lms-mcp) или просто как библиотеку в своём коде.

SDK

from hse_lms import Lms

with Lms() as lms:  # или Lms(cookie="..."), Lms(username="...", password="...")
    for d in lms.deadlines(days_ahead=14):
        print(d.due, d.course, d.name)

    detail = lms.module(67890, "assign")
    if detail.submission and not detail.submission.submitted:
        print("ещё не сдано:", detail.title)

Безопасность

  • Пароль, куки и sesskey не попадают в вывод, логи и тексты ошибок; сессия хранится с правами 600.

  • Пароль пробуется один раз за процесс: Keycloak блокирует аккаунт за перебор.

  • Редирект на другой хост, на http или на другой порт считается ошибкой. logout.php не вызывается.

  • Запись в LMS включается только явно; перед сдачей проверяются настройки задания, после сдачи файлы сверяются по SHA-256.

Один экземпляр обслуживает один аккаунт. Не разворачивайте общий сервер, куда другие люди вводят пароли ВШЭ.

Документация

Разработка

make install   # uv sync --group dev
make check     # ruff + mypy
make test      # тесты с покрытием
make docs-serve

Тесты не ходят в настоящую LMS: сеть подменяется httpx.MockTransport, HTML в тестах обезличен. Подробнее в CONTRIBUTING.md.

Лицензия

Apache 2.0

Available Tools

8 tools
download_fileA
Idempotent

Download a course file into the server's download directory and return its path.

Inputs: target (required). Returns: name, path, size

get_courseB
Read-onlyIdempotent

Sections of a course with their visible modules (cmid, type, name, url).

Inputs: course_id (required), include_text. Returns: sections, course_id

get_deadlinesC
Read-onlyIdempotent

Due dates and closing times across all courses from the LMS calendar.

Inputs: days_back, days_ahead. Returns: result

get_forumC
Read-onlyIdempotent

Latest discussions of a forum module (e.g. announcements) with posts.

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

get_gradesC
Read-onlyIdempotent

The user's grade report for a course.

Inputs: course_id (required). Returns: result

get_moduleB
Read-onlyIdempotent

Details of one activity: description, dates, attached files; for assignments the submission status and feedback, for pages the text, for url modules the target. type may be omitted after get_course.

Inputs: cmid (required), type. Returns: cmid, text, type, dates, +6 more

list_coursesC
Read-onlyIdempotent

Courses the user is enrolled in.

Inputs: classification. Returns: result

whoamiA
Read-onlyIdempotent

Check the LMS session (logging in again if needed) and return the user id.

Inputs: no named parameters. Returns: userid, login_path

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 8 tools

    Disambiguation5/5

    Each tool targets a clearly distinct resource or action: session state (whoami), course listing vs. course structure (list_courses vs. get_course), activity details (get_module), deadlines, grades, forums, and file download. The get_course/get_module boundary is explicitly clarified in the descriptions (course gives structure with cmids, module gives one activity's details).

    Naming Consistency4/5

    Seven of eight tools follow a clean verb_noun pattern (get_course, list_courses, get_deadlines, get_module, get_grades, get_forum, download_file), with verbs consistently matching read semantics. whoami is the sole deviation, using an unconventional non-verb_noun name.

    Tool Count5/5

    Eight tools is well within the sweet spot and each one maps to a distinct LMS lookup or retrieval need. There are no redundant or filler tools; every entry earns its place in typical student workflows.

    Completeness3/5

    The surface is purely read-oriented: it covers browsing, deadlines, grades, forums, and downloads, but there is no way to submit an assignment, post or reply to a forum, mark activities complete, or otherwise mutate LMS state. Reading submission status without any submission operation is a notable dead end for an LMS client.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables users to access and manage course data, assignments, grades, announcements, discussions, pages, modules, and files from their institution's learning management system via terminal commands or MCP-compatible AI agents, including previewing and confirming assignment submissions.
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Gives AI agents read-only access to a learning platform's courses, assignment details and deadlines, and downloadable course files through the official Web Services API. It automatically works around VPN/DPI network blocking and incomplete TLS certificate chains, and deliberately offers no submission or upload tools.
      8
      MIT
    • A
      license
      B
      quality
      B
      maintenance
      Connects AI assistants to any Moodle site through the official mobile web service, with a limited browser-session fallback, enabling access to courses, grades, deadlines, assignments, quizzes, forums, and course files. It also supports reading and downloading files and uploading or submitting assignment work under explicit confirmation.
      34
      ISC
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI agents to authenticate through ENT/CAS and browse courses, read and submit assignments, download course files, check grades and deadlines, manage quizzes, and interact with Moodle pages via Markdown or a headless browser.
      19
      MIT