Skip to main content
Glama

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 classes

  • classroom_list_topics — topic/section headers in a course

  • classroom_list_coursework — assignments (with due dates, points, attachments, topic)

  • classroom_list_materials — posted lesson materials (CourseWorkMaterials)

  • classroom_list_announcements — stream announcements

  • classroom_list_roster — students or teachers

  • classroom_list_submissions — your submissions + grades for an assignment

  • classroom_dump_course — everything for one course in a single call: topics with their coursework + materials nested, plus announcements, each with attachments

  • drive_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 work

  • classroom_turn_in_submission — turn in an assignment

  • classroom_reclaim_submission — unsubmit to edit

  • classroom_create_topic — (teacher accounts) create a topic

  • classroom_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

  1. Go to Google Cloud Console → create/select a project.

  2. APIs & Services → Library → enable Google Classroom API.

  3. APIs & Services → OAuth consent screen → configure it (External is fine for personal use). Add yourself as a Test user.

  4. APIs & Services → Credentials → Create Credentials → OAuth client ID → application type Desktop app.

  5. Download the JSON.

2. Drop the credentials in place

mkdir -p ~/.config/classroom-mcp
cp ~/Downloads/client_secret_*.json ~/.config/classroom-mcp/credentials.json

3. Build and authorize

cd classroom-mcp-server
npm install
npm run build
npm run auth      # opens a consent URL, catches the redirect, saves token.json

The 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 time

Reading 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.js

Claude 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 build and re-run npm run auth so 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_content takes any Drive file id and reads it with your credentials. It is scoped to drive.readonly, which covers your whole Drive — not only Classroom attachments — because Classroom attachments are files the app didn't create and drive.file cannot 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_submission hands work to a teacher; reclaiming it only works while the assignment still allows it. They are annotated readOnlyHint: false so a client can prompt before running them.

  • Everything runs as one account — whichever you picked at the consent screen. Run classroom_whoami if 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 + tests

The tests stub the Google clients through setClassroomClient / setDriveClient and drive the tool handlers directly, so the whole suite runs offline.


Troubleshooting

Symptom

Fix

Not authorized yet

Run npm run auth

Authentication expired (401)

Run npm run auth again

Permission denied (403)

You're a student calling a teacher-only endpoint, or a scope is missing

OAuth state mismatch during auth

The redirect didn't come from the consent screen this run opened. Nothing was saved — run npm run auth again and use the URL it prints

Available Tools

15 tools
classroom_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 CourseA
Read-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 AnnouncementsA
Read-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 CoursesA
Read-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)A
Read-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)A
Read-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 RosterA
Read-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 SubmissionsA
Read-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 TopicsA
Read-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 AccountA
Read-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)A
Read-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 auth

  • 404 → 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

    A4.1/5.0

    Scored across 15 tools

    Disambiguation5/5

    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.

    Naming Consistency4/5

    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.

    Tool Count5/5

    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.

    Completeness3/5

    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

    Related MCP Servers