An open API service indexing awesome lists of open source software.

https://github.com/gocodebox/lifterlms-mcp

MCP Server for LifterLMS
https://github.com/gocodebox/lifterlms-mcp

Last synced: 4 days ago
JSON representation

MCP Server for LifterLMS

Awesome Lists containing this project

README

          

# LifterLMS MCP Server

An [MCP (Model Context Protocol)](https://modelcontextprotocol.io) server that connects AI assistants to your LifterLMS site. Manage courses, lessons, memberships, enrollments, and student progress through natural conversation.

Works with **Claude Desktop**, **Cursor**, **Claude Code**, and any MCP-compatible client.

## Quick Start

### 1. Clone and install

The package is not yet published to npm. For now, install from source:

```bash
git clone https://github.com/gocodebox/lifterlms-mcp.git
cd lifterlms-mcp
npm install
```

Note the absolute path to `src/index.js` — you'll use it in your MCP client config.

### 2. Create a WordPress Application Password

In your WordPress admin: **Users → Your Profile → Application Passwords**.

Enter a name (e.g. "MCP Server") and click **Add New Application Password**. Copy the generated password (it's shown once).

### 3. Configure your MCP client

Add the following to your client's MCP servers config, replacing `/absolute/path/to/lifterlms-mcp/src/index.js` with the path from step 1. The same block works for Claude Desktop, Claude Code, Cursor, and any other MCP-compatible client — only the file location of the client's config differs.

```json
{
"mcpServers": {
"lifterlms": {
"command": "node",
"args": ["/absolute/path/to/lifterlms-mcp/src/index.js"],
"env": {
"WP_URL": "https://your-site.com",
"WP_APP_USER": "your-username",
"WP_APP_PASSWORD": "xxxx xxxx xxxx xxxx xxxx xxxx"
}
}
}
}
```

Common config file locations:

- **Claude Desktop (macOS):** `~/Library/Application Support/Claude/claude_desktop_config.json`
- **Claude Desktop (Windows):** `%APPDATA%\Claude\claude_desktop_config.json`
- **Claude Code:** `~/.claude/settings.json` (or use `claude mcp add` to add it interactively)
- **Cursor:** `~/.cursor/mcp.json`

### 4. Start using it

Ask your AI assistant things like:

- "List all my courses"
- "Create a new course called 'Introduction to Python' with 3 sections"
- "Enroll student #42 in course #15"
- "Show me the progress for all students in the JavaScript course"
- "Create a $49/month access plan for the Photography membership"

## Tools

44 tools total, organized by resource. LifterLMS tools map to `/wp-json/llms/v1/*`; WordPress page tools map to `/wp-json/wp/v2/pages` for handbook-style and landing-page content.

### Courses (7 tools)
| Tool | Description |
|------|-------------|
| `list_courses` | List courses with search, filtering, and pagination |
| `get_course` | Get course details by ID |
| `create_course` | Create a new course |
| `update_course` | Update course title, content, status, visibility |
| `delete_course` | Delete a course |
| `get_course_content` | Get full course structure (sections + lessons) |
| `get_course_enrollments` | List enrolled students |

### Sections (5 tools)
| Tool | Description |
|------|-------------|
| `list_sections` | List sections, filter by course |
| `get_section` | Get section details |
| `create_section` | Create a section in a course |
| `update_section` | Update section title or order |
| `delete_section` | Delete a section |

### Lessons (5 tools)
| Tool | Description |
|------|-------------|
| `list_lessons` | List lessons, filter by section |
| `get_lesson` | Get lesson details |
| `create_lesson` | Create a lesson with content, drip settings, points |
| `update_lesson` | Update lesson properties |
| `delete_lesson` | Delete a lesson |

### Memberships (5 tools)
| Tool | Description |
|------|-------------|
| `list_memberships` | List memberships |
| `get_membership` | Get membership details |
| `create_membership` | Create a membership |
| `update_membership` | Update membership properties |
| `delete_membership` | Delete a membership |

### Access Plans (5 tools)
| Tool | Description |
|------|-------------|
| `list_access_plans` | List pricing plans |
| `get_access_plan` | Get plan details |
| `create_access_plan` | Create one-time or recurring pricing |
| `update_access_plan` | Update plan pricing or settings |
| `delete_access_plan` | Delete a plan |

### Students (5 tools)
| Tool | Description |
|------|-------------|
| `list_students` | List students, filter by enrollment |
| `get_student` | Get student details |
| `create_student` | Create a student account |
| `update_student` | Update student info |
| `delete_student` | Delete a student |

### Enrollments (4 tools)
| Tool | Description |
|------|-------------|
| `list_enrollments` | List a student's enrollments |
| `enroll_student` | Enroll in a course or membership |
| `update_enrollment` | Update enrollment status |
| `unenroll_student` | Remove enrollment |

### Student Progress (3 tools)
| Tool | Description |
|------|-------------|
| `get_progress` | Get progress in a course/lesson |
| `update_progress` | Mark lessons complete |
| `delete_progress` | Reset progress |

### Pages (5 tools)

Generic WordPress page CRUD for non-LifterLMS content. Use these for handbook pages, top-level landing pages, and anything that lives outside the LifterLMS course/membership structure. Content accepts Gutenberg block markup.

| Tool | Description |
|------|-------------|
| `list_pages` | List pages with search, parent filter, and pagination |
| `get_page` | Get page by ID. Use `context=edit` for raw block markup |
| `create_page` | Create a new page (Gutenberg block markup or HTML) |
| `update_page` | Update title, slug, status, parent, content |
| `delete_page` | Trash a page (`force=true` for permanent deletion) |

## Resources

Three read-only MCP resources for passive context (no tool call required):

| Resource | URI | Description |
|----------|-----|-------------|
| Site Info | `lifterlms://site/info` | Site name, description, URL, home URL, timezone |
| Course Catalog | `lifterlms://courses/catalog` | Summary of all courses (id, title, status, permalink) |
| Membership Catalog | `lifterlms://memberships/catalog` | Summary of all memberships (id, title, status, permalink) |

## Requirements

- **Node.js 18+**
- **WordPress** with [LifterLMS](https://lifterlms.com) active
- **Application Passwords** enabled (default in WordPress 5.6+)
- An admin user with LifterLMS management capabilities

## Security

- The MCP operates with the privileges of the configured WordPress Application Password. Treat it as a credential — keep it out of source control and rotate it if exposed.
- Always use an `https://` WordPress URL. Sending Application Passwords over plain HTTP exposes them in transit.
- Create a separate Application Password per MCP client / environment so you can revoke them independently.
- To report a security vulnerability, see [`SECURITY.md`](SECURITY.md) and https://lifterlms.com/security/. Do not open a public issue.

## Development

```bash
git clone https://github.com/gocodebox/lifterlms-mcp.git
cd lifterlms-mcp
npm install

# Run the included smoke test against a live site
cp test/.test.env.template test/.test.env
# Edit test/.test.env with your credentials
source test/.test.env && node test/test-courses.js

# Run the server locally over stdio
WP_URL=https://your-site.com WP_APP_USER=admin WP_APP_PASSWORD="xxxx xxxx" node src/index.js
```

## Architecture

```
MCP Client (Claude / Cursor / etc.)
│ stdio (JSON-RPC)

lifterlms-mcp (Node.js)
│ axios + Basic Auth

WordPress REST API (/wp-json/llms/v1/*)

LifterLMS Plugin
```

The server is a thin translation layer. Every tool maps to one LifterLMS REST API call. No custom PHP, no WordPress plugin — just the standard `llms/v1` API that ships with LifterLMS.

## License

GPL-3.0-or-later. See [`LICENSE`](LICENSE).