Skip to main content

MCP server for Librus Synergia — access grades, messages, attendance, homework, timetables, and announcements from AI assistants

Project description

Librus MCP Server

License: MIT PyPI

An MCP (Model Context Protocol) server that provides AI assistants with access to the Librus Synergia electronic gradebook. It supports multiple student accounts simultaneously and exposes tools for grades, messages, attendance, homework, schedules, timetables, and announcements.

Acknowledgments

This project is built on top of the excellent librus-apix library by RustySnek. Their work on reverse-engineering and maintaining a Python client for the Librus Synergia platform made this MCP server possible. If you find this project useful, please consider starring their repository as well.

Quick Start

1. Add to your AI assistant

Pick your client. Credentials are passed directly via the env block — no files or cloning needed.

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "librus": {
      "command": "uvx",
      "args": ["librus-mcp"],
      "env": {
        "LIBRUS_ACCOUNTS": "[{\"alias\":\"daughter\",\"username\":\"12345\",\"password\":\"...\"}]"
      }
    }
  }
}

Claude Code

Via the /mcp command or in .claude/settings.json:

{
  "mcpServers": {
    "librus": {
      "command": "uvx",
      "args": ["librus-mcp"],
      "env": {
        "LIBRUS_ACCOUNTS": "[{\"alias\":\"daughter\",\"username\":\"12345\",\"password\":\"...\"}]"
      }
    }
  }
}

Gemini CLI

Add to ~/.gemini/settings.json (global) or .gemini/settings.json (project-level):

{
  "mcpServers": {
    "librus": {
      "command": "uvx",
      "args": ["librus-mcp"],
      "env": {
        "LIBRUS_ACCOUNTS": "[{\"alias\":\"daughter\",\"username\":\"12345\",\"password\":\"...\"}]"
      }
    }
  }
}

OpenAI Codex CLI

Add to ~/.codex/config.toml (global) or .codex/config.toml (project-level):

[mcp_servers.librus]
command = "uvx"
args = ["librus-mcp"]

[mcp_servers.librus.env]
LIBRUS_ACCOUNTS = '[{"alias":"daughter","username":"12345","password":"..."}]'

Note: uvx automatically downloads and runs the package from PyPI — no cloning or virtual environments needed. You only need uv installed (curl -LsSf https://astral.sh/uv/install.sh | sh).

Providing credentials

Each account represents a parent's login to Librus Synergia for a specific child. In the Polish school system, parents receive separate Librus login credentials for each of their children. The alias is a friendly name you choose to identify which child's data you're accessing. The username and password are the parent portal credentials you use to log in at synergia.librus.pl.

There are three ways to provide credentials (checked in this order):

Method Best for Example
LIBRUS_ACCOUNTS env var uvx users, CI JSON array of account objects (see examples above)
LIBRUS_CONFIG env var Custom file location Path to your secrets.json, e.g. ~/.config/librus/secrets.json
secrets.json in working dir Local development Create from secrets.json.template

Multiple children

Add multiple accounts to the JSON array:

[{"alias":"daughter","username":"12345","password":"..."},{"alias":"son","username":"67890","password":"..."}]

Using a config file with uvx

If you prefer a file over inline JSON:

{
  "mcpServers": {
    "librus": {
      "command": "uvx",
      "args": ["librus-mcp"],
      "env": {
        "LIBRUS_CONFIG": "/Users/you/.config/librus/secrets.json"
      }
    }
  }
}

Alternative: Install from source

If you prefer to run from a local clone:

git clone https://github.com/krzysztoofbury/librus-mcp.git
cd librus-mcp
uv venv && uv pip install -e .
cp secrets.json.template secrets.json   # Then fill in credentials

Then use the full path in your MCP config:

{
  "mcpServers": {
    "librus": {
      "command": "/path/to/librus-mcp/.venv/bin/librus-mcp"
    }
  }
}

Available Tools

Tool Description
list_students() List configured student aliases
get_grades(student_alias) Get grades for a student
get_messages(student_alias) Get received messages
get_message_content(student_alias, message_id) Get the body of a specific message
get_attendance(student_alias) Get attendance records
get_homework(student_alias) Get homework for the next 2 weeks
get_schedule(student_alias, year, month) Get calendar events/exams for a month
get_timetable(student_alias) Get current week's timetable
get_announcements(student_alias) Get school announcements

Project Structure

src/
  server.py          # MCP server with tool definitions and entry point
  librus_client.py   # Librus API client wrapper with caching and retry
  config.py          # Configuration loader (reads secrets.json)
  patches.py         # Runtime patches for librus-apix bugs

Contributing

Contributions are welcome! See CONTRIBUTING.md for guidelines.

Security

To report vulnerabilities, see SECURITY.md.

License

This project is licensed under the MIT License. See LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

librus_mcp-0.1.0.tar.gz (137.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

librus_mcp-0.1.0-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file librus_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: librus_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 137.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for librus_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3afebd432964b734938077e211220d7060e1678a143771c8deea5c3d2a1c600f
MD5 51d1027c5b04227915e8ab7c8c0030ec
BLAKE2b-256 a75f154b04459595b88019e1523336622bdccc4b274dd3cd3130ce1717767154

See more details on using hashes here.

Provenance

The following attestation bundles were made for librus_mcp-0.1.0.tar.gz:

Publisher: publish.yml on krzysztofbury/librus-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file librus_mcp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: librus_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for librus_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1da322719d08d292a413041c7d4c45597426ce6ea3caea6d9ee836ad76554653
MD5 3ed1828528b092292437a631b7807b27
BLAKE2b-256 aba9576fb69c9b9474c712261b37d823acfcc61da5304940f8e15f7dc4ad8658

See more details on using hashes here.

Provenance

The following attestation bundles were made for librus_mcp-0.1.0-py3-none-any.whl:

Publisher: publish.yml on krzysztofbury/librus-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page