A Moodle local plugin (local_moodlia) that adds about 250 operations for courses, activities, question banks, enrolments, groups, files, audits, and backups. They are available through REST and through an MCP endpoint, so an AI assistant such as ChatGPT or Claude can use them directly. Every request runs as a Moodle user and is limited by that user's permissions.
What it does
- Create and update courses, sections, activities, quizzes, and question banks.
- Audit a course before publishing it: completion rules, gradebook, structure.
- Manage enrolments, groups, files, backups, and restores.
- Serve an MCP endpoint at
/local/moodlia/mcp.phpfor AI assistants.
What you need
- Moodle 4.5, 5.0, 5.1, 5.2, or 5.3 (5.3 is validated against its beta).
- A site administrator to install it and create the access token.
- A current backup of the Moodle code, database, and moodledata.
Installation
1. Install the plugin
Download
local_moodlia-<version>.zipfrom the Moodle Marketplace or from the GitHub releases. Do not use GitHub's “Source code” ZIP.Go to Site administration → Plugins → Install plugins, upload the ZIP, and select “Install plugin from the ZIP file”.
Continue through the checks and select “Upgrade Moodle database now”.
Check that Site administration → Plugins → Plugins overview lists MoodlIA (
local_moodlia) under Local plugins.
2. Give one account access
Enable Web services (Site administration → General → Advanced features) and the REST protocol (Server → Web services → Manage protocols).
Create a dedicated user, for example
moodlia-service. Do not use an administrator or a teacher's personal account.Define a system role “MoodlIA service user” (no archetype) that allows
webservice/rest:useandlocal/moodlia:useapi, and assign it to that user.Give the account only the course permissions it needs, for example by enrolling it as a teacher in the courses it will manage.
In Server → Web services → External services → MoodlIA service → Authorised users, add the account.
In Manage tokens, create a token for that user and the MoodlIA service, with an expiry date. Store it as a secret.
3. Connect a client
From a terminal, install MoodlIA CLI and run a read-only check (see MoodlIA CLI).
From an AI assistant that supports MCP, use this endpoint with the token as a Bearer credential:
https://your-moodle.example/local/moodlia/mcp.php Authorization: Bearer <token>
First use
Confirm the token belongs to the service account, not to the administrator who created it:
moodlia get-current-user --format jsonTry the first changes in a copied or test course.
Good to know
- The plugin never bypasses Moodle permissions: an operation fails if the account lacks the capability.
- On Moodle 4.5, standalone question bank activities are not available; they need Moodle 5.0 or later.
- The release is marked beta in the Moodle Marketplace.