google-classroom-mcp
Uses the user's Google session to access Google Classroom and Google Drive, including downloading and reading attachments and uploading or attaching Drive files.
Gives a student's view of Google Classroom: lists courses, stream posts, classwork by topic, to-do and due work, comments, attachments, and submissions; also supports actions such as commenting, turning in or unsubmitting work, answering questions, attaching files, and joining or leaving classes.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@google-classroom-mcp What homework do I have due this week?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
google-classroom-mcp
An MCP server that gives an AI assistant a student's view of Google Classroom: classes, the stream, classwork, your to-do list, due dates, attachments (download and read), comments, and your own submissions. It can also act for you: comment, attach work, turn in, unsubmit, answer questions, join and leave classes.
It needs no OAuth app and no admin consent. It signs in with your own Google browser session cookies and calls the same internal endpoints the Classroom web app uses.
⚠️ This uses undocumented internal Google endpoints. They can change without notice, and using them may go against Google's terms. Your session cookies give full access to your Google account: keep them private, and don't commit them (
cookies.txtandcookies.jsonare git-ignored).
Install
git clone <this repo> && cd google-classroom-mcp
npm install
npm run buildRelated MCP server: Classroom MCP
Give it your session
Choose one of these:
Variable | What to put in it |
|
|
| Path to a cookies export: Netscape |
| A raw |
Optional settings:
GCLASSROOM_AUTHUSER: the account index if you're signed in to several Google accounts (theNin/u/N/). Default0.GCLASSROOM_DOWNLOAD_DIR: wheredownload_filesaves files. Default~/Downloads/classroom-mcp.GCLASSROOM_USER_ID: override your Classroom user id. It's normally detected from the page.
The cookies must include SID, HSID, SSID, APISID, SAPISID and the __Secure-* cookies for .google.com. Exporting every cookie for google.com covers them.
Use it with Claude
Claude Code:
claude mcp add google-classroom -e GCLASSROOM_BROWSER=chrome -- node /absolute/path/to/google-classroom-mcp/dist/index.jsClaude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"google-classroom": {
"command": "node",
"args": ["/absolute/path/to/google-classroom-mcp/dist/index.js"],
"env": { "GCLASSROOM_COOKIES_FILE": "/absolute/path/to/cookies.txt" }
}
}
}Course arguments accept a numeric id, a classroom.google.com/c/... link, or part of the class name. Item arguments accept an id or a link to the post; a full link also supplies the course.
Tools
Reading (verified against a live student account)
Tool | What it does |
| Shows your Classroom user id, name and email |
| Lists your classes (archived ones are optional) |
| Shows class details, teachers, your role and your class Drive folder |
| Lists teachers and classmates |
| Lists classwork topics |
| Shows stream posts and announcements with full text (paged) |
| Shows the Classwork page grouped by topic, with optional topic and kind filters (paged) |
| Shows assigned, missing or done work across classes |
| Lists work due between two dates (calendar view) |
| Searches post titles and text across classes |
| Shows everything about one post: text, due date, points, attachments, your submission, class comments and private comments |
| Shows your submission state, status, attachments and answer |
| Lists your assigned work in a class with the status of each |
| Read comment threads |
| Shows Drive metadata for an attachment |
| Saves an attachment to disk; Docs, Sheets and Slides are exported to PDF, DOCX, CSV and other formats |
| Returns an attachment's content: Docs and Slides as text, Sheets as CSV, |
| Lists your Drive folder for a class |
Writing (acts on your real account)
Tool | What it does |
| Posts a public class comment |
| Sends a private comment to your teacher |
| Edits or deletes one of your comments |
| Turns in an assignment or marks it as done |
| Takes back work you turned in |
| Answers a short-answer or multiple-choice question (this also turns it in) |
| Attaches a URL to your work |
| Attaches an existing Drive file to your work |
| Uploads a local file to Drive (optionally into your class folder) |
| Uploads a local file and attaches it to your work |
| Removes one of your attachments |
| Joins a class with a class code |
| Accepts a class invitation |
| Unenrolls you from a class |
| Escape hatch: calls any Classroom RPC by id |
Verification status of the write tools: their request formats were taken from the Classroom web client's JavaScript and checked offline, but none has been run against a live account yet. Each tool's description says so. Try them on something low-stakes first, and check the result with get_item / get_my_submission. Known gaps:
Grades aren't decoded yet. Use
raw: trueonget_item/get_my_submissionto see the raw submission.Multiple-choice options may not appear in
get_item. Theanswer_questionanswer format is a best guess.The
delete_commentrequest shape is inferred.upload_to_driveuses Drive's multipart upload throughclients6.google.com. Reading through that host is verified; uploading isn't.
How it works
Classroom data:
POST https://classroom.google.com/u/N/_/ClassroomUi/data/batchexecute. These are Google's internal "batchexecute" RPCs with array-encoded protobuf payloads and field masks captured from the web client (src/masks.ts). The XSRF token (SNlM0e), session id (FdrFJe), build label (cfb2h) and your user id are read from the/u/N/hpage.Drive files:
https://clients6.google.com/drive/v3/..., authenticated withSAPISIDHASHand cookies (the same way the web app does it).www.googleapis.comrejects cookie auth from another origin.Cookies that Google rotates through
Set-Cookieare updated in memory, so a long-running server keeps working until your session ends. When that happens, export fresh cookies.
Development
npm run dev # tsc --watch
npm run typecheckSource layout: cookies.ts (cookie sources and Chromium decryption), http.ts (transport and SAPISIDHASH), client.ts (session and batchexecute), classroom.ts (Classroom operations), parse.ts (JSPB → JSON), drive.ts, office.ts (docx/pptx/xlsx text), tools.ts (MCP tools), index.ts (stdio entry point).
Available Tools
35 toolsaccept_invitationAccept class invitationA
Accept an invitation to join a class (the course id is shown on the invitation / in list_courses). NOTE: the request format for this write was derived from the Classroom web client's code and has not been verified against a live account; check the result.
Inputs: course (required).
add_drive_file_attachmentAttach Drive fileA
Attach an existing Google Drive file to your work on an assignment. Does not turn it in. NOTE: the request format for this write was derived from the Classroom web client's code and has not been verified against a live account; check the result.
Inputs: file (required), item (required), course.
add_link_attachmentAttach linkA
Attach a link (URL) to your work on an assignment. Does not turn it in. NOTE: the request format for this write was derived from the Classroom web client's code and has not been verified against a live account; check the result.
Inputs: url (required), item (required), course.
answer_questionAnswer questionA
Submit your answer to a question post (short answer or multiple choice). This also turns it in. Use get_item first to see the question type and choices. NOTE: the request format for this write was derived from the Classroom web client's code and has not been verified against a live account; check the result.
Inputs: item (required), answer (required), type, course.
delete_commentDelete commentBDestructive
Delete one of your own comments. NOTE: the request format for this write was derived from the Classroom web client's code and has not been verified against a live account; check the result.
Inputs: item (required), comment_id (required), visibility (required), course.
download_fileDownload fileA
Download a Classroom attachment (Drive file) to disk. Google Docs/Sheets/Slides are exported (default PDF for download; choose with export_format).
Inputs: file (required), save_to, export_format.
edit_commentEdit commentAIdempotent
Edit one of your own comments. NOTE: the request format for this write was derived from the Classroom web client's code and has not been verified against a live account; check the result.
Inputs: item (required), text (required), comment_id (required), visibility (required), +1 more.
get_courseGet class detailsBRead-only
Details for one class, including your class Drive folder and the teacher names.
Inputs: course (required).
get_file_infoGet file infoBRead-only
Metadata for a Drive file attached in Classroom (name, type, size, owner, link).
Inputs: file (required).
get_itemGet post / assignmentARead-only
Full details of a post, assignment, question or material: text, due date, points, attached files/links, your submission (status, your attachments, answer), and comments.
Inputs: item (required), raw, course, include_comments.
get_my_submissionGet my submissionBRead-only
Your submission for an assignment or question: state (turned in, returned…), status (assigned/missing/done), attachments and answer.
Inputs: item (required), raw, course.
get_my_work_in_courseMy work in a classBRead-only
All of your assigned work in one class with your submission status for each.
Inputs: course (required), limit.
get_streamRead class streamBRead-only
Read the class stream: announcements and posts, newest first, with full text.
Inputs: course (required), limit, page_token.
join_classJoin class with codeA
Join a class using its class code. NOTE: the request format for this write was derived from the Classroom web client's code and has not been verified against a live account; check the result.
Inputs: code (required).
leave_classLeave (unenroll from) classADestructive
Unenroll yourself from a class. You will lose access to it until re-invited or you re-join with a code. NOTE: the request format for this write was derived from the Classroom web client's code and has not been verified against a live account; check the result.
Inputs: course (required), confirm (required).
list_class_commentsRead class commentsBRead-only
Read the public class comments on a post or assignment.
Inputs: item (required), course.
list_class_drive_folderList class Drive folderBRead-only
List the files in your Drive folder for a class (where Classroom stores your submitted work), or any Drive folder.
Inputs: course, folder.
list_classworkList classworkARead-only
List the Classwork page of a class: assignments, questions and materials grouped by topic. Pass topic to page through one topic (use topic "none" for items with no topic).
Inputs: course (required), kind, limit, topic, +1 more.
list_course_peopleList class peopleARead-only
List the teachers and classmates in a class (names; emails when Classroom exposes them).
Inputs: course (required).
list_coursesList classesBRead-only
List the classes you are enrolled in (id, name, section, room, teacher/owner id, link).
Inputs: include_archived.
list_due_workList work due in a date rangeBRead-only
Calendar view: work due between two dates, across all classes or one class.
Inputs: to (required), from (required), limit, course.
list_private_commentsRead private commentsARead-only
Read the private comments between you and your teacher on an assignment or question.
Inputs: item (required), course.
list_todoList to-doBRead-only
Your to-do list across classes (or one class): assigned, missing, or done work.
Inputs: limit, course, status, page_token.
list_topicsList topicsBRead-only
List the classwork topics of a class.
Inputs: course (required).
post_class_commentPost class commentA
Post a public class comment on a post or assignment (visible to the whole class).
Inputs: item (required), text (required), course.
post_private_commentPost private commentA
Send a private comment to your teacher on an assignment or question.
Inputs: item (required), text (required), course.
raw_rpcRaw Classroom RPCADestructive
Advanced: call any Classroom web-client batchexecute RPC by id with a JSON payload and return the decoded response. Can perform writes; use only if you know the RPC.
Inputs: rpc_id (required), payload (required).
read_file_contentRead file contentARead-only
Read the contents of a Classroom attachment: Google Docs/Slides as text, Sheets as CSV, .docx/.pptx/.xlsx as extracted text, plain-text files as text, images as images, PDFs as an embedded PDF.
Inputs: file (required), max_chars, export_format.
remove_attachmentRemove attachmentADestructive
Remove one of your own attachments from your work on an assignment (match by material id, Drive file id, URL or title). Only possible while not turned in. NOTE: the request format for this write was derived from the Classroom web client's code and has not been verified against a live account; check the result.
Inputs: item (required), attachment (required), course.
search_classworkSearch classworkARead-only
Search post titles and text across your classes (or one class) for a keyword.
Inputs: query (required), course, per_class_limit.
turn_inTurn in / mark as doneAIdempotent
Turn in your work for an assignment (or mark it as done if it has no attachments). NOTE: the request format for this write was derived from the Classroom web client's code and has not been verified against a live account; check the result.
Inputs: item (required), course.
unsubmitUnsubmitAIdempotent
Unsubmit (take back) work you turned in so you can change it. If it is past the due date it may be marked late when re-submitted. NOTE: the request format for this write was derived from the Classroom web client's code and has not been verified against a live account; check the result.
Inputs: item (required), course.
upload_and_attach_fileUpload and attach fileA
Upload a local file into your class Drive folder and attach it to your work on an assignment. Does not turn it in. NOTE: the request format for this write was derived from the Classroom web client's code and has not been verified against a live account; check the result.
Inputs: item (required), path (required), name, course.
upload_to_driveUpload file to DriveA
Upload a local file to your Google Drive (optionally into a folder, e.g. your class folder). Returns the Drive file id. NOTE: the request format for this write was derived from the Classroom web client's code and has not been verified against a live account; check the result.
Inputs: path (required), name, course, folder.
whoamiWho am IARead-only
Show the signed-in Classroom account (user id, name, email).
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 35 tools
Most tools carve out distinct resource+action pairs (course, stream, classwork, comments, submissions, attachments, Drive). A few pairs blur: get_item vs get_my_submission (item details already include your submission), and upload_to_drive vs upload_and_attach_file, which differ only by whether an attachment is added. These overlaps are resolvable from descriptions but could cause occasional misselection.
Overwhelmingly consistent snake_case verb_noun (list_courses, get_course, turn_in, add_link_attachment, post_private_comment). Minor deviations are the standalone commands whoami and raw_rpc, plus upload_and_attach_file using 'and' for a compound action. The pattern remains highly predictable overall.
35 tools is heavy, but the surface genuinely spans courses, people, stream, topics, classwork, comments, submissions, attachments, and Drive, so most tools earn their place. A few could be consolidated (e.g. upload_to_drive plus upload_and_attach_file, get_my_submission folded into get_item).
Excellent student-lifecycle coverage: discover/join/leave classes, browse stream and classwork, attach and upload work, answer questions, turn in/unsubmit, and manage comments. Drive read/download/upload and a raw_rpc escape hatch close remaining gaps; no obvious dead ends for a student-facing client.
Maintenance
Related MCP Connectors
Read-only access to a student's recorded classes: transcripts, notes, slides and concept map.
Connect AI assistants to Edusign attendance, courses, learners, documents, and API docs via OAuth.
Read and write your own Microsoft To Do, Google Tasks or Todoist tasks from any AI agent.
Connect an AI assistant to your Google Sheets, Drive, Docs, PDFs, BigQuery and Gmail.
Related MCP Servers
- FlicenseAqualityCmaintenanceEnables Claude to read and write Google Classroom data, including courses, coursework, materials, announcements, rosters, submissions, and Drive attachment contents.15-
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with Google Classroom to check submission statuses, list students and assignments, and create coursework, announcements, and topics through natural language.-
- 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