On your Moodle siteAvailable · 0.1.215

MoodlIA Moodle Plugin

Let AI assistants and scripts work with Moodle safely, within Moodle's own permissions.

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.php for 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

  1. Download local_moodlia-<version>.zip from the Moodle Marketplace or from the GitHub releases. Do not use GitHub's “Source code” ZIP.

  2. Go to Site administration → Plugins → Install plugins, upload the ZIP, and select “Install plugin from the ZIP file”.

  3. Continue through the checks and select “Upgrade Moodle database now”.

  4. Check that Site administration → Plugins → Plugins overview lists MoodlIA (local_moodlia) under Local plugins.

2. Give one account access

  1. Enable Web services (Site administration → General → Advanced features) and the REST protocol (Server → Web services → Manage protocols).

  2. Create a dedicated user, for example moodlia-service. Do not use an administrator or a teacher's personal account.

  3. Define a system role “MoodlIA service user” (no archetype) that allows webservice/rest:use and local/moodlia:useapi, and assign it to that user.

  4. Give the account only the course permissions it needs, for example by enrolling it as a teacher in the courses it will manage.

  5. In Server → Web services → External services → MoodlIA service → Authorised users, add the account.

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

  1. From a terminal, install MoodlIA CLI and run a read-only check (see MoodlIA CLI).

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

  1. Confirm the token belongs to the service account, not to the administrator who created it:

    moodlia get-current-user --format json
  2. Try 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.

Other apps

In a terminalAvailable · 0.4.1

MoodlIA CLI

Run every MoodlIA plugin operation from a terminal, a script, or an AI agent's shell.

In a terminalAvailable · 0.4.1

Moodle Core CLI

Automate Moodle through its standard web services, with nothing to install on Moodle.

In a terminalPreview · 0.1.1

MoodlIA Sync

Copy course content from one Moodle site to another without backups, after you approve a plan.

Need help?

Questions about installing or using any MoodlIA app, or ideas for new ones: write to us.

contact@moodlia.com