Goldnat Plugins
← Back to Moodle

Moodle AI Connect — Installation & Setup Guide

Install and connect local_aiconnect (Servio Protocol) to your Moodle LMS. 2 free tools for student flow + 4 Pro. Teacher Pro sold separately.

📅 Updated: 2026-07-07 🎬 Video: moodle-install-connect

Overview

Goldnat AI Connect for Moodle (local_aiconnect) turns the LMS into a Servio Protocol tool server. The basic plugin is designed for students — viewing courses and grades. A separate Teacher Pro extension (in development) will support creating assignments, enrolling users, submitting grades, and updating courses.

What you get:

  • 2 free toolsgetCourses, getUserProfile
  • Student Pro upgradegetCourse, getAssignments, getGrades, sendMessage
  • Separate Pro extension: moodle-teacher-ai-connect (Teacher/Admin — 6 tools: enroll, createAssignment, submitGrade, updateCourse, searchUsers, getEnrollments)

Prerequisites

  • Moodle 4.1+ (4.3+ recommended)
  • PHP 7.4+ (8.1+ recommended)
  • MySQL/MariaDB or PostgreSQL
  • HTTPS required
  • Site admin for installation, enrolled user for use

Installation

  1. Download the plugin ZIP from your personal area at goldnat.ai (sign in → your plugins → download the latest version).
  2. Site administration → Plugins → Install plugins.
  3. Drag & drop the ZIP → Install plugin from ZIP file.
  4. Continue → Moodle runs DB migrations automatically.
  5. Save changes on the settings page that appears.
  6. Verify at Site administration → Notifications that there are no errors.

Connecting to an AI Agent

  1. User profile → Preferences → AI Connect Tokens (or /local/aiconnect/mytokens.php).
  2. Generate Prompt → copy and paste into your agent.
  3. OAuth PKCE runs → approve.

First Test

  • “What courses am I enrolled in?” → moodle.getCourses
  • “Who am I on the system?” → moodle.getUserProfile

With Student Pro:

  • “What assignments do I have in ‘Intro to AI’?” → moodle.getAssignments
  • “What are my grades in that course?” → moodle.getGrades

With Teacher Pro (future):

  • “Enroll student@example.com in course 5” → moodle.enrollUser
  • “Create a new assignment in course 3” → moodle.createAssignment

Reconnecting

Tokens valid for 30 days. Refresh:

  1. My Tokens → Revoke the old token.
  2. Generate Prompt again.

Token Management

/local/aiconnect/mytokens.php page with 6 filters and bulk actions. Tokens are tied to a specific user_id in Moodle — you can’t use one user’s token as another.

Uninstalling the Plugin

1. Revoke all tokens

  • My Tokens → Revoke All — kills every active agent session immediately.

2. Uninstall via UI

  • Site administration → Plugins → Plugins overview → find local_aiconnect → click Uninstall.
  • Moodle will prompt to confirm dropping the DB tables → confirm.

3. Remove the files

rm -rf /path/to/moodle/local/aiconnect/

4. Purge caches

php admin/cli/purge_caches.php

Or via UI: Site administration → Development → Purge all caches.

Common Troubleshooting

ErrorCauseFix
Plugin not compatible with Moodle versionMoodle 3.xUpgrade to 4.1+
Manifest 404Web services not enabledSite admin → Advanced → Enable web services
Permission denied (Grade assignment)User isn’t a teacher on the courseAssign the teacher role on the relevant course
Course not found (courseid=1)Trying to use the FrontpageFrontpage isn’t a real course — use courseid ≥ 2

Support

Need help? Contact us and we’ll get back to you.

Video Tutorial (Coming Soon)

Segments: (A) Goldnat AI Connect on the Servio Protocol, (B) installing via Site administration, (C) connecting to an AI agent, (D) student flow — my courses and grades.

Screenshots

Moodle Site administration → Plugins
Navigate to Site administration → Plugins → Install plugins
Upload ZIP + Install
Install from ZIP + Continue
My Tokens page
Generate prompt for AI agent connection

🎬 Video Tutorial — Coming Soon

A 3-5 minute video covering: intro → install → connect → demo.

Tag: moodle-install-connect

Status: Awaiting production

Pro

Moodle AI Connect Pro — Teacher Tools

New here? Start with the basic setup guide above.

What Pro adds

The free Moodle plugin gives AI agents read-only access to courses, enrolments and grades. Pro adds the teacher write tools, so an agent can enrol students, create assignments, grade submissions, and message learners.

Pro ships as a separate Moodle plugin (local_aiconnectteacher) that declares a dependency on the free local_aiconnect plugin. The core plugin loads the Pro tools only when the edition is Pro — otherwise they never appear in the manifest.

Pro tools

ToolScopeWhat it does
enrollUserwriteEnrol a user into a course (manual enrolment)
createAssignmentwriteCreate an assignment in a course
submitGradewriteSubmit a grade for a student’s assignment
sendMessagewriteSend an instant message to a user
updateCoursewriteUpdate a course’s full name or summary
searchUserswriteSearch users by name or email

Enabling Pro

  1. Install the free Moodle plugin first (see the basic guide above).
  2. Install the local_aiconnectteacher plugin, then run admin/cli/upgrade.php.
  3. Set the edition to Pro: AICONNECT_EDITION=pro, or set the edition config for local_aiconnect to pro.
  4. Purge caches and regenerate your connection prompt — the six Pro tools now appear.

Scope note

All Pro tools require the write scope. Actions still run against the token owner’s own Moodle capabilities — the scope is the ceiling, the user’s role permissions are the floor. For example, submitGrade requires the token owner to hold the grading capability in that course’s context.

This guide is informational and non-binding. Steps and behavior can vary between platforms and plugin versions. For the binding terms, see the Terms & Conditions.

Tools

Available tool calls.

97 tools exposed via the Servio protocol. Pro tools are marked.

moodle_pro

  • moodle_pro.createGradeItem Creates a new grade item in the course gradebook. Pro
  • moodle_pro.updateGradeItem Updates grade item settings (name, max grade, weight). Pro

moodle

  • moodle.addGroupMember Add a user to a group. User must already be enrolled in the group course. Pro
  • moodle.analyzeGradeDistribution Analyzes grade distribution in the course and returns statistics (mean, median, spread). Pro
  • moodle.bulkGradeAssignment Grade multiple students at once for one assignment. Map of userid to {grade, feedback}. Pro
  • moodle.createAssignment Creates a new assignment in the course with name, instructions, and due date. Pro
  • moodle.createCalendarEvent Create a calendar event. Personal event if courseid is omitted; course-wide event (visible to all enrolled users) when courseid is provided. Pro
  • moodle.createCourse Creates a new course with name, code, and category. Pro
  • moodle.createCourseCategory Creates a new course category to organize courses. Pro
  • moodle.createGroup Create a new group in a course. Returns the created group id. Pro
  • moodle.createQuestionCategory Create a new question bank category in a course context. Organizes questions across quizzes. Pro
  • moodle.createQuiz Create an empty quiz in a course. Returns quiz id + cmid; use createQuestionCategory + question-adding tools to populate. Quiz appears on course page and in gradebook immediately. Pro
  • moodle.deleteAssignment Delete an assignment activity from a course. DESTRUCTIVE — removes the assignment and all student submissions. Pro
  • moodle.downloadSubmissionFile Download a specific file from an assignment submission. Returns a signed URL or the file contents. Pro
  • moodle.duplicateCourse Duplicates an existing course including its content and settings into a new course. Pro
  • moodle.enrollUser Enrolls a user (student/teacher) in a given course. Pro
  • moodle.exportGradebookCSV Exports the course gradebook as a CSV file (students × grade items). Pro
  • moodle.exportGradebookExcel Exports the course gradebook as an Excel (.xlsx) file, returned base64-encoded. Pro
  • moodle.extendAssignmentDueDate Extend the due date (and optionally cutoff date) on an assignment. Provide new dates as Unix timestamps. Pro
  • moodle.getAssignmentSubmissions List every submission for an assignment, with status (submitted or not), date, grade, attached files and the learner's comments. Pro
  • moodle.getCategoryCourses List all courses in a given category, with their ID, name, shortname, and visibility. Pro
  • moodle.getCourseCategories Get details of a specific course category by ID, including name, description, parent, depth, and course count. Pro
  • moodle.getCourseGradebook Get the full gradebook for a course: every enrolled student with their grade in each grade item (Pro) Pro
  • moodle.getGradeCategories Get Grade Categories (Moodle core-gradebook)
  • moodle.getGradeCategory Get Grade Category (Moodle core-gradebook)
  • moodle.getGradeFeedback Get Grade Feedback (Moodle core-gradebook)
  • moodle.getGradeHistory Get Grade History (Moodle core-gradebook)
  • moodle.getGradeItem Get Grade Item (Moodle core-gradebook)
  • moodle.getGradeItems Get Grade Items (Moodle core-gradebook)
  • moodle.getGradeLetters Get Grade Letters (Moodle core-gradebook)
  • moodle.getGradeOutcomes Get Grade Outcomes (Moodle core-gradebook)
  • moodle.getGradeScales Get Grade Scales (Moodle core-gradebook)
  • moodle.getGroup Get details of a specific group by ID, including course, name, description, and current member list. Pro
  • moodle.getQuizAttempts List quiz attempts for one learner or for the whole class, with date, score, status (in progress or finished) and time remaining. Pro
  • moodle.getQuizQuestions Get the questions in a quiz, including type (multiple choice, true or false, short answer), question text, options, marks and feedback where permitted. Pro
  • moodle.getStudentGrades Get all grades for a single student in a course, item by item, with the course total (Pro) Pro
  • moodle.getSubmissionContent Read the full content of a single student assignment submission: online text, submitted files (with URLs), current grade, and feedback. Pro
  • moodle.getSubmissionFiles List the files attached to an assignment submission, with names, sizes, types and download links. Pro
  • moodle.gradeByGroup Assign the same grade + feedback to every member of a group in an assignment. Pro
  • moodle.identifyAtRiskStudents Identifies at-risk students based on grades, submissions, and activity, and returns a ranked list. Pro
  • moodle.listCourseCategories List all course categories on the site with their hierarchy. Optionally filter by parent id. Pro
  • moodle.listGroups List all groups in a course. Returns group id, name, description, and member count. Pro
  • moodle.removeGroupMember Remove a user from a group. Does NOT unenroll them from the course. Pro
  • moodle.searchGrades Search Grades (Moodle core-gradebook)
  • moodle.searchUsers Searches users by name or email address. Pro
  • moodle.sendMessage Sends a personal message to a student or a group of students through the Moodle messaging system. Pro
  • moodle.submitGrade Enters a grade for a student's assignment and saves it to the gradebook. Pro
  • moodle.updateAssignment Update an existing assignment (name, intro, dates, max grade). Pro
  • moodle.updateCourse Updates the course details (name, description, settings). Pro
  • moodle.updateCourseCategory Updates an existing course category (name, hierarchy). Pro
  • moodle.updateGradeItem Update a grade item (grademax/grademin/gradepass/aggregationcoef/hidden). Pro
  • moodle.uploadCourseFile Upload a file to a course as a Resource module. Accepts base64-encoded content and creates a downloadable file resource on the course page. Pro
  • moodle.createForumTopic Create a new discussion topic in a forum the current user has access to. Pro
  • moodle.enrollSelf Self-enroll the current user into a course using the enrol_self method (course must have self-enrolment enabled). Provide enrolment key if required. Pro
  • moodle.getActivityCompletionStatus Get completion status for the activities in a course, showing what the learner has finished and what remains. Pro
  • moodle.getBadges List the badges a learner has earned, with the criteria met and the date awarded. Pro
  • moodle.getConversation Get the messages in a conversation, with sender and timestamps. Pro
  • moodle.getCourseCalendar Get the calendar events for a course: due dates, sessions and reminders. Pro
  • moodle.getCourseCompletionStatus Get course completion status. Pro
  • moodle.getCourseContent Return the learning materials and resources of a course the student is enrolled in. Pro
  • moodle.getMyAssignments List the current student's assignments with due dates and submission status. Pro
  • moodle.getMyAttendance Return the current student's attendance record across courses. Pro
  • moodle.getMyCourses List the courses the current student is enrolled in, with progress and next due dates. Pro
  • moodle.getMyFeedback Get the teacher feedback on the current student's submitted assignments. Pro
  • moodle.getMyGrades Get the current student's grades across all their courses. Pro
  • moodle.getMySchedule Return the current student's calendar: classes, deadlines and events. Pro
  • moodle.getUserMessages Get user messages. Pro
  • moodle.getUserNotifications Get user notifications. Pro
  • moodle.markNotificationsRead Mark the current student's Moodle notifications as read. Pro
  • moodle.replyToForumPost Reply to an existing forum post — reply becomes a child post in the same discussion. Pro
  • moodle.sendMessageToTeacher Send a private message from the current student to a course teacher. Pro
  • moodle.submitAssignment Submit an assignment on behalf of the current student (text or file). Pro
  • moodle.submitQuizAttempt Submit and finish an in-progress quiz attempt. Optionally provide a map of question slot to answer before finalizing. Pro
  • moodle.unenrollSelf Unenroll the current user from a course. Only works for self-enrolled memberships (not cohort/manual). Pro
  • moodle.updateMyProfile Update the current user own profile — whitelisted safe fields only (firstname, lastname, description, city, country, url). Cannot change email, username, or roles. Pro
  • moodle.downloadCourseFile Download a specific file from a course. Returns a signed URL or the file contents.
  • moodle.getAssignments Returns the list of assignments in a given course.
  • moodle.getCourse Returns full details of a single course by course ID.
  • moodle.getCourseFiles List the files available in a course, with names, sizes, types and download links.
  • moodle.getCourseModules List the activities and resources in a course, with their type, section and completion settings.
  • moodle.getCourses Returns the list of courses the user is enrolled in, with name, code, and ID.
  • moodle.getEnrollments Returns the list of users enrolled in a course and their roles.
  • moodle.getForumDiscussions List discussions in a course forum, with author, reply count and last activity.
  • moodle.getForumPosts Get the posts within a forum discussion, including author and timestamps.
  • moodle.getGrades Returns the user's grades on the course grade items.
  • moodle.getModuleContent Get module content.
  • moodle.getUserProfile Returns the authenticated user's profile (name, email, details).
  • moodle.searchForumPosts Search forum posts.

quiz

  • quiz.getAttemptDetails Get Attempt Details (Moodle quiz)
  • quiz.getQuizAccessRules Get Quiz Access Rules (Moodle quiz)
  • quiz.getQuizDetails Get Quiz Details (Moodle quiz)
  • quiz.getQuizStatistics Get Quiz Statistics (Moodle quiz)
  • quiz.getUserBestAttempt Get User Best Attempt (Moodle quiz)
  • quiz.listAttempts List Attempts (Moodle quiz)
  • quiz.listQuestionCategories List Question Categories (Moodle quiz)
  • quiz.listQuizzes List Quizzes (Moodle quiz)
  • quiz.searchQuestionBank Search Question Bank (Moodle quiz)