Skip to main content

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

Проект не связан с НИУ ВШЭ. Работает только с вашим собственным аккаунтом и ходит в 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.


Возможности

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

Metadata

Release files for hse-lms-mcp 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hse-lms-mcp 0.1.0
File Size Uploaded Provenance Actions
hse_lms_mcp-0.1.0.tar.gz 33.4 kB With provenance Details for hse_lms_mcp-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hse-lms-mcp 0.1.0
File Interpreter ABI Platform Actions
hse_lms_mcp-0.1.0-py3-none-any.whl Python 3 none any Details for hse_lms_mcp-0.1.0-py3-none-any.whl

Total release size: 72.1 kB

Release files / hse_lms_mcp-0.1.0.tar.gz

Download URL hse_lms_mcp-0.1.0.tar.gz
Size 33.4 kB
Tags Source
SHA-256 checksum
How to use checksums
7148887d5ff9c44863810337906c6c070eeed7523500ec9dcfb30da5b80b3d0e
BLAKE2b-256 checksum
How to use checksums
0402c04cad1decfc036361ca032f7791fe5a013a50445969654e333766d0aa9a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Release files / hse_lms_mcp-0.1.0-py3-none-any.whl

Download URL hse_lms_mcp-0.1.0-py3-none-any.whl
Size 38.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
58e13c24bc01473bea70de720bd63ecc78c105dfdb6b1fcc9856358ab4726f0e
BLAKE2b-256 checksum
How to use checksums
920042c9b949c26aa3161f30a3fc926b5422d03f5d6dc1e884234daf6168acec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Security for hse-lms-mcp 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for hse_lms_mcp-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page