· 8 min read

Making MiniLesson Speak MCP: Building Lessons from Claude, ChatGPT and Gemini

AI assistants like Claude, ChatGPT and Gemini can now create and edit MiniLessons on your Moodle site. Here is what they can do and how to connect one.

AI assistants like Claude, ChatGPT and Gemini can now create and edit MiniLessons on your Moodle site. Here is what they can do and how to connect one.

MiniLesson has had an “AI Generate” button inside the activity for a while now. You pick a template, give it a topic or a word list, and it builds the lesson for you. We have now opened the same tools to AI assistants outside Moodle. Claude, ChatGPT, Gemini and coding agents like Claude Code can connect to your Moodle site and build lessons for you, while you talk to them in plain language.

They do this with MCP (Model Context Protocol), a standard way for an AI assistant to use tools on another system. MiniLesson includes its own MCP server, so there is nothing extra to host. You give your assistant one URL, sign in to Moodle, and it is ready.

What an assistant can do

Once it is connected, you can ask your assistant to do things like:

  • Turn your material into a lesson. Give it a worksheet, a PDF or a lesson plan, and ask it to make MiniLesson items from it.
  • Make new practice from a topic. “Make an A2 lesson about ordering food, with a dictation, a listen and repeat and a short multiple choice quiz.”
  • Reuse a lesson you like. Ask it to use an existing lesson as a template for a new one.
  • Edit lessons that already exist. Find items, fix wording, add or delete items, change their order, or change lesson settings.
  • Look around your courses. List your courses, the MiniLessons in them and the AI Generate templates you can use.

There is an 8 minute video demonstration of the MiniLesson SpeedReading item and MCP here.

The assistant can only work in courses where you are a teacher, and only for users the site admin has allowed. Images and audio are made on the server, so the assistant only needs to describe them.

Setting up Moodle

You need MiniLesson 1.1.43 or later (the newer the better, since we keep adding tools). A site admin does these steps once:

  1. Turn on web services. Site administration → General → Advanced features → Enable web services.
  2. Turn on the REST protocol. Site administration → Server → Web services → Manage protocols.
  3. Allow users to use MCP. Open MiniLesson’s Manage MCP page (in the MiniLesson admin settings). Click Create the MiniLesson MCP User role, then give that role to each teacher who should use it, at Site administration → Users → Permissions → Assign system roles. Managers already have access. There is a video here.
  4. Check course roles. Each of those users also needs to be a teacher in the courses where they will make lessons.

The Manage MCP page also shows your MCP URL, with a copy button. It looks like this:

https://your-moodle-site/mod/minilesson/mcp.php

The Manage MCP page in MiniLesson's admin settings

Two ways to sign in: OAuth or a token

An assistant has to prove to Moodle which user it is acting for. There are two ways.

  • OAuth. The assistant opens a Moodle login page, you sign in and click Allow. This is the normal way for chat apps like Claude, ChatGPT and Gemini, and some of them only support this way. It needs one more plugin, see below.
  • A web service token. An admin makes a token for the user at Site administration → Server → Web services → Manage tokens, and you paste it into the assistant’s settings as an X-API-Key header. This suits coding agents like Claude Code and Antigravity. Site admin accounts can’t use tokens this way, so use a normal teacher account.

Creating a web service token in Moodle

Setting up OAuth with local_oauthmcp

OAuth needs our free local_oauthmcp plugin. Install it like any other Moodle plugin. It has no settings. It adds the Moodle login and Allow screen, then gives the assistant a normal web service token behind the scenes, so you don’t have to make one by hand. The local_oauthmcp plugin could work for other Moodle plugins if they support it too (ie not just MiniLesson).

When you connect via OAuth you will be redirected to your website to authenticate. That can be weird if you are already logged in on your Moodle site with a different user. Often you will be logged in as admin setting things up, but attempting to connect over MCP with a designated MCP user (different to the admin user). So either logout first, or do your admin work from your non default browser.

Try connecting your assistant first. If it can’t finish signing in, your web server probably needs one or both of these changes. They are explained in more detail in the plugin’s web server configuration notes.

  • Nothing connects at all. Your web server is probably hiding the login header from PHP. On Apache add CGIPassAuth On to the Moodle directory block. On nginx add fastcgi_param HTTP_AUTHORIZATION $http_authorization; to the PHP block.
  • ChatGPT connects, but Claude or Gemini do not. Claude and Gemini look for their sign-in details at fixed addresses at the root of your site. Add these rewrite rules to your Apache virtual host:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^/\.well-known/oauth-authorization-server/local/oauthmcp/oauth_metadata\.php$ /local/oauthmcp/oauth_metadata.php [L]
RewriteRule ^/\.well-known/openid-configuration/local/oauthmcp/oauth_metadata\.php$ /local/oauthmcp/oauth_metadata.php [L]
RewriteRule ^/\.well-known/oauth-protected-resource/mod/minilesson/mcp\.php$ /mod/minilesson/oauth_resource_metadata.php [L]
</IfModule>

If you can only use a .htaccess file, the local_oauthmcp plugin notes show the small changes that needs.

There is more information about this on the local_oauthmcp page.

ChatGPT is the simplest to get working with OAuth. So of you are able to use ChatGPT, get it working there first.

Connecting your assistant

Every assistant will require the MCP URL from the Manage MCP page in the MiniLesson admin settings. Prepare that URL first.

The following instructions are specific instructions for common agents.

The menus move around often, and the names of things change, so if a step below does not match what you see, look for a “Connectors”, “Plugins” or “MCP servers” page.

Claude (claude.ai, Claude Desktop and mobile)

  1. Log out of Moodle.
  2. Go to Plugins → click Add, then Add custom connector.
  3. Give it a name, like “MiniLesson”, and paste your MCP URL.
  4. Leave sign-in on the default (OAuth) and click Add, then Connect. Sign in to Moodle and click Allow.
  5. In a chat, click +, open Connectors and switch “MiniLesson” (or whatever you called it in step 3) on.

A connector you add on claude.ai also shows up in Claude Desktop and the mobile app. Free accounts can add one custom connector. On Team and Enterprise plans an owner adds the connector under Organization settings → Connectors first, then each teacher clicks Connect to sign in as themselves.

Adding MiniLesson as a custom connector in Claude

claude.ai 27/11/2026

Claude Code

With OAuth:

Terminal window
claude mcp add --transport http minilesson https://your-moodle-site/mod/minilesson/mcp.php

Then start claude, type /mcp, choose minilesson and sign in to Moodle in your browser.

With a token:

Terminal window
claude mcp add --transport http minilesson https://your-moodle-site/mod/minilesson/mcp.php --header "X-API-Key: YOUR_TOKEN"

ChatGPT

ChatGPT now calls MCP integrations plugins.

  1. Log out of Moodle.
  2. On chatgpt.com, open Plugins in the sidebar, click Add, then Add custom MCP server.
  3. Give it a name, paste your MCP URL, and choose OAuth for authentication.
  4. Click Create as a plugin, sign in to Moodle and click Allow.

Adding MiniLesson as a custom MCP server in ChatGPT

chatgpt.com 27/11/2026

There is a video here.

Check your plan first. At the time of writing, adding your own MCP server with full access is for ChatGPT Business, Enterprise and Edu, and it is done on the web. On Business, only workspace admins can add plugins. ChatGPT Pro can connect but only with read access, which is not enough to create lessons.

For the Codex command line tool:

Terminal window
codex mcp add minilesson --url https://your-moodle-site/mod/minilesson/mcp.php
codex mcp login minilesson

Gemini Spark

Spark only supports OAuth, and it needs a client ID and secret made by your Moodle admin.

  1. Log out of Moodle.
  2. In Gemini, open Spark, then Settings → Connected apps → Add a custom app.
  3. Paste your MCP URL, click Next, then Copy Redirect URL.
  4. Your Moodle admin pastes that redirect URL at Site administration → Plugins → Local plugins → Manage OAuth clients, and gets a client ID and secret back. Everyone on the site can use the same pair.
  5. Enter the client ID and secret in Spark, click Next, and approve the Google and Moodle screens.

Spark may ask your permission each time it changes something in Moodle. That is truly annoying.

Antigravity and other coding agents

Add MiniLesson to your mcp_config.json. With a token, it looks like this:

{
"mcpServers": {
"minilesson": {
"serverUrl": "https://your-moodle-site/mod/minilesson/mcp.php",
"headers": { "X-API-Key": "YOUR_TOKEN" }
}
}
}

For OAuth, leave out headers, then click Authenticate next to minilesson under Settings → Customizations → Installed MCP servers.

Try it

Start small to check it works. Ask your assistant:

  • “Which of my Moodle courses can you see?”
  • “What MiniLesson item types and templates are available?”
  • “Make a new MiniLesson called ‘Test lesson’ in my Sandbox course, with a short multiple choice quiz about animals.”

Then open the lesson in Moodle and see what it made. From there you can give it real work, like the worksheet you were going to type in by hand this weekend.

More details

Step-by-step setup for each assistant, with screenshots, is in our support article Using AI Agents to Generate MiniLessons.

Back to Blog

Related Posts

View All Posts »
New MiniLesson Item: Smart Frame

New MiniLesson Item: Smart Frame

Smart Frame lets you put your own interactive activity, made with an AI tool like ChatGPT, Claude or Gemini, inside a MiniLesson.