campus-usc
The USC's Campus Virtual (Moodle) in the terminal and for AI agents: one HTTP engine behind a 30 ms CLI and a 94-tool MCP server, with no browser to download.
- Role
- Solo project
- When
- Aug 2026 – present
- Stack
- Python · httpx · BeautifulSoup · Chrome DevTools Protocol · MCP · keyring · Playwright · GitHub Actions · uv
- Links
- Source on GitHub ↗
The University of Santiago de Compostela runs its Campus Virtual on Moodle with no student API. campus-usc talks HTTP just like a browser and exposes two thin interfaces over one engine: a fast terminal CLI for people (campus) and a 94-tool MCP server for AI agents. Open source (MIT) and unofficial, with no affiliation to the university.
Tested live across Computer Science, Mathematics and Medicine, and verified end to end with a second real student account.
Three design decisions
Moodle's mobile API is disabled at the USC. The engine uses the web session to call internal AJAX endpoints (courses, assignments, files, messages) and parses HTML only where Moodle offers no structured data (grades, forums, quizzes). Timetables and exam dates are fetched on demand from public usc.gal pages for any degree, including phased-out study plans.
Instead of bundling a 160 MB Chromium download, it drives an existing Chromium browser (Chrome, Edge, Brave, Chromium or Helium) over DevTools in an isolated profile that never touches your tabs or passwords, grabs only the session cookie and renews headless afterwards. Playwright remains an optional fallback.
The CLI paints from local cache and refreshes stale data in the background, firing network calls concurrently over one session. Every write (submitting work, sending messages) requires a preview and a single-use confirmation token, and Campus output is stripped of terminal control characters.
Architecture
A four-package monorepo: the HTTP engine (campus-usc-core), the CLI (campus), the MCP server (mcp-usc) and the optional timetables-and-exams module. A single-command installer detects OS and browser before touching anything, with CI across Linux, macOS and Windows (Python 3.11 and 3.14).