LearnWorlds

io.github.ohneben由 GitHub 帳號 ohneben 發布v1.1.2更新於 Oct 24, 2026

All 94 LearnWorlds LMS API endpoints as safety-categorized MCP tools (read/write/destructive).

概覽

AI 產生的概覽

把 LearnWorlds LMS 全部 94 個 API 端點包裝成附安全分類的 MCP 工具,讓助理讀取並管理課程、使用者、報名與付款。

可以做什麼
  • 讀取學校資料:使用者、課程、課程組合、報名、付款、訂閱、優惠券、證書、席次、推薦夥伴、社群、報表與事件記錄
  • 建立與更新記錄,例如使用者、報名、優惠券、使用者群組與學習進度
  • 刪除記錄,例如使用者、社群內容、席次、使用者群組與證書
  • 每個工具都附有唯讀、寫入或破壞性標示與 MCP 註解,說明中列出副作用、回傳結構與錯誤碼
適用情境
適合管理 LearnWorlds 線上學校的人員:希望助理直接回答使用者、營收、課程完成度等問題,或在對話中完成建立使用者、報名、發放優惠券等日常操作,不必切換介面。
執行需求
需要已開通 API 存取的 LearnWorlds 學校,並提供 LEARNWORLDS_BASE_URL、LEARNWORLDS_API_TOKEN 與 LEARNWORLDS_CLIENT_ID(皆為必填)。本機執行需 Docker(可用預先建置的映像)或 Node.js 18 以上從原始碼執行;支援 stdio 或 Streamable HTTP 傳輸。若 HTTP 端點超出本機回環,必須設定 MCP_AUTH_TOKEN。
安裝前請注意
API 權杖與 Client ID 具備線上學校資料的管理權限,請勿提交到版本庫,外洩後應立即在後台輪換。27 個寫入工具會建立或修改記錄,8 個破壞性工具會刪除記錄,執行前應先確認。HTTP 端點綁定到回環以外時必須設定 MCP_AUTH_TOKEN,而 MCP_ALLOW_INSECURE 會解除這層保護。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 LearnWorlds,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

ohneben's LearnWorlds MCP

[Buy Me A Coffee]


License & checks

[CI] [License: MIT]

MCP registries

[MCP Registry] [Listed on mcpservers.org] [Learnworlds-MCP MCP server]

Run your LearnWorlds school in plain language from AI assistants like Claude, Cursor, and any other MCP client.

This Model Context Protocol server exposes the LearnWorlds public API — all 94 endpoints, generated straight from the OpenAPI spec into MCP tools. Every tool is safety-categorized (🟢 read-only / 🟡 write / 🔴 destructive) so your assistant knows what an action does before it calls it. It runs over stdio (Claude Desktop and other local launchers) or Streamable HTTP (hosted in Docker), and ships with retries, client-side rate limiting, and request timeouts so it holds up against a live school.

Why you'll want this

Some MCP servers just forward an API. This one is built to be safe to hand to an LLM and easy to run for real:

What you getWhy it matters
All 94 endpoints, spec-drivenFull coverage of courses, users, enrollments, payments, subscriptions, coupons, certificates, seats, community and reporting — nothing hand-picked or left behind.
Every tool is safety-categorized 🟢 / 🟡 / 🔴A banner at the top of each tool description tells the model exactly what it does — read, create, update or delete — before it acts.
Descriptions written for agents, not humansEvery tool spells out its side effects, auth and rate-limit behavior, return shape, error codes, when not to reach for it, and which sibling tools are the alternatives.
Machine-readable MCP annotations (readOnlyHint, destructiveHint)Hosts that honor annotations (Claude included) can auto-trust reads and demand confirmation before anything destructive.
Automatic retries with backoffTransient 429 / 5xx responses are retried with jittered exponential backoff, honoring the server's Retry-After header.
Built-in rate limitingSelf-throttles under LearnWorlds' 30 requests / 10 s cap so a burst of tool calls never trips a 429.
Per-request timeoutsA hung upstream call is aborted and retried instead of freezing the server.
Two transports: stdio and Streamable HTTPUse it locally in Claude Desktop, or run one always-on server that any number of MCP clients reach over HTTP.
Docker + docker-compose, health check, auto-restartProduction-style deployment out of the box: docker compose up and it stays up.
Bearer-token auth on the HTTP endpointRequired as soon as the server is bound beyond loopback: without MCP_AUTH_TOKEN it refuses to start rather than exposing the API unprotected.
Your secrets never reach the modelCredentials live in the server's environment and are injected on every request — the assistant only ever sees tool inputs and API responses.
Drop-in spec updatesLearnWorlds ships a newer YAML? Replace one file and rebuild — new endpoints become new tools automatically, no code changes.

How it compares

At the time of writing this appears to be the only dedicated LearnWorlds MCP server. You could instead point a generic OpenAPI→MCP wrapper at the spec — here's what that leaves on the table:

CapabilityThis projectGeneric OpenAPI→MCP wrapper*
All 94 LearnWorlds endpoints as tools✅✅
Per-tool 🟢 / 🟡 / 🔴 safety category + banner✅❌
readOnlyHint / destructiveHint MCP annotations✅➖
$ref dereferencing + recursion-safe schemas✅➖
Automatic retries on 429 / 5xx (honors Retry-After)✅❌
Client-side rate limiting (stays under 30 req / 10 s)✅❌
Per-request timeout with abort✅➖
stdio transport✅✅
Streamable-HTTP transport✅➖
Docker + docker-compose, health check, auto-restart✅❌
Enforced bearer-token auth on the endpoint✅❌
Credentials injected server-side, never sent to the model✅➖
LicenseMITvaries

*Generic OpenAPI→MCP wrappers turn any Swagger/OpenAPI spec into MCP tools. They can reach the same endpoints, but treat every operation identically — no safety categories, no resilience, no deployment story, and no guardrails tuned for live school data. "➖" = varies by tool / not guaranteed. Snapshot from July 2026.

What you can do

Once it's connected, ask your assistant things like:

  • "List the 10 most recent users who signed up this month."
  • "Create a user for [email protected] and enroll her in the 'Pro' bundle."
  • "Show me this month's payments and total revenue."
  • "Which users haven't completed the 'Onboarding' course yet?"
  • "Create a 20%-off coupon for the annual subscription plan."
  • "Pull completion analytics for our top 5 courses."

Tools are generated automatically from the API and grouped into 🟢 read-only, 🟡 write, and 🔴 destructive — so a well-behaved host can treat each group differently.

How it works

Claude / Cursor / any MCP client  ──MCP──►  this server  ──HTTPS──►  LearnWorlds API (your school)

The server parses the bundled OpenAPI spec into MCP tools (resolving $refs and guarding against recursive schemas), tags each with its safety category, and injects your bearer token and Lw-Client header on every outgoing request. Your credentials stay in the server's environment — the model never sees or handles them.

Requirements

  • A LearnWorlds school with API access — an access token and a Client ID (admin → Settings → Integrations → Developers), plus your school's API base URL. See Get your API credentials.
  • Docker (Docker Desktop on macOS/Windows) for the quick start below — or Node.js ≥ 18 to run from source.

Quick start (Docker)

1. Add your credentials. Copy the example config and fill it in:

bash
cp .env.example .env# edit .env → set LEARNWORLDS_BASE_URL, LEARNWORLDS_API_TOKEN, LEARNWORLDS_CLIENT_ID#           → set MCP_AUTH_TOKEN (required once the port is published beyond#             127.0.0.1): openssl rand -hex 32

2. Start the server:

bash
docker compose up -d --build

The bundled docker-compose.yml binds to 127.0.0.1:8765 only, so the server is reachable from your machine but not the network.

3. Confirm it's running:

bash
curl -s http://localhost:8765/health# → {"status":"ok","server":"learnworlds-mcp","tools":94}

4. Connect your MCP client. The MCP endpoint is http://localhost:8765/mcp.

  • Claude Desktop — add a custom connector (Settings → Connectors) pointing at the URL, or bridge it locally with mcp-remote. Add this under mcpServers in your config, then fully quit and reopen the app:

    json
    {  "mcpServers": {    "learnworlds": {      "command": "npx",      "args": [        "mcp-remote",        "http://localhost:8765/mcp",        "--header", "Authorization: Bearer YOUR_MCP_AUTH_TOKEN"      ]    }  }}

    (Drop the --header line if you left MCP_AUTH_TOKEN empty.)

  • Claude Code — one command:

    bash
    claude mcp add --transport http learnworlds http://localhost:8765/mcp
  • Claude Cowork — shares Claude Code's MCP config, so the command above makes the tools available there too.

Prefer a prebuilt image?

Every push to main publishes a ready-to-run image to the GitHub Container Registry, so you can skip the local build entirely:

bash
docker run -d --name learnworlds-mcp -p 127.0.0.1:8765:8765 --env-file .env \  ghcr.io/ohneben/learnworlds-mcp:latest

Get your API credentials

  1. Log in to your LearnWorlds school admin.
  2. Go to Settings → Integrations → Developers (the API screen).
  3. Copy your Access Token → LEARNWORLDS_API_TOKEN, and your Client ID → LEARNWORLDS_CLIENT_ID.
  4. Set LEARNWORLDS_BASE_URL to your school's API base: https://<your-school>.learnworlds.com/admin/api. If your school uses a custom domain, use that host instead (e.g. https://academy.example.com/admin/api).

Put all three in .env. The server injects them on every request, so your assistant never sees them.

Configuration

Everything is set in .env (copied from .env.example):

VariableRequiredDefaultDescription
LEARNWORLDS_BASE_URL✅—Your school's API base URL
LEARNWORLDS_API_TOKEN✅—Bearer access token
LEARNWORLDS_CLIENT_ID✅—Sent as the Lw-Client header
MCP_TRANSPORT—stdiostdio or http (the Docker image defaults to http)
PORT—8765HTTP listen port
HOST—0.0.0.0HTTP bind address
MCP_HTTP_PATH—/mcpHTTP MCP route
MCP_AUTH_TOKEN⚠️(off)Require Authorization: Bearer <token> on /mcp. Required when HOST is not a loopback address, otherwise the server refuses to start. Renamed from MCP_SHARED_TOKEN in 1.1.0
MCP_ALLOWED_HOSTS—(automatic)Comma-separated hostnames accepted in the Host header (DNS-rebinding protection). Needed behind a reverse proxy
MCP_ALLOW_INSECURE—(off)Lifts the startup refusal. Only for an endpoint nobody else can reach
MCP_SESSION_TTL—1800Idle seconds before a session is dropped
MCP_MAX_SESSIONS—256Maximum concurrent sessions
MCP_BODY_LIMIT—25mbLargest accepted request body
LEARNWORLDS_MAX_REQUESTS—25Client-side requests per window (0 disables throttling)
LEARNWORLDS_RATE_WINDOW_MS—10000Rate-limit window in ms
LEARNWORLDS_MAX_RETRIES—3Retries on 429 / 5xx / network errors
LEARNWORLDS_TIMEOUT_MS—30000Per-attempt request timeout
LEARNWORLDS_OPENAPI_PATH—(bundled)Load a different OpenAPI YAML

After changing .env, reload with docker compose up -d --force-recreate.

Tool safety categories

Each tool's description starts with one of these banners and carries the matching MCP annotations:

BannerCountreadOnlyHintdestructiveHintMeaning
🟢 READ-ONLY59truefalseFetches data only. Safe.
🟡 WRITE · creates data—falsefalsePOST — creates records (not idempotent; may duplicate).
🟡 WRITE · updates data—falsefalsePUT — modifies existing records in place (idempotent).
🔴 DESTRUCTIVE · deletes8falsetrueDELETE — removes a record. Confirm first.

The 🟡 write tools total 27 (17 create + 10 update). Hosts that respect annotations (Claude included) can require confirmation for destructiveHint tools and trust readOnlyHint tools automatically.

Under the banner, every description follows the same layout so an agent can act on the first read instead of probing:

LineWhat it answers
(purpose)What the endpoint does, straight from the OpenAPI spec, stated once.
BehaviorWhat the call does to the live school, whether it is idempotent, and how auth, throttling and retries are handled for it.
ParametersOnly what the input schema cannot say — the body wrapper, paging, and any renamed argument.
ReturnsThe HTTP <status> + JSON result shape and the error codes that can come back.
Use whenWhen to reach for it, when not to, and up to five sibling tools in the same area.

Run npm run list-tools (no credentials needed) to print the full catalog and the per-category counts at any time.

Coverage by area (read / write / delete)
Area🟢 Read🟡 Write🔴 Delete
Users1071
Affiliates710
Community632
Courses530
Promotions (coupons)430
Reporting400
Payments300
Multiple seats332
User groups332
Bundles200
Assessments210
Subscription plans200
Certificates111
User subscriptions100
User roles100
Installments100
Leads100
Calendar100
Event logs100
Asynchronous actions100
Update user progress020
Total59278

Run from source (stdio, no Docker)

Prefer the classic stdio mode for Claude Desktop? Build it locally:

bash
npm installnpm run build

Then point Claude Desktop at the compiled entrypoint in claude_desktop_config.json:

json
{  "mcpServers": {    "learnworlds": {      "command": "node",      "args": ["/ABSOLUTE/PATH/Learnworlds-MCP/dist/index.js"],      "env": {        "MCP_TRANSPORT": "stdio",        "LEARNWORLDS_BASE_URL": "https://your-school.learnworlds.com/admin/api",        "LEARNWORLDS_API_TOKEN": "your-access-token",        "LEARNWORLDS_CLIENT_ID": "your-client-id"      }    }  }}

Keeping the spec current

The bundled spec/learnworlds-openapi.yaml is the source of truth for the tools. To refresh against a newer API version, drop the new YAML in its place (or point LEARNWORLDS_OPENAPI_PATH at it) and rebuild:

bash
docker compose up -d --build   # Docker# ornpm run build                  # from source

New paths become new tools automatically — no code changes needed.

Development

bash
npm installnpm run build      # compile TypeScript → dist/npm test           # run the Vitest suitenpm run list-tools # print the categorized tool catalog (no credentials needed)

CI builds and tests every push across Node 20 and 22; pushes to main also publish a Docker image to the GitHub Container Registry. When the version in server.json is one the official MCP Registry does not yet list, that same run also publishes it there.

Notes & conventions

  • Transports: MCP_TRANSPORT=stdio (default) for local launchers; MCP_TRANSPORT=http for the always-on Streamable-HTTP server the Docker image runs.
  • Paging: most get tools accept page (and endpoint-specific filters); LearnWorlds paginates list responses (commonly 20–50 items per page).
  • Rate limit: LearnWorlds allows 30 requests / 10 s; the server self-throttles at LEARNWORLDS_MAX_REQUESTS per LEARNWORLDS_RATE_WINDOW_MS (default 25 / 10 s) and retries any 429 it still receives.
  • Request bodies: write tools take a body argument; its schema is resolved from the spec and shown to the model.

Security

  • Your API credentials live only in .env, which is git-ignored. Never commit real secrets. If the token leaks, rotate it in LearnWorlds admin → Settings → Integrations → Developers (API).
  • The HTTP endpoint requires a token as soon as it is bound beyond loopback. Without MCP_AUTH_TOKEN the server refuses to start and the error explains what to do. Send it as an Authorization: Bearer <token> header, ideally behind TLS.
  • On localhost too: without a token the Host header is restricted to localhost names, so no web page can reach the endpoint via DNS rebinding. A loopback bind alone is not protection. Behind a reverse proxy, set MCP_ALLOWED_HOSTS.
  • Behind a reverse proxy, pin the Host header in the proxy to the internal upstream name and put exactly that into MCP_ALLOWED_HOSTS. The check then does not depend on the public domain and survives a domain change. (Tip from @WinFuture23.)
  • /health sits behind the Host check but in front of the token check, so a platform health check needs no token. It additionally accepts localhost, 127.0.0.1 and [::1] at all times, so the HEALTHCHECK in the bundled Dockerfile keeps working when you pin MCP_ALLOWED_HOSTS to a public hostname. If your platform probes over HTTP from elsewhere, its hostname has to be in the list: Railway sends Host: healthcheck.railway.app.

See SECURITY.md for the full policy and how to report a vulnerability.

Credits & license

An unofficial community integration for LearnWorlds; not affiliated with or endorsed by LearnWorlds. Built on the Model Context Protocol. Licensed under the MIT License.

來源:README.md,提交 980bdd1

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v1.1.2最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分