# getcourse-mcp
**Automate a [GetCourse](https://getcourse.io) account from an AI agent — grant lesson/training access, manage users and groups — with no official API.**
[](https://www.npmjs.com/package/getcourse-mcp)




**English** · [Русский](./README.ru.md)
## Why
GetCourse has no public API for the things admins do every day — opening a lesson for a student, adding someone to a training, moving users between groups. Those actions live only in the admin UI.
**getcourse-mcp** exposes them as [MCP](https://modelcontextprotocol.io) tools. It drives a **browser you're already logged into** over CDP, so it reuses your real session cookie and CSRF token — no scraping of passwords, no fragile API keys. An AI agent (Claude, etc.) can then find a user, inspect their groups and grant access in one turn.
- 🔑 **Uses your live session** — connects over CDP to a logged-in Chromium/Yandex browser
- 👥 **Access by groups** — the GetCourse model: training/lesson access = group membership
- 🧩 **5 focused tools** — status, find user, list groups, check membership, add to groups
- 🪶 **TypeScript, ESM** — thin, strict, MIT, no account secrets in the repo
## How access works in GetCourse
Access to a training (and its lessons) is granted by **group membership**. "Full access" to a course often means membership in a *Module 1* group plus a group that starts the drip schedule (module 1 now, the rest on a timer). To "give access like another student", read their groups and reproduce them:
```bash
gc_find_user # student@example.com → id, name
gc_check_membership # which of these groups is student X in?
gc_add_user_to_groups # add student Y to the same groups
```
### Franchise / "buyers-only" offers → access via a *completed* purchase
Some offers (franchises, "только купившие" trainings) deliver access **only from a completed purchase** — group membership grants nothing there. Grant it in one call:
```bash
gc_find_offers {"query":"Трафик Формула"} # → offer id, e.g. 6510356
gc_create_order {"email":"user@x.ru","offerIds":["6510356"],"complete":true}
# creates the order AND completes a 0₽ payment → access is live immediately
```
⚠️ **A priced deal left in «Новый» delivers NO access** — it must be *paid*. `complete:true` (or a later `gc_pay_order {"dealId":"…"}`) completes it → «Завершен» → access granted. GetCourse rejects a zero payment («Платеж не может быть нулевым»), so a 0₽ deal is completed via the status dropdown (`payed` = «Завершен»); a priced one via a *received* payment. The result is read from the deal's own «Статус:» field after a reload. Use `complete` only for 0₽/comp offers.
A **0₽ order has nothing to pay**, so GetCourse flips it «Новый → Завершен» on creation by itself; `complete:true` then detects the finished deal and touches nothing. Purchase-based access does **not** appear in the user's groups — that's by design, not a bug. Verify it on `/teach/control/stat/user/id/