# Moodle — Pipedream Connect

> The open source learning platform, Moodle LMS.

- API slug: `moodle` (use in MCP headers and tool keys)
- Auth: API key (Pipedream-managed)
- Categories: Learning & Education
- Website: https://moodle.org
- This page (HTML): https://pipedream.com/apps/moodle
- Tools: 27 actions · 0 triggers

## Connect via MCP (recommended)

- Endpoint: `https://remote.mcp.pipedream.net/v3`
- Headers: `Authorization: Bearer <token>` · `x-pd-project-id` · `x-pd-environment` · `x-pd-external-user-id` · `x-pd-app-slug: moodle`

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "moodle",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// e.g. run Add a Content Item to a User's Favorites:
const result = await mcp.callTool({
  name: "moodle-add-content-item-to-favorites",
  arguments: {
    courseId: "Course ID",
    sectionId: "Section ID",
  },
})
```

Docs: [MCP guide](https://pipedream.com/docs/connect/mcp/developers.md)

## API proxy

For a Moodle endpoint with no pre-built tool, the proxy forwards your request with the connected user's credentials attached.

```bash
# The path segment is the target URL, URL-safe base64 encoded:
# https://api.example.com/v1/me

curl "https://api.pipedream.com/v1/connect/{project_id}/proxy/aHR0cHM6Ly9hcGkuZXhhbXBsZS5jb20vdjEvbWU?external_user_id={external_user_id}&account_id=apn_xxxxxxx" \
  -H "Authorization: Bearer {access_token}" \
  -H "x-pd-environment: production"
```

Docs: [API proxy guide](https://pipedream.com/docs/connect/api-proxy.md)

## SDK

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "moodle-add-content-item-to-favorites",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    moodle: { authProvisionId: "apn_xxxxxxx" },
    courseId: "Course ID",
    sectionId: "Section ID",
  },
})
```

Docs: [Managed auth guide](https://pipedream.com/docs/connect/managed-auth/quickstart.md) · [Tools guide](https://pipedream.com/docs/connect/components.md)

## Actions (27)

### `moodle-add-content-item-to-favorites` — Add a Content Item to a User's Favorites (Write)

Adds a content item (activity, resource, or subtype) to the user's list of favorites. See the documentation

Full schema: https://pipedream.com/apps/moodle/actions/add-content-item-to-favorites.md

### `moodle-create-category` — Create a Category (Write)

Creates a new course category in Moodle. See the documentation

Full schema: https://pipedream.com/apps/moodle/actions/create-category.md

### `moodle-create-course` — Create a Course (Write)

Creates a new course in Moodle. See the documentation

Full schema: https://pipedream.com/apps/moodle/actions/create-course.md

### `moodle-create-user` — Create a User (Write)

Creates a new user in Moodle. See the documentation

Full schema: https://pipedream.com/apps/moodle/actions/create-user.md

### `moodle-delete-category` — Delete a Category (Write)

Deletes a course category in Moodle. Setting recursive to true will remove all courses and subcategories inside this category. See the documentation

Full schema: https://pipedream.com/apps/moodle/actions/delete-category.md

### `moodle-delete-courses` — Delete Courses (Write)

Deletes one or more existing Moodle courses by ID. See the documentation

Full schema: https://pipedream.com/apps/moodle/actions/delete-courses.md

### `moodle-duplicate-course` — Duplicate a Course (Write)

Duplicates an existing course, creating a new course with optional settings. See the documentation

Full schema: https://pipedream.com/apps/moodle/actions/duplicate-course.md

### `moodle-enroll-user-in-course` — Enroll a User in a Course (Write)

Manually enrolls a user into a specified course with a given role and optional start and end dates. See the documentation

Full schema: https://pipedream.com/apps/moodle/actions/enroll-user-in-course.md

### `moodle-get-course-by-field` — Get a Course by Field (Read-only)

Retrieves courses that match a specific field such as ID, short name, ID number, category, or section ID. See the documentation

Full schema: https://pipedream.com/apps/moodle/actions/get-course-by-field.md

### `moodle-get-course-module` — Get a Course Module (Read-only)

Retrieves detailed information about a specific course module using its CMID. See the documentation

Full schema: https://pipedream.com/apps/moodle/actions/get-course-module.md

### `moodle-get-course-update` — Get a Course Update (Read-only)

Checks if there are any updates affecting the current user in a specified Moodle course since a given timestamp. See the documentation

Full schema: https://pipedream.com/apps/moodle/actions/get-course-update.md

### `moodle-get-categories` — Get Categories (Read-only)

Retrieves a list of existing categories with ID and category name. See the documentation

Full schema: https://pipedream.com/apps/moodle/actions/get-categories.md

### `moodle-get-course-content` — Get Course Content (Read-only)

Retrieves the sections and modules (activities/resources) inside a course. See the documentation

Full schema: https://pipedream.com/apps/moodle/actions/get-course-content.md

### `moodle-get-course-content-items` — Get Course Content Items (Read-only)

Fetches all available content items, including activities, resources, and their subtypes, for the activity picker. See the documentation

Full schema: https://pipedream.com/apps/moodle/actions/get-course-content-items.md

### `moodle-get-courses` — Get Courses (Read-only)

Returns course details. If no IDs are provided, returns all courses except the front page. See the documentation

Full schema: https://pipedream.com/apps/moodle/actions/get-courses.md

### `moodle-get-enrolled-courses-by-timeline` — Get Enrolled Courses by Timeline Classification (Read-only)

Returns a list of courses the current user is enrolled in, filtered by timeline (future, inprogress, or past). See the documentation

Full schema: https://pipedream.com/apps/moodle/actions/get-enrolled-courses-by-timeline.md

### `moodle-get-enrolled-users` — Get Enrolled Users (Read-only)

Retrieves a list of users enrolled in a specific course, including their roles and groups. See the documentation

Full schema: https://pipedream.com/apps/moodle/actions/get-enrolled-users.md

### `moodle-import-course` — Import Course (Write)

Imports course data from one course into another without user data. See the documentation

Full schema: https://pipedream.com/apps/moodle/actions/import-course.md

### `moodle-list-category-id-options` — List Category ID Options (Read-only)

Retrieves available options for the Category ID field.

Full schema: https://pipedream.com/apps/moodle/actions/list-category-id-options.md

### `moodle-log-course-viewed` — Log a Course Viewed (Write)

Logs that a specific course has been viewed by the current user. See the documentation

Full schema: https://pipedream.com/apps/moodle/actions/log-course-viewed.md

### `moodle-remove-content-item-from-favorites` — Remove a Content Item from Favourites (Write)

Removes a specific content item from a user's list of favourites in Moodle. See the documentation

Full schema: https://pipedream.com/apps/moodle/actions/remove-content-item-from-favorites.md

### `moodle-search-courses` — Search Courses (Read-only)

Searches Moodle courses by name, module, block, or tag. See the documentation

Full schema: https://pipedream.com/apps/moodle/actions/search-courses.md

### `moodle-search-users` — Search Users (Read-only)

Searches for Moodle users that match specific criteria such as username, email, or ID. See the documentation

Full schema: https://pipedream.com/apps/moodle/actions/search-users.md

### `moodle-set-favourite-courses` — Set Favourite Courses (Write)

Adds or removes a course from the user's list of favourite courses. See the documentation

Full schema: https://pipedream.com/apps/moodle/actions/set-favourite-courses.md

### `moodle-update-category` — Update a Category (Write)

Updates an existing course category's name, ID number, or description. See the documentation

Full schema: https://pipedream.com/apps/moodle/actions/update-category.md

### `moodle-update-course` — Update a Course (Write)

Updates an existing course in Moodle, including name, summary, and visibility. See the documentation

Full schema: https://pipedream.com/apps/moodle/actions/update-course.md

### `moodle-update-user` — Update a User (Write)

Updates an existing user's details such as name, email, password, or department. See the documentation

Full schema: https://pipedream.com/apps/moodle/actions/update-user.md

---

- All apps: https://pipedream.com/apps — index: https://pipedream.com/llms.txt
- Pipedream docs for agents: https://pipedream.com/docs/llms.txt
