classroom-mcp-server
Provides tools for reading and writing Google Classroom data, including courses, topics, coursework, materials, announcements, rosters, submissions, and attachments.
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., "@classroom-mcp-server What assignments are due this week in my classes?"
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.
classroom-mcp-server
An MCP server that lets Claude read and write your Google Classroom data — courses, topics, coursework (assignments), materials (lessons), announcements, rosters, submissions, and all their attachments.
Works with both Claude Code CLI and Claude Desktop (stdio transport).
What it can do
Read tools
classroom_whoami— show which Google account is currently authorized (confirm it holds your classes)classroom_list_courses— your classesclassroom_list_topics— topic/section headers in a courseclassroom_list_coursework— assignments (with due dates, points, attachments, topic)classroom_list_materials— posted lesson materials (CourseWorkMaterials)classroom_list_announcements— stream announcementsclassroom_list_roster— students or teachersclassroom_list_submissions— your submissions + grades for an assignmentclassroom_dump_course— everything for one course in a single call: topics with their coursework + materials nested, plus announcements, each with attachmentsdrive_fetch_file_content— read the text content of an attachment by its Drive file id (so the model can actually see what's inside Docs/Sheets/Slides/etc.)
Write tools
classroom_attach_to_submission— attach a Drive file or link to your workclassroom_turn_in_submission— turn in an assignmentclassroom_reclaim_submission— unsubmit to editclassroom_create_topic— (teacher accounts) create a topicclassroom_create_announcement— (teacher accounts) post an announcement
⚠️ Student accounts are read-restricted by Google. You can read all of your own data and submit/reclaim your own work. Creating topics/announcements and seeing other students' submissions require teacher rights on the course — those calls return a clear permission error otherwise.
Note: "subjects" and "lessons" aren't native Classroom objects. Teachers model them with Topics + CourseWorkMaterials, which is what the topic/materials tools surface.
Related MCP server: canvas-mcp
One-time setup
1. Enable the API + make an OAuth client
Go to Google Cloud Console → create/select a project.
APIs & Services → Library → enable Google Classroom API.
APIs & Services → OAuth consent screen → configure it (External is fine for personal use). Add yourself as a Test user.
APIs & Services → Credentials → Create Credentials → OAuth client ID → application type Desktop app.
Download the JSON.
2. Drop the credentials in place
mkdir -p ~/.config/classroom-mcp
cp ~/Downloads/client_secret_*.json ~/.config/classroom-mcp/credentials.json3. Build and authorize
cd classroom-mcp-server
npm install
npm run build
npm run auth # opens a consent URL, catches the redirect, saves token.jsonThe auth script binds a loopback listener on an OS-assigned free port and tells Google to redirect there. Desktop-app OAuth clients may use any port on 127.0.0.1, so there is nothing to configure and no elevated permission needed. The consent screen is bound to a random state value, and a redirect that doesn't carry it back is refused.
token.json holds a refresh token — a standing grant to your Classroom and Drive. It is written 0600, and ~/.config/classroom-mcp/ is kept 0700.
Pointing it at the right Google account
On the consent screen, pick the Google account that actually holds your classes — that's the account the server reads from. To confirm afterwards, run the classroom_whoami tool (just ask Claude "which classroom account am I on?"). To switch accounts, delete the cached token and re-authorize:
rm ~/.config/classroom-mcp/token.json
npm run auth # choose the correct account this timeReading attachment contents
Listing tools return attachments as references (Drive file id, link, etc.). To read what's inside a Drive attachment, take its driveFile.driveFile.id from any coursework/material/dump result and pass it to drive_fetch_file_content. Google Docs come back as plain text, Sheets as CSV, Slides as text; PDFs and images return metadata + a link rather than text. In practice you can just ask Claude "open the attachment on assignment X" and it will chain the calls.
Connecting it
Claude Code CLI
claude mcp add classroom -- node /absolute/path/to/classroom-mcp-server/dist/index.jsClaude Desktop
Edit claude_desktop_config.json (Settings → Developer → Edit Config):
{
"mcpServers": {
"classroom": {
"command": "node",
"args": ["/absolute/path/to/classroom-mcp-server/dist/index.js"]
}
}
}Restart Claude Desktop.
Scopes / read-only mode
Scopes live in src/constants.ts. The defaults request: read of course structure, read/write of your own coursework + topics/announcements, read-only Drive access (drive.readonly, needed so drive_fetch_file_content can open arbitrary Classroom attachments — drive.file wouldn't see files the app didn't create), and userinfo (so classroom_whoami can report the account).
If you change scopes, you must
npm run buildand re-runnpm run authso Google re-issues a token with the new scopes.
To run strictly read-only, replace the write scopes with their .readonly equivalents (e.g. classroom.coursework.me.readonly, drop classroom.topics and classroom.announcements). drive.readonly is already read-only. Then rebuild and re-auth.
Config/token location can be overridden with the CLASSROOM_CONFIG_DIR env var.
What this server can reach
Worth understanding before you connect it, because the model drives these tools:
drive_fetch_file_contenttakes any Drive file id and reads it with your credentials. It is scoped todrive.readonly, which covers your whole Drive — not only Classroom attachments — because Classroom attachments are files the app didn't create anddrive.filecannot see them. A file id that reaches the model from somewhere other than your own course listings will still be fetched. Nothing is written to Drive.Write tools change real state.
classroom_turn_in_submissionhands work to a teacher; reclaiming it only works while the assignment still allows it. They are annotatedreadOnlyHint: falseso a client can prompt before running them.Everything runs as one account — whichever you picked at the consent screen. Run
classroom_whoamiif you're unsure.
For strictly read-only operation, see Scopes.
Development
npm run build # compile to dist/
npm test # unit tests (no credentials or network needed)
npm run typecheck # type-check src + testsThe tests stub the Google clients through setClassroomClient / setDriveClient and drive the tool handlers directly, so the whole suite runs offline.
Troubleshooting
Symptom | Fix |
| Run |
| Run |
| You're a student calling a teacher-only endpoint, or a scope is missing |
| The redirect didn't come from the consent screen this run opened. Nothing was saved — run |
Available Tools
15 toolsclassroom_attach_to_submissionAttach Material to SubmissionA
Attach a Drive file or link to a student submission BEFORE turning it in. Add attachments first, then call classroom_turn_in_submission.
Args:
course_id, coursework_id, submission_id (strings)
drive_file_id (string, optional): Drive file to attach
link_url (string, optional): URL to attach (provide exactly one)
Returns: Confirmation.
Inputs: no named parameters.
classroom_create_announcementCreate Announcement (Teacher)A
Post an announcement to a course stream. Requires teacher rights.
Args:
course_id (string), text (string, 1-10000 chars)
Returns: The new announcement's id.
Inputs: text (required), course_id (required).
classroom_create_topicCreate Topic (Teacher)A
Create a new topic in a course. Requires teacher rights on the course; will fail with a permission error for student accounts.
Args:
course_id (string), name (string, 1-100 chars)
Returns: The new topic's id and name.
Inputs: name (required), course_id (required).
classroom_dump_courseDump Entire CourseARead-onlyIdempotent
Fetch a course's full structure in one call: every topic with its coursework and materials nested underneath, anything without a topic grouped separately, and optionally the announcement stream. Each item includes its attachments. This is the fastest way to get a complete picture of a class.
Args:
course_id (string): Course ID
include_announcements (boolean): default true
max_per_type (number): per-category cap 1-500 (default 200)
response_format ('markdown' | 'json')
Returns: { course, topics: [{ id, name, coursework[], materials[] }], no_topic: { coursework[], materials[] }, announcements[] }. To read the text of any attachment, pass its driveFile.driveFile.id to drive_fetch_file_content. Very large dumps truncate descriptions; use the per-resource tools for full detail.
Inputs: course_id (required), max_per_type, response_format, include_announcements.
classroom_list_announcementsList AnnouncementsARead-onlyIdempotent
List announcements posted to a course stream, including any attachments.
Args:
course_id (string): Course ID
limit (number): Max items 1-200 (default 30)
response_format ('markdown' | 'json')
Returns: Each announcement's id, text, state, creationTime, updateTime, alternateLink, and materials.
Inputs: course_id (required), limit, response_format.
classroom_list_coursesList Classroom CoursesARead-onlyIdempotent
List the Google Classroom courses (classes) the authenticated user is enrolled in or teaches.
Args:
course_states (string[]): Filter by state, default ["ACTIVE"]
limit (number): Max courses, 1-200 (default 50)
response_format ('markdown' | 'json'): default 'markdown'
Returns: Each course's id, name, section, description heading, room, ownerId, enrollmentCode, and courseState. Use the returned course id with the other tools.
Inputs: limit, course_states, response_format.
classroom_list_courseworkList Coursework (Assignments)ARead-onlyIdempotent
List coursework (assignments, questions) in a course, including attached materials, due dates, point values, and the topic each belongs to.
Args:
course_id (string): Course ID
topic_id (string, optional): Restrict to one topic
limit (number): Max items 1-200 (default 50)
response_format ('markdown' | 'json')
Returns: Each item's id, title, description, workType, state, dueDate, maxPoints, topicId, alternateLink, and materials (attachments).
Inputs: course_id (required), limit, topic_id, response_format.
classroom_list_materialsList Course Materials (Lessons)ARead-onlyIdempotent
List CourseWorkMaterials — posted reading/lesson materials that are NOT assignments. These are what teachers typically use for lessons and resources.
Args:
course_id (string): Course ID
topic_id (string, optional): Restrict to one topic
limit (number): Max items 1-200 (default 50)
response_format ('markdown' | 'json')
Returns: Each material's id, title, description, state, topicId, alternateLink, and its attachments.
Inputs: course_id (required), limit, topic_id, response_format.
classroom_list_rosterList Course RosterARead-onlyIdempotent
List students or teachers enrolled in a course.
Args:
course_id (string): Course ID
role ('students' | 'teachers'): default 'students'
limit (number): Max 1-200 (default 100)
response_format ('markdown' | 'json')
Returns: Each person's userId and profile name/email (email only if your scope and the domain permit it).
Inputs: course_id (required), role, limit, response_format.
classroom_list_submissionsList My SubmissionsARead-onlyIdempotent
List student submissions for a specific assignment. As a student you'll see your own submission(s); as a teacher you'll see all.
Args:
course_id (string): Course ID
coursework_id (string): The assignment's id
response_format ('markdown' | 'json')
Returns: Each submission's id, userId, state (NEW/CREATED/TURNED_IN/RETURNED/RECLAIMED), late flag, assignedGrade, draftGrade, and attachments. Use the submission id with the turn-in / attachment write tools.
Inputs: course_id (required), coursework_id (required), response_format.
classroom_list_topicsList Course TopicsARead-onlyIdempotent
List all topics (the section headers teachers use to group work) within a course. Teachers often use topics to represent units, subjects, or lessons.
Args:
course_id (string): Course ID
response_format ('markdown' | 'json')
Returns: Each topic's topicId and name. Pass topicId to classroom_list_coursework to filter materials/assignments by topic.
Inputs: course_id (required), response_format.
classroom_reclaim_submissionReclaim AssignmentA
Reclaim a turned-in submission (pull it back to make edits), equivalent to "Unsubmit". Only works if the assignment still allows it and state is TURNED_IN.
Args:
course_id, coursework_id, submission_id (strings)
Returns: Confirmation.
Inputs: course_id (required), coursework_id (required), submission_id (required).
classroom_turn_in_submissionTurn In AssignmentA
Turn in (submit) a student assignment submission. This hands the work to the teacher and is the equivalent of clicking "Turn in". State must currently be CREATED or NEW.
Args:
course_id, coursework_id, submission_id (strings)
Returns: Confirmation. NOTE: This changes submission state and is not trivially reversible (use classroom_reclaim_submission to pull it back if still allowed).
Inputs: course_id (required), coursework_id (required), submission_id (required).
classroom_whoamiShow Authorized Google AccountARead-onlyIdempotent
Show which Google account this server is currently authorized as. Use this to confirm the server is pointed at the Google login that actually holds your classes. If it's the wrong account, delete the cached token (token.json) and run npm run auth again, choosing the correct account on the consent screen.
Args:
response_format ('markdown' | 'json')
Returns: the authorized account's email, name, and id.
Inputs: response_format.
drive_fetch_file_contentFetch Attachment Content (Drive)ARead-onlyIdempotent
Read the text content of a Google Drive file attached to Classroom coursework, materials, or announcements.
Handles each type appropriately:
Google Docs → exported as plain text
Google Sheets → exported as CSV
Google Slides → exported as plain text
text/csv/markdown/html/json/xml/rtf → downloaded directly
PDFs, images, and other binary files → returns metadata + link (content can't be rendered as text)
Args:
drive_file_id (string): The Drive file id from an attachment's driveFile.driveFile.id
response_format ('markdown' | 'json')
Returns: name, mime_type, size, link, and (when readable) content. Long content is truncated to a character limit with a note.
Error Handling:
403/permission → the Drive scope may be missing; re-run
npm run auth404 → the file id is wrong or you lack access to that file
Inputs: drive_file_id (required), response_format.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 15 tools
Each list_* tool targets a distinct Classroom resource (courses, topics, coursework, materials, announcements, roster, submissions), and coursework/materials/announcements are explicitly differentiated. Action tools like turn_in, reclaim, and attach have clear, non-overlapping state-transition roles.
The set consistently uses a classroom_verb_noun pattern for nearly all tools, with predictable verbs like list, create, turn_in, reclaim, and attach. Minor exceptions are drive_fetch_file_content (different namespace) and classroom_whoami (not verb_noun), but both are still clear and intentional.
Fifteen tools is at the upper end of the ideal range but every tool earns its place: granular listers, a course dump convenience, submission actions, two create operations, a Drive helper, and an auth-check tool. There is no meaningful redundancy in the set.
The read-side is strong and the student submission lifecycle is well covered. However, the authoring/management surface is incomplete: there is no way to create coursework or materials, update/delete existing announcements, topics, or coursework, or grade/return submissions as a teacher.
Related MCP Connectors
Give Claude only the Google Drive files you choose. Every action logged.
Multiple Google accounts (Gmail, Calendar, Drive, Contacts, Tasks) in one Claude connector.
Multiple Google accounts (Gmail, Calendar, Drive, Contacts, Tasks) in one Claude connector.
Connect Claude to your Platform7n workspaces: chat, links, work and decks. One-click OAuth.
Related MCP Servers
- AlicenseBqualityCmaintenanceEnables Claude to interact with Canvas LMS, allowing natural language queries about courses, deadlines, grades, and feedback.29MIT
- AlicenseNot gradedqualityDmaintenanceConnects Claude to Canvas LMS for managing coursework through natural language, including assignments, discussions, submissions, and course browsing.28MIT
- FlicenseNot gradedqualityDmaintenanceEnables Claude to manage Google Workspace services such as Calendar, Gmail, and Docs with configurable access and safe-by-design limitations.2-
- FlicenseNot gradedqualityCmaintenanceEnables AI assistants to interact with Google Classroom to check submission statuses, list students and assignments, and create coursework, announcements, and topics through natural language.-