mcp-classroom

mcp-classroom

MCP server for Google Classroom enabling reading assignments, checking submission states, uploading files to Drive, and viewing attachments, with optional Playwright automation for write operations restricted by Workspace admins.

Category
访问服务器

README

mcp-classroom

MCP server for Google Classroom — read assignments, check submission states, upload files to Drive, and view attached files. Pairs with a Claude Code skill + Playwright for browser automation to work around Google Workspace write restrictions.

What it can do

Feature How
List courses MCP
List & get assignments MCP (slim response — no heavy file metadata)
Check submission state & grade MCP
List files attached to a submission MCP
Upload file to Google Drive MCP
Attach file to submission Playwright (API blocked by Workspace admins)
Turn in / Mark as done Playwright (API blocked by Workspace admins)
Unsubmit (reclaim) Playwright (API blocked by Workspace admins)

Why Playwright? Google Workspace for Education admins can restrict third-party apps from modifying student submissions via the API (@ProjectPermissionDenied). Playwright automates the browser instead, bypassing that restriction entirely.


Requirements

  • Python 3.11+
  • Node.js (for playwright-cli)
  • A Google Cloud project with the Classroom API and Drive API enabled

1. Google Cloud Console setup

1.1 Create a project

  1. Go to console.cloud.google.com
  2. Create a new project (e.g. mcp-classroom)

1.2 Enable APIs

In APIs & Services → Library, enable:

  • Google Classroom API
  • Google Drive API

1.3 Configure OAuth consent screen

  1. Go to APIs & Services → OAuth consent screen
  2. User type: External
  3. Fill in app name, support email, developer email
  4. Add scopes:
    https://www.googleapis.com/auth/classroom.courses.readonly
    https://www.googleapis.com/auth/classroom.coursework.me
    https://www.googleapis.com/auth/classroom.coursework.students
    https://www.googleapis.com/auth/classroom.student-submissions.me.readonly
    https://www.googleapis.com/auth/classroom.rosters.readonly
    https://www.googleapis.com/auth/classroom.announcements.readonly
    https://www.googleapis.com/auth/drive.file
    https://www.googleapis.com/auth/drive.readonly
    
  5. Add your Google account as a test user
  6. Publishing status: you can leave it in Testing while developing, or publish to Production to avoid the unverified app warning

1.4 Create OAuth credentials

  1. Go to APIs & Services → Credentials
  2. Click Create Credentials → OAuth client ID
  3. Application type: Desktop app
  4. Download the JSON file
  5. Rename it to client_secret_<...>.json and place it in the project root (next to pyproject.toml)

2. Install the MCP server

# Clone the repo
git clone https://github.com/your-username/mcp-classroom.git
cd mcp-classroom

# Install Python dependencies
pip install -e .

First run — authenticate

mcp-classroom

A browser window will open asking you to authorize the app with your Google account. After approval, a token.json is saved locally (gitignored).


3. Register with Claude Code

Add the server to your Claude Code MCP config (~/.claude/claude.json or via claude mcp add):

{
  "mcpServers": {
    "google-classroom": {
      "command": "mcp-classroom",
      "args": []
    }
  }
}

Or if running from source:

{
  "mcpServers": {
    "google-classroom": {
      "command": "python",
      "args": ["-m", "src.server"],
      "cwd": "/absolute/path/to/mcp-classroom"
    }
  }
}

4. Install Playwright (for browser automation)

npm install -g playwright-cli
npx playwright install chromium

Save your Google session (one time)

playwright-cli open --browser=chrome https://accounts.google.com/signin
# Log in manually in the browser window
playwright-cli state-save ~/classroom-auth.json
playwright-cli close

5. Install the Claude Code skill (optional but recommended)

The skill tells Claude how to use the MCP + Playwright together without you having to explain the workflow every time.

  1. Copy skill/SKILL.md to your Claude skills directory:
    ~/.claude/skills/google-classroom/SKILL.md
    
  2. Edit the skill file and fill in your own course IDs and assignment IDs (run list_courses and list_coursework once to get them).
  3. Update the auth state path inside the skill to match where you saved classroom-auth.json.
  4. Reload plugins in Claude Code: /reload-plugins

Available MCP tools

Tool Description
list_courses List active courses (slim: id, name, section, state)
get_course Get full details of a course
list_coursework List assignments (slim: id, title, state, dueDate)
get_coursework Get assignment details + description (no teacher file attachments)
list_my_submissions List your submissions — state, grade, attachment count
get_my_submission Get one submission's details
list_submission_attachments List titles and Drive IDs of files you've attached
upload_file_to_drive Upload a local file to Google Drive
list_drive_files Search files in your Drive
add_drive_attachment Attach a Drive file to a submission (may be blocked by Workspace)
add_link_attachment Attach a URL to a submission (may be blocked by Workspace)
remove_attachment Remove an attachment (may be blocked by Workspace)
turn_in_submission Turn in a submission (may be blocked by Workspace)
reclaim_submission Unsubmit a submission (may be blocked by Workspace)
list_announcements List course announcements
list_students List students in a course
list_teachers List teachers in a course

Tools marked "may be blocked by Workspace" return 403 @ProjectPermissionDenied on institutional Google Workspace accounts. Use Playwright automation instead for those operations.


File structure

mcp-classroom/
├── src/
│   ├── server.py      # MCP tool definitions
│   ├── classroom.py   # Classroom API calls
│   ├── drive.py       # Drive API calls
│   └── auth.py        # OAuth flow + scopes
├── skill/
│   └── SKILL.md       # Claude Code skill template
├── tests/
├── pyproject.toml
├── requirements.txt
└── README.md

Gitignored (never commit these)

  • token.json — your OAuth token
  • client_secret_*.json — your OAuth client credentials

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选