Skip to main content
Glama
faizan45640

Google Classroom MCP Server

Google 课堂 MCP 服务器

铁匠徽章

MCP(模型上下文协议)服务器,通过 Claude 和其他支持 MCP 协议的 AI 助手提供对 Google Classroom 数据的访问。

设置

先决条件

  • Node.js(v16 或更高版本)

  • 启用了 Google Classroom API 的 Google Cloud Platform 项目

  • Google Classroom API 的 OAuth 2.0 客户端凭据

安装

通过 Smithery 安装

要通过Smithery自动为 Claude Desktop 安装 Google Classroom MCP 服务器:

npx -y @smithery/cli install @faizan45640/google-classroom-mcp-server --client claude

手动安装

  1. 克隆此存储库

  2. 安装依赖项:

npm install
  1. 将您的 Google OAuth 客户端凭据放在项目根目录中名为credentials.json的文件中:

{ "web": { "client_id": "YOUR_CLIENT_ID", "project_id": "YOUR_PROJECT_ID", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "token_uri": "https://oauth2.googleapis.com/token", "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "client_secret": "YOUR_CLIENT_SECRET", "redirect_uris": ["http://localhost:3000/auth/google/callback"] } }
  1. 使用 Google 进行身份验证:

node index.js auth

这将启动一个浏览器窗口来完成 OAuth 流程并将您的凭据保存到tokens.json

  1. 通过更新claude_desktop_config.json (通常在%APPDATA%\Claude\中) 配置 Claude 使用此服务器:

{ "mcpServers": { "class": { "command": "node", "args": [ "PATH_TO_YOUR_DIRECTORY\\index.js" ] } } }

Related MCP server: Google API Discovery Service MCP Server

用法

可用工具

该服务器提供了几种与 Google Classroom 交互的工具:

1. courses - 列出你所有的 Google 课堂课程

Use the 'courses' tool to get a list of all your Google Classroom courses

2.course course-details - 获取特定课程的详细信息

Use the 'course-details' tool with the courseId parameter to get details and announcements for a specific course

参数:

  • courseId :课程的ID(可以从courses工具中获取)

3. assignments - 获取特定课程的作业

Use the 'assignments' tool with the courseId parameter to get assignments and your submissions for a specific course

参数:

  • courseId :课程的ID(可以从courses工具中获取)

克劳德的示例提示

  1. 显示我所有的 Google 课堂课程

  2. 获取我的数学课程 ID 为 123456789 的详细信息

  3. 显示 ID 为 987654321 的历史课程的所有作业

权限

服务器请求以下 Google Classroom API 权限:

  • classroom.courses.readonly - 访问课程信息

  • classroom.announcements.readonly - 访问课程公告

  • classroom.coursework.me.readonly - 访问你的课程作业和作业

  • classroom.rosters.readonly - 访问班级名册

故障排除

如果遇到权限错误,请尝试:

  1. 再次运行 auth 命令来刷新权限:

    node index.js auth
  2. 如果您的应用处于测试模式,请确保您的 Google 帐户已在 Google Cloud Console 中添加为测试用户

  3. 检查authenticateAndSaveCredentials函数中的OAuth范围以确保它们符合您的需求

笔记

  • 该服务器设计用于与 Claude AI 或其他 MCP 兼容助手一起使用

  • 所有 API 请求均使用您已验证的 Google 帐户发出

  • 令牌刷新由服务器自动处理

  • 敏感凭证本地存储在tokens.json文件中

-
security - not tested
A
license - permissive license
-
quality - not tested

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/faizan45640/google-classroom-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server