شعار Moodle MCP

Moodle 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.

الناشرFaixiang
المستودعMoodle-MCP
اللغةPython
التفريعات
0
النجوم
54
الأدوات المتاحة
0
نوع نقل البياناتstdio
الفئات
الترخيصMIT
الروابط
  • اربط الأدوات بسير عمل الذكاء الاصطناعي

    يتيح Moodle MCP إمكانات MCP التي يمكن لتطبيقات الذكاء الاصطناعي العميلة ووكلاء الذكاء الاصطناعي المتوافقة استخدامها.

  • الأدوات المتاحة: 0

    تصفّح الإجراءات القابلة للاستدعاء أدناه، بما في ذلك أسماؤها وأوصافها عندما يوفّرها الخادم.

  • إعدادات جاهزة للنسخ

    استخدم أمثلة إعداد التثبيت لتهيئة هذا الخادم في تطبيق MCP العميل المفضّل لديك.

  • مؤشرات الاهتمام بالمصدر المفتوح

    النجوم: 54، والنسخ المتفرعة: 0 في المستودع المرتبط.

Moodle-MCP

Your Moodle, as tools an AI agent can actually use

Read assignments, deadlines and course files straight out of the Moodle Web Service API — no browser, no scraping, no clicking.

Companion skill — moodle-course-watch This server is the plumbing; the skill is the workflow on top of it. It diffs new coursework, mirrors missing week folders, lists what is still unsubmitted, and walks through the downloaded files with graded key points. It is mounted as a git submodule in this repository at skill/moodle-course-watch/ (clone with --recurse-submodules), and is also a standalone repo for anyone who wants only the skill.


Actively maintained. Latest release v1.3.0 (2026-10-27): quizzes are no longer a blind spot — moodle_quiz_status reads real attempt state and scores. Full changelog at the end of this file.

Preview 🖥️


Why this exists 🎯

Moodle 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.

This project is the missing wrapper: one zero-dependency Python file, ten read-only tools, working against any Moodle 3.x/4.x site with Web Services enabled.

text
No pip install. No node. No browser. Just python server.py.

Features ✨

Data retrieval

  • Deadline-aware — assignments split into due soon, overdue and no pressure, with days remaining computed for you
  • Weekly digest — recent additions + deadlines + overdue in a single call, formatted for direct reading
  • Course files — section structure and file lists with direct download URLs and modified times, metadata only, nothing downloaded
  • Diagnostics built in — moodle_site_info reports site version, account identity and which functions your token may actually call

Engineering

  • Zero dependencies — Python standard library only (urllib, json, ssl), so nothing pollutes your runtime
  • Single file — copy server.py anywhere; no package layout, no build step
  • stdio JSON-RPC 2.0 — drops into Claude Desktop, Cursor, Marvis or any MCP-compatible client
  • WAF-friendly — serialised calls with a 150 ms gap, because hammering Moodle gets you 502
  • Read-only by design — no submit, enrol, edit or delete endpoint exists in the code

Tools 🧰

ToolWhat it doesArguments
moodle_setup_guideStep-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.—
moodle_config_statusSelf-check of the local configuration: config.json path, existence and parse result, MOODLE_URL / 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.—
moodle_site_infoValidate the token, return site name, Moodle version, current user and the list of web-service functions the account may call (diagnostics).—
moodle_list_coursesList every enrolled course with id, shortname and fullname.—
moodle_recent_updatesContent added or updated in the last N days (assignments, files, announcements), newest first.days (default 7), course_ids
moodle_pending_assignmentsUnsubmitted assignments, split into due soon / overdue / no pressure, with deadline and days remaining.ahead_days (default 14), course_ids
moodle_quiz_statusPer-quiz attempt state straight from mod_quiz_get_user_attempts: submitted / in progress / never started, with best score, open–close window, time limit and a window closed flag.course_ids, only_pending
moodle_course_filesSection structure and file list for one course, including direct download URLs and modified times. Metadata only — nothing is downloaded.course_id
moodle_download_weekDownload 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
moodle_weekly_digestThe one-shot summary: recent additions + due-soon + overdue + counts. Best starting point.days (default 7), ahead_days (default 14)

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.

Requirements 📦

ComponentNotes
Python3.8+ (standard library only)
MCP protocol2024-11-05
Moodle3.x / 4.x with Web Services + REST protocol enabled
AccountHolds the webservice/rest:use capability
Verified againstMoodle 4.3.6, full 435-function grant

Quick start 🚀

① Get a token

Moodle needs a personal access token. Pick whichever works for your site:

A. Web UI (recommended, works with SSO accounts)

  1. Log in to your Moodle site
  2. Avatar → Preferences → Account → Security → Manage access keys
  3. Create, name it Moodle-MCP, service = Moodle mobile web service
  4. Copy the token

B. Mobile-app service via script (only if your site has local passwords)

bash
python get_token.py

Walks through /login/token.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.

C. Environment variables

bash
MOODLE_URL=https://moodle.your-school.edu
MOODLE_TOKEN=your_token_here

② Configure

Create config.json next to server.py (or copy config.example.json):

json
{
  "url": "https://moodle.your-school.edu",
  "token": "your_token_here"
}

Environment variables take precedence over the file.

③ Register the server

Claude Desktop / Cursor (mcp.json):

json
{
  "mcpServers": {
    "moodle": {
      "command": "python",
      "args": ["/absolute/path/to/Moodle-MCP/server.py"]
    }
  }
}

Use an absolute path to server.py. If you have several Python installs, point command at the full interpreter path.

④ Verify

Ask 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.

Configuration reference ⚙️

KeyTypeRequiredDescription
url / MOODLE_URLstringyesBase URL of your Moodle site, no trailing path
token / MOODLE_TOKENstringyesPersonal access token from Manage access keys
config.jsonfileoptionalRead from the directory containing server.py

Precedence: environment variables → config.json → error.

Usage examples 💬

"What do I still owe this week?"

The agent calls moodle_weekly_digest and gets back a ready-to-read brief:

text
## Due in the next 7 days, not submitted
| CIS225 Data Structures | A10021 Crosswords  | 2026-10-29 23:59 | 3 days |
| CIS225 Data Structures | A10022 Cow Jogging | 2026-10-29 23:59 | 3 days |

## Overdue
| CIS225 Data Structures | A10009 Dancing | 2026-10-11 23:59 | 15 days late |

## Totals
Submitted/graded: 51 | Outstanding: 25 (due soon 4, overdue 14, other 7)

Other prompts that work well:

PromptTool it lands on
"What new material appeared in CIS225 this week?"moodle_recent_updates
"List the files in GER405, don't download anything"moodle_course_files
"Which of my courses have nothing overdue?"moodle_pending_assignments
"Is my token still valid?"moodle_site_info

Troubleshooting 🤔

Your account authenticates through SSO/OIDC only, so /login/token.php has no local password to check. Use method A — create the token in Manage access keys instead.

The 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.

Check three things: Web Services and the REST protocol are enabled site-wide; the account has webservice/rest: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.

Expected. 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.

By 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.

The 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.

Output is UTF-8. In legacy consoles run chcp 65001 first, or use Windows Terminal.

Security notes 🔒

  • 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.
  • get_token.py never logs the password — only its length — and reads it with getpass.
  • 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.
  • Do not publish captured HTTP traffic: wstoken appears in the request body.

Compatibility ✅

Client / PlatformStatus
Claude DesktopWorks (stdio server entry)
CursorWorks (mcp.json)
MarvisWorks (MCP registry)
Any MCP clientWorks — plain JSON-RPC 2.0 over stdio
Windows / macOS / LinuxWorks — no platform-specific code

Changelog 📌

VersionDateHighlights
1.4.02026-11-02Two 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.
1.3.02026-10-27New 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.
1.2.02026-10-27Week 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.
1.1.02026-10-27New moodle_download_week — pulls a whole week's slides and assignment attachments, verifies size, and skips files that are already on disk.
1.0.02026-10-27First release: six read-only tools over the Moodle REST Web Service, stdlib only.

Roadmap 🗺️

  • Quiz deadlines and attempt status — shipped in 1.3.0 via mod_quiz_get_user_attempts
  • Turnitin support where the API allows
  • Optional local cache to cut repeated round-trips on large course lists
  • Pagination hints for accounts enrolled in very many courses
  • Submission status details (graded / feedback available) — still read-only
  • Non-Moodle LMS adapters sharing the same tool surface

Contributing 🤝

Issues and pull requests are welcome. The whole server is one file — read server.py top to bottom in a few minutes.

  • Keep the zero-dependency rule: standard library only.
  • Keep every tool read-only.
  • Never commit config.json, tokens or captured traffic.
  • If you add a tool, document it in the Tools table and in every language's README.

Feedback 📢

Bugs and feature requests: open an issue.

License 📝

MIT — see LICENSE.

التثبيت

TypingMind
{
  "mcpServers": {
    "moodle-mcp": {
      "command": "python",
      "args": [
        "path/to/your/server.py"
      ],
      "env": {
        "MOODLE_URL": "<MOODLE_URL>",
        "MOODLE_TOKEN": "<MOODLE_TOKEN>"
      }
    }
  }
}

استخدم MCP الخاص بـ Moodle MCP مع نماذج ذكاء اصطناعي متعددة

يربط TypingMind أدوات MCP على مستوى مساحة العمل، لذا بمجرد توصيل Moodle MCP، يمكنك استخدامه مع نماذج ذكاء اصطناعي مختلفة في TypingMind بدلًا من إعداده لكل نموذج على حدة. يعمل تكامل MCP هذا محليًا عبر موصل MCP الخاص بـ TypingMind على جهازك.

دليل الإعداد لاستخدام الموصل المحلي

استخدم هذا الخيار عندما يحتاج خادم MCP إلى الوصول إلى ملفات محلية أو تطبيقات أو موارد خاصة على جهاز الكمبيوتر لديك.

1

فتح إعدادات MCP

في TypingMind، انتقل إلى «الإعدادات»، ثم «الإعدادات المتقدمة»، ثم «بروتوكول سياق النموذج»، واختر «إعداد الموصل».

  1. افتح TypingMind في متصفحك.
  2. انقر على أيقونة الإعدادات.
  3. انتقل إلى الإعدادات المتقدمة.
  4. افتح قسم بروتوكول سياق النموذج.
  5. انقر على «إعداد الموصل» واختر «هذا الجهاز».
شاشة إعداد موصل MCP في TypingMind مع تحديد «هذا الجهاز»
2

تنفيذ أمر الموصل

اختر «هذا الجهاز»، وانسخ الأمر من TypingMind وشغّله في Terminal. أبقِ العملية قيد التشغيل أثناء استخدام MCP.

  1. انسخ أمر الإعداد الذي يعرضه TypingMind.
  2. افتح Terminal على macOS أو Windows Terminal على Windows.
  3. الصق الأمر ونفّذه.
  4. وافق على تثبيت الحزمة إذا طلب منك Terminal تأكيد المتابعة.
  5. أبقِ نافذة Terminal والعملية التي تعمل فيها قيد التشغيل أثناء استخدام أدوات MCP.
3

أضف Moodle MCP كخادم

عندما تظهر حالة الموصل «جاهز»، انقر على «تعديل الخوادم» والصق إعدادات خادم MCP.

  1. انتظر حتى تظهر حالة الموصل «جاهز».
  2. انقر على «تعديل الخوادم».
  3. الصق إعدادات خادم MCP الخاص بـ Moodle MCP.
  4. احفظ قائمة الخوادم.
  5. حدّث الحالة إذا أردت التأكد من أن الموصل لا يزال جاهزًا.
إعدادات MCP في TypingMind تعرض خادمًا نشطًا وزر «تعديل الخوادم»
{
  "mcpServers": {
    "moodle-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

استخدام الاتصال مع نماذج مختلفة

احفظ قائمة الخوادم، وافتح «الإضافات»، وفعّل أدوات MCP الخاصة بـ Moodle MCP، ثم اختر أي نموذج ذكاء اصطناعي مدعوم في TypingMind واستخدم الأدوات في المحادثة أو أسندها إلى وكيل ذكاء اصطناعي.

  1. افتح صفحة الإضافات في TypingMind.
  2. فعّل أدوات MCP الخاصة بـ Moodle MCP.
  3. ابدأ محادثة واختر نموذج الذكاء الاصطناعي الذي تريد استخدامه.
  4. استخدم أدوات MCP في المحادثة أو عيّنها لوكيل ذكاء اصطناعي.
  5. انتقل إلى نموذج ذكاء اصطناعي آخر عند الحاجة دون إعادة الاتصال بـ MCP.
محادثة في TypingMind تستخدم أدوات MCP المفعّلة مع نموذج ذكاء اصطناعي محدّد
هل يمكنك استخدام Moodle MCP لمساعدتي في هذه المهمة؟
Moodle MCP
بالتأكيد. قرأته.
إليك ما وجدته باستخدام Moodle MCP.

الأسئلة الشائعة

ما استخدامات خادم MCP Moodle MCP؟

Moodle MCP هو خادم MCP يتيح لتطبيقات الذكاء الاصطناعي المتوافقة الاتصال بأدوات ومصادر سياق خارجية. في TypingMind، يمكنك إضافة خادم MCP هذا مرة واحدة وإتاحة أدواته في مساحة عملك للذكاء الاصطناعي.

هل يمكنني استخدام خادم MCP Moodle MCP مع نماذج ذكاء اصطناعي متعددة في TypingMind؟

نعم. يربط TypingMind أدوات MCP على مستوى مساحة العمل، لذا يمكنك استخدام Moodle MCP مع نماذج ذكاء اصطناعي مختلفة مثل Claude أو ChatGPT أو Gemini أو غيرها من النماذج التي أعددتها في TypingMind، دون إعداد خادم MCP لكل نموذج على حدة.

لماذا تستخدم موصل MCP Moodle MCP مع TypingMind؟

يُعد TypingMind من أفضل واجهات المحادثة مع النماذج اللغوية الكبيرة، إذ يجمع نماذج ذكاء اصطناعي متعددة ومطالبات وإضافات ووكلاء ذكاء اصطناعي ومفاتيح API وأدوات MCP في مساحة عمل واحدة. بعد توصيل Moodle MCP، يمكنك استخدام أدوات MCP الخاصة به عبر نماذجك المفضلة مع الحفاظ على سير عمل محادثاتك منظمًا في TypingMind.

كيف أوصّل خادم MCP Moodle MCP بـ TypingMind؟

يعمل Moodle MCP عبر موصل MCP المحلي في TypingMind. هذا هو الخيار الأنسب عندما يحتاج خادم MCP إلى الوصول إلى ملفات محلية أو تطبيقات سطح المكتب أو أدوات سطر الأوامر أو موارد خاصة على حاسوبك.

ما الأدوات التي يوفّرها خادم MCP Moodle MCP في TypingMind؟

يتيح Moodle MCP إمكانات MCP يمكنك تفعيلها من صفحة الإضافات في TypingMind واستخدامها في المحادثات أو تعيينها لوكلاء ذكاء اصطناعي.

هل أحتاج إلى مشاركة مفاتيح API الخاصة بي مع TypingMind لاستخدام خادم MCP Moodle MCP؟

لا. يعطي TypingMind الأولوية للعمل المحلي ويُبقي مزوّدي النماذج ومفاتيح API والمطالبات وإعدادات MCP تحت تحكمك. إذا كان Moodle MCP يتطلب مصادقة، فأضف الترويسات أو إعدادات OAuth أو الإعدادات المحلية المطلوبة لخادم MCP هذا عند إنشاء الاتصال.

خوادم MCP ذات صلة

عرض الكل

أنشئ مساحة عملك للذكاء الاصطناعي الآن

اشترك في نشرتنا البريدية لتصلك أخبار الميزات الجديدة والهدايا القادمة 👇