campus
Provides a read-only Moodle campus integration: it authenticates with a mobile token and uses allow-listed read functions to download followed courses, materials, assignments and due dates, detect changes, and store them locally for search and summaries. It never submits work.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
campus-lens
English · Español
A read-only study assistant for any Moodle campus, built on Claude Code. It downloads your courses, materials, assignments and due dates, finds what changed since last time, turns PDFs, Word and PowerPoint files into searchable Markdown, and lets Claude answer questions about them, always citing the file and the page.
It never submits anything: the code can only call Moodle functions that read.
You → /due-soon → skill → MCP tool list_assignments → local SQLite → answerWhat your campus needs
It works with any Moodle that lets you log in with a username and password through the mobile app:
The mobile API is turned on (the official Moodle app works with your campus).
The login is not SSO: you type your password in a Moodle form, not on a Google, Microsoft or university page.
You do not need to find this out by hand. setup_campus.py asks Moodle, without logging in, through
the public tool_mobile_get_public_config function, and tells you if the campus cannot be used and
why.
Related MCP server: isu-moodle-mcp
Installation
You need Python 3.12 or newer and, to use it with Claude, Claude Code and uv (Claude Code starts the MCP server with uv).
git clone https://github.com/Erbizo/campus-lens.git
cd campus-lens
uv sync # install the dependencies (uv's sync, not the campus one)
uv run setup_campus.py # choose your campus and log inWithout uv, with your own Python (py on Windows, python3 on macOS and Linux):
py -m pip install -e . # installs the dependencies; -e keeps using this folder
py setup_campus.py
py -m campus.command_line coursesEvery uv run … command in this README works the same as py … after that install.
setup_campus.py:
Asks for your campus address, for example
https://moodle.example.com. Onlyhttpsis accepted. If you already set up several campuses, you choose one by number.Checks that the mobile API is on and the login has no SSO. Only then is the campus saved in
config.toml(ignored by git) and made active.Asks for your username and password with hidden input, exchanges them for a token and keeps only the token, in your system keyring. The password is never stored.
Checks that the campus offers the 6 functions the assistant needs. If it does, it says the connection was established successfully and shows the next steps; if not, it lists only the missing ones.
The next steps are: choose the courses to follow, open Claude Code, and synchronise. From the command line it looks like this:
uv run -m campus.command_line courses # list your courses and their ids
uv run -m campus.command_line courses --follow 12 15 # follow those (replaces the selection)
uv run -m campus.command_line sync # download and extractUse from Claude Code
Open Claude Code in the project folder. It starts the campus MCP server by itself (accept it the
first time it asks). You can use the skills or just ask in your own words, in any language:
Skill | What it does |
| Connects to the campus, downloads what is new and counts the changes. Only you can start it |
| Summarises the changes you have not seen and asks whether to mark them as seen |
| Table of what is due in the next 5 days. The quick one |
| Every assignment not submitted, by urgency |
The MCP server offers six tools: sync_campus, list_changes, list_assignments,
assignment_details, search_materials and read_material. Only sync_campus uses the network;
the rest read what is already on your computer.
Example questions: "Where do my notes explain photosynthesis?", "What does the lab report ask for and when is it due?"
Use from the command line
Everything works without Claude too:
Command | What for |
| Choose or add a campus and log in. Run it again when the token expires |
| List your courses and choose which to follow |
| Synchronise the courses you follow |
| Changes not seen yet |
| Assignments and other dates |
| Redo the Markdown (sync already does it) |
Architecture
┌──────────────────────── Claude Code ─────────────────────────┐
│ skills (.claude/skills) → MCP server (mcp_server/) │
└──────────────────────────────────┬───────────────────────────┘
setup_campus.py campus/command_line.py │
│ │ │
▼ ▼ ▼
┌──────────────────────────── campus/ (library) ──────────────────────────────┐
│ campus_config active campus, config.toml, one folder per campus │
│ authentication username+password → token → system keyring │
│ moodle_client REST client: allow list of read functions, no redirects │
│ course_sync courses, materials, assignments, dates → changes │
│ text_extraction PDF, DOCX, PPTX, ODT, HTML, ZIP → Markdown with pages │
│ local_database SQLite │
└─────────────────────────────────────────────────────────────────────────────┘
│ HTTPS (only sync, courses and setup)
▼
Moodle campus
campuses/<campus>/state.db courses, assignments, dates and changes
campuses/<campus>/files/ original files, by course, in Assignments/ and Materials/
campuses/<campus>/text/ the same in Markdown, with "## Page N" to cite themSynchronisation and change detection are deterministic (Python + SQLite, no LLM). Claude only summarises, explains and searches. Search is literal, over the Markdown files, ignoring accents and capitals: no embeddings, no RAG.
Each campus has its own folder, database and token, so you can use several campuses without
mixing them up. setup_campus.py switches the active one, and the MCP server picks up the change
without restarting.
Security decisions
It never submits work.
MoodleClientonly accepts the 6 functions inALLOWED_FUNCTIONS, all of them read-only. Any other call fails before reaching the network, and a test checks it.The password is never stored. It is typed with
getpass, sent by POST (never in the URL) and exchanged for a token. TheprivatetokenMoodle returns, which could open a web session, is thrown away.The token lives only in the system keyring, stored under the campus address.
The token only goes to the configured campus. Redirects are not followed,
httpsis mandatory, and files are only downloaded if their URL starts with the campus' own/webservice/pluginfile.php/, computed from the HTTP client itself. If someone editsconfig.tomlto point elsewhere, that address has no token in the keyring, so there is nothing to send.No data about classmates. Forums, chats, wikis, glossaries, workshops, participants and messages are not synchronised. Authors, user ids, grades and feedback are dropped before saving.
Gentle with the campus: a 1-second pause between requests and an honest User-Agent:
campus-lens/0.1 personal use.Downloads are never run or unzipped to disk. ZIP files are read in memory, with limits on number of files and size, and encrypted entries are skipped. Office files are size-checked before opening.
Campus content is data, not instructions. The MCP server and the skills say so to Claude, and
read_materialcan only read.mdfiles inside the active campus'text/folder.No browser and no desktop control.
.claude/settings.jsondenies them to Claude in this project, so nothing can be submitted that way either.
Limitations
Campuses that require SSO (Google, Microsoft, CAS, SAML…) or have the mobile API turned off are not supported.
Dates and statuses are those of the last synchronisation.
Scanned PDFs and images cannot be searched. Their
.mdsaysOPEN THE ORIGINAL.Formats that are not extracted (images,
.dwg, videos…) stay as original files.Search is literal: it does not understand synonyms.
The keyring needs a backend: Windows Credential Manager, macOS Keychain, or a running Secret Service (GNOME Keyring, KWallet) on Linux.
Try it with another campus
Run
uv run setup_campus.pyand type the address of the new campus.If it says the mobile API is off or the login is SSO, that campus cannot be used. Nothing is saved.
If it works, follow some courses, run
sync, and open Claude Code to ask/due-soon.To go back to another campus, run
setup_campus.pyagain and pick it by number.
If you do not have an account on a second campus, a public Moodle demo site (see
moodle.org/demo) may work, if it allows the mobile app login.
setup_campus.py will tell you.
Tests
uv run pytest
# or, without uv: py -m pip install pytest, then py -m pytestThey use no network, no real keyring and no real configuration: Moodle is simulated with
httpx.MockTransport, and tests/conftest.py makes any test fail if it touches the real keyring
or network.
License
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Notes, tasks, habits, journal and 6 more tools Claude can read and change, with undo. Free.
Safe folder access for ChatGPT and Claude: read, write and search files, risky tools opt-in.
Give Claude only the Google Drive files you choose. Every action logged.
A second brain for Claude: remembers your work, plans your day, encrypted under a key only you hold.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides Claude with full access to Moodle learning management systems, enabling interaction with courses, files, assignments, grades, and calendar events. It also supports building Obsidian study vaults from course materials through automated knowledge graph creation.48 npm18MIT
- AlicenseNot gradedqualityBmaintenanceEnables Claude to interact with Moodle via the official REST API for read-only tasks like listing courses, materials, assignments, submissions, and grades. Uses token-based authentication and emphasizes safe, no-write operations.2MIT
- AlicenseAqualityBmaintenanceA local, read-only MCP server that connects Claude to Monash University Moodle and Ed, providing access to deadlines, announcements, grades, lecture slides, course content, and Ed discussions.20231 PyPI7MIT
- AlicenseBqualityCmaintenanceConnects Claude to your Moodle account through the same web-service API the mobile app uses. Enables asking about upcoming and overdue deadlines, reading course files and announcements, checking grades, searching course content, and saving assignment submissions from chat.172MIT