Moodle MCP

io.github.fabioov由 GitHub 帳號 fabioov 發布v0.1.1更新於 Nov 6, 2026

Read-only Moodle server: assignments, deadlines, grades, courses, forums, notifications.

已驗證STDIO僅桌面效率與工作流溝通與協作

概覽

AI 產生的概覽

唯讀的 Moodle MCP 伺服器,讓助理回答關於課程、作業、截止日期、成績、論壇與通知的問題。

可以做什麼
  • 驗證權杖並檢視網站資訊與目前使用者,列出目前或過往課程
  • 檢視課程的各小節與活動,並依截止日期列出作業
  • 查詢某份作業的繳交與評分狀態、成績與回饋評語
  • 取得未來一段時間的截止日期與行事曆事件,並標示作業已繳交或待繳交
  • 讀取論壇最近的討論與最近的 Moodle 通知
適用情境
適合學生用自然語言詢問這週要交什麼、哪些已繳交、某門課成績如何、有沒有新公告,而不必開瀏覽器進入 Moodle。
執行需求
本機需 Node.js 20+ 執行環境(npx 套件)或 Docker;README 另提供 Cloudflare Workers 部署方式。需要一個已啟用 Web 服務/行動應用程式存取的 Moodle 網站,在 MOODLE_URL 填入網站根網址,在 MOODLE_TOKEN 填入個人 Web 服務權杖。本機用戶端使用 MCP_TRANSPORT=stdio;MCP_AUTH_SECRET 僅在託管 HTTP 模式需要。
安裝前請注意
Moodle 權杖以你的身分生效,任何能存取託管端點的人都能讀取該權杖可讀的內容;請將 MOODLE_TOKEN 與 MCP_AUTH_SECRET 放在環境變數或密鑰中,並把含密鑰的網址當作密碼看待。工具回傳的成績、姓名、訊息等都會作為對話內容傳送給助理,使用前請確認所屬機構關於將學業資料分享給第三方服務的規定,教師帳號尤其如此。重設 Moodle 密鑰會使行動應用程式登出。設計上為唯讀,沒有寫入工具。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Moodle MCP,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Moodle MCP

[CI] [License: MIT]

An open source, read-only MCP server for Moodle. Connect it to Claude and ask about your assignments, deadlines, grades, courses, forums and notifications in plain language.

Not affiliated with or endorsed by Moodle Pty Ltd. "Moodle" is a trademark of its owner.

What you can ask

  • "Which assignments do I still have to hand in this month?"
  • "What's due this week, and what have I already submitted?"
  • "What are my grades in Machine Learning?"
  • "Any new announcements in my courses?"
  • "Show me the sections and activities of my Computer Graphics course."

Tools

All tools are read-only and return concise, readable output.

ToolWhat it doesParameters
get_site_infoValidates the token; site, Moodle version and current user–
list_coursesYour courses (current ones by default)includePast?
get_course_contentsSections and activities of a course. Each module has id and instancecourseId
list_assignmentsAssignments with due dates, sorted by due datecourseId?, upcomingOnly?, limit? (25)
get_assignment_statusSubmission/grading status, grade and feedback commentsassignmentId
get_upcoming_deadlinesCalendar events + assignments in the next N days, each assignment marked submitted or pendingdays? (14), onlyPending?
get_gradesGrade items of a coursecourseId
list_forum_discussionsRecent discussions of a forumforumId (the instance from get_course_contents)
get_notificationsRecent Moodle notifications–

Requirements

  • A Moodle site with Web Services / mobile app access enabled (Moodle 4.x; developed against 4.5).
  • Your own web service token (below). Functions your institution disables simply return an error for that tool.
  • Node 20+ for the server (Node 22+ to deploy with Wrangler), or Docker, or a free Cloudflare account.

Setup

1. Get your Moodle URL and token

  • URL: the root of your Moodle, without a page or /webservice, e.g. https://moodle.example.edu (if Moodle lives in a subfolder, include it: https://example.edu/moodle).
  • Token: in Moodle, Preferences → Security keys shows a key for Moodle mobile web service. Some sites only show a label there; Reset generates a new key (and signs out your Moodle mobile app). Alternatively, if you log in with a Moodle username and password (not SSO), request one: curl -s "$MOODLE_URL/login/token.php" -d username=... --data-urlencode password=... -d service=moodle_mobile_app (type the password interactively so it doesn't end up in your shell history).

2. Configure

Copy .env.example to .env and fill in MOODLE_URL, MOODLE_TOKEN and MCP_AUTH_SECRET (generate the latter with openssl rand -hex 24). .env is git-ignored.

3. Run it, pick one

Cloudflare Workers (free, always on, no domain needed): recommended

bash
npm cinpx wrangler loginnpx wrangler secret put MOODLE_URL        # https://your.moodle.edunpx wrangler secret put MOODLE_TOKEN      # your Moodle web service tokennpx wrangler secret put MCP_AUTH_SECRET   # openssl rand -hex 24npm run deploy                            # prints https://moodle-mcp.<you>.workers.dev

Check Cloudflare's current free-tier limits. Try it locally first by copying your .env values to a git-ignored .dev.vars and running npm run dev:worker.

Docker / Node (self-hosted)

bash
docker build -t moodle-mcp . && docker run --env-file .env -p 3000:3000 moodle-mcp# or: npm ci && npm run build && npm start

Then expose it over HTTPS (for example with a Cloudflare Tunnel or Tailscale Funnel).

Local only (Claude Desktop / Claude Code, stdio): no install needed:

bash
MCP_TRANSPORT=stdio MOODLE_URL=https://your.moodle.edu MOODLE_TOKEN=... npx -y @fabioov/moodle-mcp

MCP_AUTH_SECRET is not needed in this mode.

4. Add it to Claude

  • Claude.ai: Settings → Connectors → Add custom connector. URL https://<your-host>/mcp, choose No sign-in, then Add header Authorization = Bearer <MCP_AUTH_SECRET>.
  • Claude Code: claude mcp add --transport http moodle https://<your-host>/mcp --header "Authorization: Bearer <MCP_AUTH_SECRET>"
  • If a client can only be given a URL, use https://<your-host>/mcp/<MCP_AUTH_SECRET>. Treat that URL as a password; the header is preferred because URLs end up in logs.

Security and privacy

  • Your token acts as you: anyone who can call your endpoint can read what your token can read. Keep MOODLE_TOKEN and MCP_AUTH_SECRET in environment variables or Cloudflare secrets, never in the repo.
  • The server is read-only by design and has no write tools.
  • Whatever the tools return (grades, messages, names) is sent to Claude as part of your conversation. Check your institution's rules on sharing academic data with third-party services before using this, especially if you have access to other people's data (for example as a teacher).
  • See SECURITY.md to report a vulnerability.

Known limitations

  • Tested mainly against Moodle 4.5 with a student account. Teacher/admin roles and other versions or plugins are untested; reports and fixtures are welcome.
  • Sites can disable individual web service functions, so some tools may not work everywhere.
  • Large result sets are trimmed (for example, 25 assignments by default) to save context.

Development

bash
npm cinpm test            # unit tests with fixtures (no Moodle needed)npm run typechecknpm run dev         # HTTP server on :3000 (needs .env)npm run dev:worker  # Cloudflare Worker locally (needs .dev.vars)

See CONTRIBUTING.md. Changes are listed in CHANGELOG.md.

License

MIT

來源:README.md,提交 7cf8f4c

工具

0
SourceWeft 曾在隔離沙箱中以無憑證方式啟動該軟體包一次,以列出其工具,但未能完成:伺服器未能啟動。

版本歷史

1
  1. v0.1.1最新Nov 6, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分