[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-107756":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":12,"contributorsCount":12,"subscribersCount":12,"size":12,"stars1d":12,"stars7d":14,"stars30d":15,"stars90d":12,"forks30d":12,"starsTrendScore":12,"compositeScore":16,"rankGlobal":9,"rankLanguage":9,"license":17,"archived":18,"fork":18,"defaultBranch":19,"hasWiki":20,"hasPages":18,"topics":21,"createdAt":9,"pushedAt":29,"updatedAt":30,"readmeContent":31,"aiSummary":32,"trendingCount":12,"starSnapshotCount":12,"syncStatus":33,"lastSyncTime":34,"discoverSource":35},107756,"Moodle-MCP","Faixiang\u002FMoodle-MCP","Faixiang","Zero-dependency MCP server for the Moodle Web Service API — read-only course, assignment, quiz, deadline and file tools for Claude, Cursor and any MCP client. Actively maintained · v1.4.0 · 10 tools · docs in 10 languages.",null,"Python",209,0,63,3,146,51.5,"MIT License",false,"main",true,[22,23,24,25,26,27,28],"claude","education","llm","mcp","model-context-protocol","moodle","python","2026-11-01 17:47:58","2026-11-19 08:04:58","\u003Cdiv align=\"center\">\n\n\u003Cimg src=\"docs\u002Fbanner.svg\" alt=\"Moodle-MCP\" width=\"100%\">\n\n# Moodle-MCP\n\n### Your Moodle, as tools an AI agent can actually use\n\nRead assignments, deadlines and course files straight out of the Moodle Web Service API — no browser, no scraping, no clicking.\n\n\u003Ca href=\"LICENSE\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT-yellow.svg\" alt=\"MIT License\">\u003C\u002Fa>\n\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fpython-3.8%2B-3772FF?logo=python&logoColor=white\" alt=\"Python 3.8+\">\n\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FMCP-2024--11--05-8A2BE2\" alt=\"MCP 2024-11-05\">\n\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FMoodle-3.x%20%7C%204.x-F98012?logo=moodle&logoColor=white\" alt=\"Moodle 3.x \u002F 4.x\">\n\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fdependencies-0-success\" alt=\"Zero dependencies\">\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002FFaixiang\u002FMoodle-MCP\u002Fstargazers\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002FFaixiang\u002FMoodle-MCP?style=social\" alt=\"GitHub stars\">\u003C\u002Fa>\n\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fversion-1.4.0-1f6feb\" alt=\"Version 1.4.0\">\n\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fstatus-actively%20maintained-brightgreen\" alt=\"Actively maintained\">\n\n\u003Cp>\n\u003Cb>English\u003C\u002Fb> ·\n\u003Ca href=\"README.zh-CN.md\">简体中文\u003C\u002Fa> ·\n\u003Ca href=\"README.zh-TW.md\">繁體中文\u003C\u002Fa> ·\n\u003Ca href=\"README.ja.md\">日本語\u003C\u002Fa> ·\n\u003Ca href=\"README.ko.md\">한국어\u003C\u002Fa> ·\n\u003Ca href=\"README.es.md\">Español\u003C\u002Fa> ·\n\u003Ca href=\"README.fr.md\">Français\u003C\u002Fa> ·\n\u003Ca href=\"README.de.md\">Deutsch\u003C\u002Fa> ·\n\u003Ca href=\"README.pt-BR.md\">Português\u003C\u002Fa> ·\n\u003Ca href=\"README.ru.md\">Русский\u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003C\u002Fdiv>\n\n> **Companion skill — [moodle-course-watch](https:\u002F\u002Fgithub.com\u002FFaixiang\u002Fmoodle-course-watch)**\n> This server is the plumbing; the skill is the workflow on top of it. It diffs new coursework, mirrors missing week\n> folders, lists what is still unsubmitted, and walks through the downloaded files with graded key points. It is\n> mounted as a git submodule in this repository at [`skill\u002Fmoodle-course-watch\u002F`](skill\u002Fmoodle-course-watch\u002F)\n> (clone with `--recurse-submodules`), and is also a standalone repo for anyone who wants only the skill.\n\n---\n\n> **Actively maintained.** Latest release **v1.3.0** (2026-10-27): quizzes are no longer a blind spot —\n> `moodle_quiz_status` reads real attempt state and scores. Full [changelog](#changelog-) at the end of this file.\n\n## Preview 🖥️\n\n\u003Cimg src=\"docs\u002Fpreview.svg\" alt=\"Example MCP session\" width=\"100%\">\n\n---\n\n## Why this exists 🎯\n\nMoodle powers a large share of universities and colleges worldwide, yet it had no general-purpose MCP server. Scraping it with a headless browser is slow, brittle and tends to trip WAFs — while Moodle itself already ships a stable, documented REST API.\n\nThis project is the missing wrapper: **one zero-dependency Python file, ten read-only tools**, working against any Moodle 3.x\u002F4.x site with Web Services enabled.\n\n```text\nNo pip install. No node. No browser. Just python server.py.\n```\n\n## Features ✨\n\n### Data retrieval\n- **Deadline-aware** — assignments split into *due soon*, *overdue* and *no pressure*, with days remaining computed for you\n- **Weekly digest** — recent additions + deadlines + overdue in a single call, formatted for direct reading\n- **Course files** — section structure and file lists with direct download URLs and modified times, metadata only, nothing downloaded\n- **Diagnostics built in** — `moodle_site_info` reports site version, account identity and which functions your token may actually call\n\n### Engineering\n- **Zero dependencies** — Python standard library only (`urllib`, `json`, `ssl`), so nothing pollutes your runtime\n- **Single file** — copy `server.py` anywhere; no package layout, no build step\n- **stdio JSON-RPC 2.0** — drops into Claude Desktop, Cursor, Marvis or any MCP-compatible client\n- **WAF-friendly** — serialised calls with a 150 ms gap, because hammering Moodle gets you `502`\n- **Read-only by design** — no submit, enrol, edit or delete endpoint exists in the code\n\n## Tools 🧰\n\n| Tool | What it does | Arguments |\n|---|---|---|\n| `moodle_setup_guide` | Step-by-step guide for getting a Moodle web-service token and wiring it into this server (browser UI path, SSO caveat, `config.json` and environment-variable options). Needs no token, so it always works. Call it on first setup or after a `TOKEN_MISSING` error. | — |\n| `moodle_config_status` | Self-check of the local configuration: `config.json` path, existence and parse result, `MOODLE_URL` \u002F `MOODLE_TOKEN` environment variables, effective URL, where the token came from and its length. The token itself is masked to the first 4 characters. Needs no token. | — |\n| `moodle_site_info` | Validate the token, return site name, Moodle version, current user and the list of web-service functions the account may call (diagnostics). | — |\n| `moodle_list_courses` | List every enrolled course with id, shortname and fullname. | — |\n| `moodle_recent_updates` | Content added or updated in the last N days (assignments, files, announcements), newest first. | `days` (default 7), `course_ids` |\n| `moodle_pending_assignments` | Unsubmitted assignments, split into **due soon** \u002F **overdue** \u002F **no pressure**, with deadline and days remaining. | `ahead_days` (default 14), `course_ids` |\n| `moodle_quiz_status` | Per-quiz attempt state straight from `mod_quiz_get_user_attempts`: **submitted** \u002F **in progress** \u002F **never started**, with best score, open–close window, time limit and a *window closed* flag. | `course_ids`, `only_pending` |\n| `moodle_course_files` | Section structure and file list for one course, including direct download URLs and modified times. **Metadata only — nothing is downloaded.** | `course_id` |\n| `moodle_download_week` | Download one week's files (slides + assignment attachments) into a local folder named after the section — `Week N` when the section title carries a week number, otherwise the section's own title (`Online Judge Questions`, `Project Submission`). Creates folders, verifies sizes, skips files already present. Omit `dest_root` to get the list only. | `course_id`, `week` (e.g. `6` or `\"Week 6\"`, or `all`), `dest_root` |\n| `moodle_weekly_digest` | The one-shot summary: recent additions + due-soon + overdue + counts. Best starting point. | `days` (default 7), `ahead_days` (default 14) |\n\n> `moodle_download_week` only writes to your local disk — it never submits anything to Moodle. File URLs returned by the read tools already carry your token, so they download as-is: treat them as secrets and keep them out of logs, screenshots and public repos.\n\n## Requirements 📦\n\n| Component | Notes |\n|---|---|\n| Python | 3.8+ (standard library only) |\n| MCP protocol | `2024-11-05` |\n| Moodle | 3.x \u002F 4.x with Web Services + REST protocol enabled |\n| Account | Holds the `webservice\u002Frest:use` capability |\n| Verified against | Moodle 4.3.6, full 435-function grant |\n\n## Quick start 🚀\n\n### ① Get a token\n\nMoodle needs a personal access token. Pick whichever works for your site:\n\n**A. Web UI (recommended, works with SSO accounts)**\n\n1. Log in to your Moodle site\n2. Avatar → *Preferences* → *Account* → *Security* → *Manage access keys*\n3. *Create*, name it `Moodle-MCP`, service = *Moodle mobile web service*\n4. Copy the token\n\n**B. Mobile-app service via script (only if your site has local passwords)**\n\n```bash\npython get_token.py\n```\n\nWalks through `\u002Flogin\u002Ftoken.php` with the `moodle_mobile_app` service and validates the result. Password input is hidden and never logged. If your account is SSO-only this returns `invalidlogin` — use method A instead.\n\n**C. Environment variables**\n\n```bash\nMOODLE_URL=https:\u002F\u002Fmoodle.your-school.edu\nMOODLE_TOKEN=your_token_here\n```\n\n### ② Configure\n\nCreate `config.json` next to `server.py` (or copy `config.example.json`):\n\n```json\n{\n  \"url\": \"https:\u002F\u002Fmoodle.your-school.edu\",\n  \"token\": \"your_token_here\"\n}\n```\n\nEnvironment variables take precedence over the file.\n\n### ③ Register the server\n\nClaude Desktop \u002F Cursor (`mcp.json`):\n\n```json\n{\n  \"mcpServers\": {\n    \"moodle\": {\n      \"command\": \"python\",\n      \"args\": [\"\u002Fabsolute\u002Fpath\u002Fto\u002FMoodle-MCP\u002Fserver.py\"]\n    }\n  }\n}\n```\n\nUse an absolute path to `server.py`. If you have several Python installs, point `command` at the full interpreter path.\n\n### ④ Verify\n\nAsk your client to call `moodle_site_info`. A working setup returns the site name, Moodle version and your user record. If it fails, jump to [Troubleshooting](#troubleshooting-).\n\n## Configuration reference ⚙️\n\n| Key | Type | Required | Description |\n|---|---|---|---|\n| `url` \u002F `MOODLE_URL` | string | yes | Base URL of your Moodle site, no trailing path |\n| `token` \u002F `MOODLE_TOKEN` | string | yes | Personal access token from *Manage access keys* |\n| `config.json` | file | optional | Read from the directory containing `server.py` |\n\nPrecedence: environment variables → `config.json` → error.\n\n## Usage examples 💬\n\n> \"What do I still owe this week?\"\n\nThe agent calls `moodle_weekly_digest` and gets back a ready-to-read brief:\n\n```text\n## Due in the next 7 days, not submitted\n| CIS225 Data Structures | A10021 Crosswords  | 2026-10-29 23:59 | 3 days |\n| CIS225 Data Structures | A10022 Cow Jogging | 2026-10-29 23:59 | 3 days |\n\n## Overdue\n| CIS225 Data Structures | A10009 Dancing | 2026-10-11 23:59 | 15 days late |\n\n## Totals\nSubmitted\u002Fgraded: 51 | Outstanding: 25 (due soon 4, overdue 14, other 7)\n```\n\nOther prompts that work well:\n\n| Prompt | Tool it lands on |\n|---|---|\n| \"What new material appeared in CIS225 this week?\" | `moodle_recent_updates` |\n| \"List the files in GER405, don't download anything\" | `moodle_course_files` |\n| \"Which of my courses have nothing overdue?\" | `moodle_pending_assignments` |\n| \"Is my token still valid?\" | `moodle_site_info` |\n\n## Troubleshooting 🤔\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>\u003Ccode>invalidlogin\u003C\u002Fcode> when running get_token.py\u003C\u002Fb>\u003C\u002Fsummary>\n\nYour account authenticates through SSO\u002FOIDC only, so `\u002Flogin\u002Ftoken.php` has no local password to check. Use method A — create the token in *Manage access keys* instead.\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>\u003Ccode>502\u003C\u002Fcode> or connection reset during a call\u003C\u002Fb>\u003C\u002Fsummary>\n\nThe site's WAF is rate-limiting you. This server already serialises calls and pauses 150 ms between them; if you still hit it, wait a few minutes and retry, and avoid firing several tools in parallel.\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Tools return empty lists\u003C\u002Fb>\u003C\u002Fsummary>\n\nCheck three things: Web Services and the REST protocol are enabled site-wide; the account has `webservice\u002Frest:use`; and any `course_ids` filter you passed is correct. Run `moodle_site_info` first — if the function list is short, the admin restricted your grant to the mobile subset.\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Turnitin deadlines are missing\u003C\u002Fb>\u003C\u002Fsummary>\n\nExpected. `turnitintooltwo` is its own module without `mod_assign` semantics and exposes no usable deadline field, so it is the one remaining blind spot. Check those in the web UI.\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Quiz deadlines are missing from \u003Ccode>moodle_weekly_digest\u003C\u002Fcode>\u003C\u002Fb>\u003C\u002Fsummary>\n\nBy design. Quizzes live in `mod_quiz`, not `mod_assign`, so they have their own tool: `moodle_quiz_status` returns attempt state, best score and the open–close window for every quiz.\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>A deadline shows as \"not set\"\u003C\u002Fb>\u003C\u002Fsummary>\n\nThe teacher never configured a due date for that assignment. There is nothing to compute; the item still appears so you don't forget it exists.\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Garbled characters in Windows terminals\u003C\u002Fb>\u003C\u002Fsummary>\n\nOutput is UTF-8. In legacy consoles run `chcp 65001` first, or use Windows Terminal.\n\u003C\u002Fdetails>\n\n## Security notes 🔒\n\n- The token is a **credential**. Store it in `config.json` or an environment variable, never in a repo. `.gitignore` already excludes `config.json` and `get_token.log`.\n- `get_token.py` never logs the password — only its length — and reads it with `getpass`.\n- Every tool is read-only by design, so a leaked token cannot modify or delete coursework through this server. Revoke it from *Manage access keys* if it leaks.\n- Do not publish captured HTTP traffic: `wstoken` appears in the request body.\n\n## Compatibility ✅\n\n| Client \u002F Platform | Status |\n|---|---|\n| Claude Desktop | Works (stdio server entry) |\n| Cursor | Works (`mcp.json`) |\n| Marvis | Works (MCP registry) |\n| Any MCP client | Works — plain JSON-RPC 2.0 over stdio |\n| Windows \u002F macOS \u002F Linux | Works — no platform-specific code |\n\n## Changelog 📌\n\n| Version | Date | Highlights |\n|---|---|---|\n| **1.4.0** | 2026-11-02 | Two token-free tools: `moodle_setup_guide` (step-by-step token and wiring instructions) and `moodle_config_status` (config self-check with the token masked). Every `TOKEN_MISSING` error now hands over to them instead of dead-ending. |\n| **1.3.0** | 2026-10-27 | New `moodle_quiz_status` — attempt state, best score and time windows read from `mod_quiz_get_user_attempts`. The quiz blind spot is closed; `moodle_weekly_digest` now points to it. |\n| **1.2.0** | 2026-10-27 | Week numbering is taken from section titles only. Blocks that carry no week number (`Online Judge Questions`, `Project Submission`) keep their own names instead of being silently renumbered. |\n| **1.1.0** | 2026-10-27 | New `moodle_download_week` — pulls a whole week's slides and assignment attachments, verifies size, and skips files that are already on disk. |\n| **1.0.0** | 2026-10-27 | First release: six read-only tools over the Moodle REST Web Service, stdlib only. |\n\n## Roadmap 🗺️\n\n- [x] Quiz deadlines and attempt status — shipped in 1.3.0 via `mod_quiz_get_user_attempts`\n- [ ] Turnitin support where the API allows\n- [ ] Optional local cache to cut repeated round-trips on large course lists\n- [ ] Pagination hints for accounts enrolled in very many courses\n- [ ] Submission *status* details (graded \u002F feedback available) — still read-only\n- [ ] Non-Moodle LMS adapters sharing the same tool surface\n\n## Contributing 🤝\n\nIssues and pull requests are welcome. The whole server is one file — read `server.py` top to bottom in a few minutes.\n\n- Keep the zero-dependency rule: standard library only.\n- Keep every tool read-only.\n- Never commit `config.json`, tokens or captured traffic.\n- If you add a tool, document it in the Tools table and in every language's README.\n\n## Feedback 📢\n\nBugs and feature requests: [open an issue](https:\u002F\u002Fgithub.com\u002FFaixiang\u002FMoodle-MCP\u002Fissues).\n\n## License 📝\n\nMIT — see [LICENSE](LICENSE).\n","Moodle-MCP 是一个零依赖的 Model Context Protocol（MCP）服务端实现，专为对接 Moodle 学习管理系统 Web Service API 设计。它提供 10 个只读工具，支持实时获取课程、作业、测验、截止时间及课程文件等结构化教育数据，无需浏览器、爬虫或外部依赖。基于单文件 Python 实现（兼容 3.8+），严格遵循 MCP 规范，已适配 Moodle 3.x\u002F4.x 版本。适用于 AI 助手（如 Claude、Cursor）在教育场景中自动化获取学习任务信息、构建课程监控工作流或集成到 LLM 应用中。",2,"2026-11-24 04:32:50","CREATED_QUERY"]