classroom-mcp
Reads the student's Google Classroom account: lists courses, assignments with due dates, submission states and grades, course materials, topics and teacher announcements, fetches full assignment text with teacher and student attachments, snapshots a course to JSON, and turns in assignments (individually or in batch) by driving the Classroom web interface in a headless browser.
Google Docs from a course are downloaded via the Drive API during course export and saved locally as DOCX files.
Uses the Drive API to download teacher attachments and course files (with graceful fallback to links when conversion fails) and to match files already attached to a submission by name, size and MD5.
Google Slides presentations found in a course are exported and saved locally as PPTX files during course export.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
classroom-mcp
English
An MCP server and command-line tool for a student's Google Classroom account. Connect it to Claude, Cursor or any other MCP client, and the assistant can see your courses, assignments with due dates and grades, and teacher announcements. It can also download a whole course with its files and turn in your work.
Reading goes through the official Classroom and Drive APIs. Submitting goes through a headless browser, because the Classroom API only lets the Cloud project that created an assignment modify a student's submission, and assignments are created by teachers.
Tools
Tool | What it does |
| Your courses with their IDs |
| Assignments of a course with due date, your submission state and grade. Filters: |
| Full assignment text, the teacher's attachments and your attached files |
| Course materials: lectures, guides, links |
| Latest posts in the course stream |
| Downloads the whole course to a folder. Google Docs, Sheets, Slides and Drawings are saved as DOCX, XLSX, PPTX and PDF |
| Checks, without opening a window, that the browser profile is signed in to the right account |
| Opens a browser window for a one-time sign-in |
| Attaches files and turns in an assignment in the background |
| Submits several assignments from one or more courses in a single run |
| Result of a background submission |
| Latest submission runs with their results |
| Saves the whole course as one JSON file: assignments with your submissions, materials, announcements |
A course or assignment can be referred to by ID, by full title, or by a unique part of the title, such as "java" or "Lab 3".
Before you install
The server acts as your account, so every user creates their own Google Cloud project. It is free and takes about ten minutes. This repository ships no keys.
Some universities block third-party apps for their accounts. Google then shows admin_policy_enforced, and nothing works without the administrator's approval.
Submitting clicks buttons in the Classroom web interface the way you would. Buttons are found by their Ukrainian, English or Russian labels. If Google changes the interface, this part will need an update. Google's terms discourage automating its interface, so use submission at your own discretion and only for your own work. Reading and exporting through the API are not affected.
Installation
You need Python 3.10 or newer. Chrome or Edge is needed for submitting and for reading announcements where the university has closed API access to them.
git clone https://github.com/shkbb/classroom-mcp.git
cd classroom-mcp
py -m venv .venv
.\.venv\Scripts\python.exe -m pip install -r requirements.txtOn macOS and Linux use python3 instead of py and .venv/bin/python instead of .\.venv\Scripts\python.exe.
Google Cloud project
Open the Google Cloud Console and create a new project with any name.
Enable the Google Classroom API and the Google Drive API in it.
Go to Google Auth Platform and click Get started. Choose External as the audience. If your school account belongs to a university domain you can choose Internal, but only when the project was created in that same domain.
Under Audience, keep the Testing status and add your school address to Test users.
Under Data Access, click Add or remove scopes and add the scopes from the table below.
Under Clients, click Create client, choose Desktop app and download the JSON. Save it in the repository folder as
credentials.json, or point theCLASSROOM_CREDENTIALSvariable at it.
Scope | Used for |
| Course list |
| Topic names |
| Assignments, your submissions and grades |
| Course materials |
| Announcements |
| Downloading attachments and checking files you already attached |
All scopes are read-only. The server cannot change anything in Classroom through the API.
In Testing mode Google issues a refresh token that lasts about 7 days. After that the server asks you to sign in again. To avoid this, switch the project to In production. A personal app does not have to go through Google verification: sign-in shows an "unverified app" warning, which you can skip because the app is yours.
First sign-in
Run this once in a terminal:
.\.venv\Scripts\python.exe classroom_export.py listA browser opens with the Google sign-in. Pick your school account and grant the permissions. The command then prints your courses, and the token is stored outside the repository, in %LOCALAPPDATA%\ClassroomExporter on Windows or ~/.local/share/ClassroomExporter on macOS and Linux. The server itself never opens a sign-in window. When the token expires, it tells you which command to run.
To switch to another account:
.\.venv\Scripts\python.exe classroom_export.py --login-again listConnecting a client
Claude Code (use your own absolute paths):
claude mcp add classroom --env CLASSROOM_ACCOUNT=student@university.edu -- C:\path\classroom-mcp\.venv\Scripts\python.exe C:\path\classroom-mcp\classroom_mcp.pyClaude Desktop, Cursor and other clients with a JSON config:
{
"mcpServers": {
"classroom": {
"command": "C:\\path\\classroom-mcp\\.venv\\Scripts\\python.exe",
"args": ["C:\\path\\classroom-mcp\\classroom_mcp.py"],
"env": { "CLASSROOM_ACCOUNT": "student@university.edu" }
}
}
}Restart the client and ask something like "which Java assignments haven't I turned in yet?".
Submitting work
For submissions the server uses its own browser profile, separate from your everyday Chrome. Sign in to it once: ask the assistant to call open_browser_login, or run
.\.venv\Scripts\python.exe classroom_export.py browser-loginSign in to your school account in the window that opens, then close it. You type the password yourself; the server never sees it. After that the browser runs without windows.
submit_assignment has three modes:
Mode | What happens |
| Attach the files and turn in |
| Unsubmit an already turned-in work, attach only the missing files and turn it in again. Existing attachments are never removed |
| Replace attached files that have the same name as the new ones but different content, then turn in again. Works for DOCX, PDF, ZIP and PPTX |
| Mark as done without files |
Without confirm=true the server only checks access to the assignment and the files and changes nothing. The server instructions tell the assistant to show you the check result first and to submit only after you agree. Files are passed as absolute paths, up to 20 per assignment. submit_batch takes a list of the same items, checks all of them before uploading anything, and skips work that is already turned in.
replace_files removes only the exact Drive file recorded when the plan was made (its ID, size and MD5). If that file changed in the meantime, the submission stops. A new file whose name matches nothing in a turned-in work is an error in this mode; use add_files for it.
The submission runs in a background thread of the server, and submission_status reports the result. The run lives as long as the client session. If the client closes mid-way, the run shows as INTERRUPTED, and starting the same submission again continues where it stopped. Before uploading, the tool computes a SHA-256 of every file and stops if a file changed after planning. Files that are already attached are matched through the Drive API by name, size and MD5, so an interrupted run can be repeated without duplicates. An attached file with the same name but different content stops the submission with an explanation. A screenshot of the page is saved after every successful submission.
Command line without MCP
Everything is also available from a terminal.
.\.venv\Scripts\python.exe classroom_export.py list
.\.venv\Scripts\python.exe classroom_export.py export "Course name or ID" --output D:\exports
.\.venv\Scripts\python.exe classroom_read.py announcements "Course name"Export layout:
Course name/
├── Topic name/
│ └── Assignment title/
│ ├── readme.txt
│ └── Lecture 1.pptx
├── Без теми/
├── Оголошення/
└── export-warnings.txtБез теми holds posts without a topic and Оголошення holds announcements; the tool's own folder and message names are in Ukrainian. Links, YouTube videos and Google Forms are saved as .txt files with the URL. If a file cannot be downloaded or Drive cannot convert it (Google Docs export is limited to 10 MB), the tool keeps the link and writes the reason to export-warnings.txt.
Submitting from the command line works through a plan. Describe the work in a manifest first; file paths are relative to the manifest's folder:
{
"account": "student@university.edu",
"courses": [
{
"course": "Course name or ID",
"assignments": [
{ "title": "Lab 1", "files": ["lab1.docx", "lab1.zip"] },
{ "title": "Lab 2", "files": ["lab2.docx"], "replaceFiles": true },
{ "title": "Lab 3", "files": ["lab3-video.mp4"], "addAttachments": true },
{ "title": "Quiz", "files": [], "markAsDone": true }
]
}
]
}.\.venv\Scripts\python.exe classroom_export.py prepare-submit manifest.json --output plan.json
.\.venv\Scripts\python.exe classroom_export.py start-submit plan.json --check-only
.\.venv\Scripts\python.exe classroom_export.py start-submit plan.json
.\.venv\Scripts\python.exe classroom_export.py submit-status RUN_IDreplaceFiles, addAttachments and markAsDone work like the replace_files, add_files and mark_done modes above; one assignment takes at most one of them. From the command line, start-submit runs as a separate process with no window, so it keeps going after the terminal closes. classroom_read.py course "Course name" --output course.json saves the same snapshot as save_course_snapshot.
Configuration
Variable | Default | Sets |
|
| OAuth client file |
| none | School address for submitting and for reading the stream through the browser |
|
| Where courses are exported |
|
| Token, browser profile, submission logs |
| detected Chrome or Edge | Browser path |
credentials.json, the token and the browser profile give access to your account. Do not commit them or send them to anyone. .gitignore already excludes credentials.json, and everything else lives outside the repository.
If the university blocks the announcements scope and the API returns 403, list_announcements reads the course stream through the browser profile. That requires signing in with browser-login.
Tests
.\.venv\Scripts\python.exe -X utf8 -m unittest -vThe submission tests drive a real headless Chrome against a local page, so Chrome or Edge must be installed.
License
MIT, see LICENSE.
Related MCP server: Classroom MCP
Українська
MCP-сервер і консольна утиліта для студентського акаунта Google Classroom. Підключається до Claude, Cursor або іншого MCP-клієнта, після чого асистент бачить ваші курси, завдання з дедлайнами й оцінками, оголошення викладачів, може вивантажити курс разом із файлами на диск і здати роботу.
Читання працює через офіційні Classroom API і Drive API. Здача робіт іде через прихований браузер: Classroom API дозволяє змінювати роботу студента лише тому Cloud-проєкту, який створив завдання, а завдання створює викладач.
Що вміє сервер
Інструмент | Що робить |
| Курси акаунта з ID |
| Завдання курсу: дедлайн, стан вашої роботи, оцінка. Фільтр |
| Повний текст завдання, вкладення викладача і ваші прикріплені файли |
| Матеріали курсу: лекції, методички, посилання |
| Останні оголошення у стрічці курсу |
| Вивантажує весь курс у папку. Google Docs, Sheets, Slides і Drawings зберігаються як DOCX, XLSX, PPTX і PDF |
| Перевіряє без вікон, чи браузерний профіль увійшов у потрібний акаунт |
| Відкриває вікно браузера для одноразового входу |
| Прикріплює файли й здає роботу у фоні |
| Здає кілька завдань з одного чи різних курсів за один запуск |
| Результат фонової здачі |
| Останні запуски здачі та їхні результати |
| Зберігає весь курс в один JSON: завдання з вашими роботами, матеріали, оголошення |
Курс і завдання можна називати за ID, за повною назвою або за унікальним шматком назви: «java», «ПР 3».
Перед тим як ставити
Сервер працює від імені вашого акаунта, тому кожен користувач створює власний проєкт у Google Cloud. Це безкоштовно і займає хвилин десять. Ключі з цього репозиторію ніхто не отримує, бо їх тут немає.
Деякі університети забороняють сторонні застосунки для своїх акаунтів. Тоді Google покаже admin_policy_enforced, і без дозволу адміністратора нічого не вийде.
Здача натискає кнопки в інтерфейсі Classroom, як це робили б ви. Кнопки шукаються за текстом українською, англійською та російською. Якщо Google змінить інтерфейс, цю частину доведеться оновлювати. Правила Google не схвалюють автоматизацію їхнього інтерфейсу, тому користуйтеся здачею на власний розсуд і лише для власних робіт. Читання й експорт через API цього не стосуються.
Встановлення
Потрібен Python 3.10 або новіший. Chrome чи Edge знадобиться для здачі робіт і для читання оголошень там, де університет закрив до них доступ через API.
git clone https://github.com/shkbb/classroom-mcp.git
cd classroom-mcp
py -m venv .venv
.\.venv\Scripts\python.exe -m pip install -r requirements.txtНа macOS і Linux замість py пишіть python3, а замість .\.venv\Scripts\python.exe пишіть .venv/bin/python.
Проєкт у Google Cloud
Відкрийте Google Cloud Console і створіть новий проєкт. Назва будь-яка.
Увімкніть у ньому Google Classroom API і Google Drive API.
Перейдіть у Google Auth Platform і натисніть Get started. Тип аудиторії оберіть External. Якщо ваш навчальний акаунт належить домену університету, можна обрати Internal, але це вдається лише тоді, коли проєкт створено в тому ж домені.
У розділі Audience залиште режим Testing і додайте свою навчальну адресу в Test users.
У розділі Data Access натисніть Add or remove scopes і додайте дозволи з таблиці нижче.
У розділі Clients натисніть Create client, оберіть тип Desktop app і завантажте JSON. Покладіть файл у папку репозиторію під назвою
credentials.jsonабо вкажіть шлях до нього у зміннійCLASSROOM_CREDENTIALS.
Дозвіл | Навіщо |
| Список курсів |
| Назви тем |
| Завдання, ваші роботи й оцінки |
| Матеріали курсу |
| Оголошення |
| Завантаження вкладень і перевірка вже прикріплених файлів |
Усі дозволи лише на читання. Змінити щось у Classroom через API сервер не може.
У режимі Testing Google видає токен приблизно на 7 днів. Коли він закінчиться, сервер попросить увійти знову. Щоб цього не було, проєкт треба перевести в режим In production. Для особистого користування підтверджувати застосунок у Google не обов'язково: при вході з'явиться попередження про неперевірений застосунок, і його можна пропустити, бо застосунок ваш.
Перший вхід
Один раз виконайте в терміналі:
.\.venv\Scripts\python.exe classroom_export.py listВідкриється браузер із входом Google. Оберіть навчальний акаунт і дайте дозволи. Після цього команда покаже список курсів, а токен збережеться поза репозиторієм, у %LOCALAPPDATA%\ClassroomExporter на Windows або ~/.local/share/ClassroomExporter на macOS і Linux. Сам сервер вікна входу не відкриває. Якщо токен прострочився, він повідомить, яку команду запустити.
Щоб увійти в інший акаунт:
.\.venv\Scripts\python.exe classroom_export.py --login-again listПідключення до клієнта
Claude Code (шляхи підставте свої, абсолютні):
claude mcp add classroom --env CLASSROOM_ACCOUNT=student@university.edu -- C:\path\classroom-mcp\.venv\Scripts\python.exe C:\path\classroom-mcp\classroom_mcp.pyClaude Desktop, Cursor та інші клієнти з JSON-конфігурацією:
{
"mcpServers": {
"classroom": {
"command": "C:\\path\\classroom-mcp\\.venv\\Scripts\\python.exe",
"args": ["C:\\path\\classroom-mcp\\classroom_mcp.py"],
"env": { "CLASSROOM_ACCOUNT": "student@university.edu" }
}
}
}Після перезапуску клієнта спитайте щось на кшталт «які завдання з Java я ще не здав?».
Здача робіт
Для здачі сервер використовує окремий профіль браузера, не ваш звичайний Chrome. У нього треба один раз увійти. Попросіть асистента викликати open_browser_login або запустіть самі:
.\.venv\Scripts\python.exe classroom_export.py browser-loginУвійдіть у навчальний акаунт у вікні, що відкрилося, і закрийте його. Пароль вводите ви, сервер його не бачить. Далі браузер працює без вікон.
submit_assignment має три режими:
Режим | Що відбувається |
| Прикріпити файли й здати |
| Повернути вже здану роботу, дочепити лише відсутні файли й здати знову. Наявні вкладення не видаляються |
| Замінити прикріплені файли з такою самою назвою, але іншим вмістом, і здати знову. Працює для DOCX, PDF, ZIP і PPTX |
| Позначити виконаним без файлів |
Без confirm=true сервер лише перевіряє доступ до завдання і файли, нічого не змінюючи. Асистенту в інструкціях сервера сказано спершу показати вам результат перевірки і здавати тільки після вашої згоди. Файли передаються абсолютними шляхами, до 20 на завдання. submit_batch приймає список таких самих завдань, перевіряє їх усі до першого завантаження і пропускає вже здані.
replace_files видаляє лише той файл Drive, який зафіксовано під час планування (ID, розмір і MD5). Якщо він за цей час змінився, здача зупиняється. Новий файл, назва якого не збігається з жодним вкладенням у зданій роботі, у цьому режимі вважається помилкою, для нього є add_files.
Здача виконується у фоновому потоці сервера, а submission_status показує результат. Запуск живе, поки відкрита сесія клієнта. Якщо клієнт закрився посередині, запуск отримає стан INTERRUPTED, і повторна здача продовжить з того ж місця. Перед завантаженням утиліта рахує SHA-256 кожного файла і зупиняється, якщо файл змінився після планування. Вже прикріплені файли вона звіряє через Drive API за назвою, розміром і MD5, тож перерваний запуск можна повторити без дублікатів. Зданий файл із такою самою назвою, але іншим вмістом, зупиняє здачу з поясненням. Після успішної здачі зберігається знімок сторінки.
Консоль без MCP
Усе те саме доступне з терміналу.
.\.venv\Scripts\python.exe classroom_export.py list
.\.venv\Scripts\python.exe classroom_export.py export "Назва або ID курсу" --output D:\exports
.\.venv\Scripts\python.exe classroom_read.py announcements "Назва курсу"Структура експорту:
Назва курсу/
├── Назва теми/
│ └── Назва завдання/
│ ├── readme.txt
│ └── Лекція 1.pptx
├── Без теми/
├── Оголошення/
└── export-warnings.txtПосилання, відео YouTube і Google Форми записуються як .txt з URL. Якщо файл заборонено завантажувати або Drive не може його конвертувати (ліміт експорту Google Docs 10 МБ), утиліта зберігає посилання і пише причину в export-warnings.txt.
Здача з консолі йде через план. Спершу опишіть роботи в маніфесті, шляхи файлів рахуються від папки маніфесту:
{
"account": "student@university.edu",
"courses": [
{
"course": "Назва або ID курсу",
"assignments": [
{ "title": "Практична робота 1", "files": ["ПР1.docx", "ПР1.zip"] },
{ "title": "Практична робота 2", "files": ["ПР2.docx"], "replaceFiles": true },
{ "title": "Практична робота 3", "files": ["ПР3-відео.mp4"], "addAttachments": true },
{ "title": "Тест", "files": [], "markAsDone": true }
]
}
]
}.\.venv\Scripts\python.exe classroom_export.py prepare-submit manifest.json --output plan.json
.\.venv\Scripts\python.exe classroom_export.py start-submit plan.json --check-only
.\.venv\Scripts\python.exe classroom_export.py start-submit plan.json
.\.venv\Scripts\python.exe classroom_export.py submit-status ID_ЗАПУСКУreplaceFiles, addAttachments і markAsDone працюють так само, як режими replace_files, add_files і mark_done вище, і для одного завдання можна вказати лише один із них. З консолі start-submit запускає окремий процес без вікна, тож здача триває й після закриття термінала. classroom_read.py course "Назва курсу" --output course.json зберігає такий самий знімок, як save_course_snapshot.
Налаштування
Змінна | Значення за замовчуванням | Що задає |
|
| Файл OAuth-клієнта |
| немає | Навчальна адреса для здачі й читання стрічки через браузер |
|
| Куди вивантажувати курси |
|
| Токен, браузерний профіль, журнали здачі |
| знайдений Chrome або Edge | Шлях до браузера |
credentials.json, токен і браузерний профіль дають доступ до вашого акаунта. Не комітьте їх і нікому не пересилайте. .gitignore вже виключає credentials.json, а все інше лежить поза репозиторієм.
Якщо університет блокує дозвіл на оголошення і API повертає 403, list_announcements читає стрічку курсу через браузерний профіль. Для цього потрібен вхід через browser-login.
Тести
.\.venv\Scripts\python.exe -X utf8 -m unittest -vТести здачі запускають справжній Chrome без вікна на локальній сторінці, тому Chrome або Edge має бути встановлений.
Ліцензія
MIT, див. LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Web search, data extraction and controlled browser automation for AI assistants via OAuth.
Web data extraction and browser workflows for AI assistants.
Let AI agents use your real, signed-in Chrome: tabs, clicks, forms, screenshots and video.
Run reusable browser automations from your AI assistant: scrape sites, extract data, fill forms.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to directly operate Google Classroom, including checking submissions, listing students, and creating assignments and announcements, with self-hosted deployment for data privacy.-
- FlicenseNot gradedqualityNot gradedmaintenanceEnables AI assistants to operate Google Classroom, letting users list courses and students, check assignment submissions, and create coursework and announcements through natural language.-
- AlicenseAqualityBmaintenanceLets AI apps read a student's Google Classroom data, including active classes, to-do and missing assignments, upcoming due dates, grades on returned work, and announcements. It is read-only, so it can never turn in, edit, or delete anything.14103 npmMIT
- AlicenseNot gradedqualityCmaintenanceLets AI assistants read a student's Canvas LMS/Moodle courses, deadlines, announcements, grades and course files using their normal browser login instead of an access token. It is read-only and keeps all session data and downloads on the user's own machine.22 npm2MIT