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

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

Клиент Как подключить
Claude Code claude mcp add --scope user --transport stdio hse-lms -- uvx hse-lms-mcp
Codex codex mcp add hse-lms -- uvx hse-lms-mcp
OpenCode opencode mcp add hse-lms --global -- uvx hse-lms-mcp
oh-my-pi (omp) ~/.omp/agent/mcp.json: "hse-lms": {"type": "stdio", "command": "uvx", "args": ["hse-lms-mcp"]}
Claude Desktop, Cursor, VS Code, Zed, Gemini CLI готовые конфиги

Подробно, с переменными окружения и подключением к своему серверу по HTTP: Подключение к ИИ-клиентам.

Свой сервер одной командой: docker run ghcr.io/alexeyshalaev/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.2.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.2.0
File Size Uploaded Provenance Actions
hse_lms_mcp-0.2.0.tar.gz 34.4 kB With provenance Details for hse_lms_mcp-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 74.1 kB

Release files / hse_lms_mcp-0.2.0.tar.gz

Download URL hse_lms_mcp-0.2.0.tar.gz
Size 34.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c61858c6bf46149706c9688ff0a99840ede3c30f4a96e885a499656daab9cc4d
BLAKE2b-256 checksum
How to use checksums
efaf63be1f27da781c0fec84b764e1387c3036e04841af5329d8dff3670b514f
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 Dec 1, 2026.

Transparency log

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

Download URL hse_lms_mcp-0.2.0-py3-none-any.whl
Size 39.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
be54e40a02e5e7d73eb06d0dbf14bdf2df1e4db44aa8b95d31bdae8fb0d3af5d
BLAKE2b-256 checksum
How to use checksums
83751bca2afc43ed38e0e0886569503b5ecc3f1486b230e8c50c66e6c9b30cad
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 Dec 1, 2026.

Transparency log

Security for hse-lms-mcp 0.2.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.2.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 Dec 1, 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.2.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