Moodle
Moodle learning platform over its Web Services REST protocol: courses and course content, participants, users, grades, activity completion, assignments and submissions, quizzes, calendar and deadlines, forums and messages. Site URL and web service token.
7 天免费 · 无需信用卡 · EU 托管
问 Moodle 任何事
通过 AnythingMCP 对 Moodle 试一个真实提示 — Claude 调用工具并返回答案。在你的消息上按 Enter 即可在 Cloud 安装。
在 Cloud 上安装 MoodleClaude 是 AI,可能会出错。请核对回答。
2 分钟设置
- 1在 cloud.anythingmcp.com 开始免费试用。
- 2在连接器商店点击 Moodle。提示时粘贴凭据。
- 3生成 MCP API 密钥,将 AI 客户端指向生成的 MCP URL。
配置 Moodle
直接来自连接器定义:在哪里获取凭据、需要哪些权限,以及该适配器调用的是哪个 API。 由连接器作者以英文提供。
Moodle
This connector calls the Moodle Web Services REST protocol of your own Moodle site (<site>/webservice/rest/server.php, JSON answers): courses and their content, participants, users, grades, activity completion, assignments and submissions, quizzes, the calendar, forums and private messages. It works with Moodle 4 and 5, self-hosted or MoodleCloud; the site must be reachable over HTTPS from the AnythingMCP server (on AnythingMCP Cloud: from the internet).
Setup by a Moodle administrator (about 10 minutes)
- Site administration, General, Advanced features: tick Enable web services and save.
- Site administration, Server, Web services, Manage protocols: enable the REST protocol.
- Web services, External services: add a service (enabled), then Add functions and add the functions named in the list below. The built-in Moodle mobile web service already contains all of them except
core_user_get_users, and can be used instead when Mobile app, Mobile settings, Enable web services for mobile devices is on. - Choose the user the connector acts as, ideally a dedicated account. Its role needs the capability Use REST protocol (
webservice/rest:use) and the rights for what you want to read: a teacher or manager role for participants, grades of others and submissions. - Web services, Manage tokens, Create token: pick that user and the service, save and copy the token into
MOODLE_TOKEN. - Put the address of the site into
MOODLE_URL, without a slash at the end, e.g.https://moodle.myschool.org.
A user without administrator rights can use their own token of the mobile service, shown under Preferences, Security keys when the site allows it. The connector then sees exactly what that user sees.
Where to start: moodle_get_site_info checks the token and returns userid. Then moodle_list_my_courses (or moodle_list_user_courses) for the course ids everything else needs.
Courses: moodle_list_my_courses, moodle_list_user_courses, moodle_search_courses, moodle_get_courses_by_field, moodle_list_courses (all courses, manager token), moodle_list_categories and moodle_get_course_contents for sections, activities and files.
People: moodle_list_enrolled_users (participants of a course), moodle_get_users_by_field (exact lookup by id, username, email, idnumber), moodle_search_users (custom service only).
Progress: moodle_get_grade_items (grade report of a course), moodle_get_course_grades_overview (final grades across courses), moodle_get_completion_status (activity completion).
Activities: moodle_list_assignments, moodle_list_assignment_submissions, moodle_list_quizzes. Calendar: moodle_list_calendar_events, moodle_list_upcoming_deadlines. Forums: moodle_list_forums, moodle_list_forum_discussions, moodle_get_discussion_posts. Messages: moodle_list_conversations and moodle_send_message, the only tool that writes.
Functions behind the tools (add these to a custom service): core_webservice_get_site_info, core_course_get_enrolled_courses_by_timeline_classification, core_enrol_get_users_courses, core_course_get_courses, core_course_get_courses_by_field, core_course_search_courses, core_course_get_contents, core_course_get_categories, core_enrol_get_enrolled_users, core_user_get_users_by_field, core_user_get_users, gradereport_user_get_grade_items, gradereport_overview_get_course_grades, core_completion_get_activities_completion_status, mod_assign_get_assignments, mod_assign_get_submissions, mod_quiz_get_quizzes_by_courses, core_calendar_get_calendar_events, core_calendar_get_action_events_by_timesort, mod_forum_get_forums_by_courses, mod_forum_get_forum_discussions, mod_forum_get_discussion_posts, core_message_get_conversations, core_message_send_instant_messages.
Errors come with HTTP 200: Moodle answers a failed call with status 200 and a body holding exception, errorcode and message. The connector turns that into a failed call. Common codes: invalidtoken (token wrong, expired or deleted), accessexception (the function is not in the service of the token, or web services are off), nopermissions (the user lacks a capability, named in the message), invalidparameter (a value has the wrong type) and invalidrecord (no such id). Many tools also return warnings next to the data when single items were skipped: read them.
Ids: Moodle has three ids per activity. cmid (course module id) is the one in page addresses and in moodle_get_course_contents; instance (or id in the assignment, quiz and forum lists) is what the activity tools take. User, course and group ids are plain numbers.
Values: times are Unix seconds (0 means not set). Flags are numbers: 1 for yes, 0 for no; Moodle refuses the words true and false. Texts such as summary, intro and message are HTML.
Permissions: every call runs as the user of the token. A student token reads its own courses, grades and deadlines; lists of participants, grades of others and submissions need a teacher or manager. There is no documented rate limit; the site's own capacity is the limit, so prefer one call with several course ids over one call per course.