dsh-plugin-google-classroom:在 DSH 裏只讀訪問 Google Classroom

前言

在 DeepSeek Harness(DSH)裏做帶聯網能力的智能體時,課程、作業截止日和名冊往往還在 Google Classroom 網頁或單獨腳本里查。模型若不能直接調用結構化接口,就只能靠用戶口述或複製粘貼,既慢也容易漏掉跨課程彙總(例如「這週有什麼要交」)。

下面介紹社區插件 dsh-plugin-google-classroom(npm 包名 dsh-google-classroom):它把 google-classroom-mcp 以 MCP 工具形式掛進 DSH,模型可通過 mcp__google-classroom__* 只讀查詢課程、作業、公告、名冊與提交狀態。插件本身不含 Host/Client 代碼,僅通過 cordis.patch.yml 插入一條 @deepseek-ai/dsh-mcp-client 配置。

這是什麼

DSH 的生態思路是「一切皆插件」;SkillHub 等目錄由社區維護,與 DeepSeek / 幻方無官方從屬關係。本插件是 configuration-only bundle:package.json 聲明 dsh.bundle.patch,由補丁向 Cordis 寫入 MCP 客戶端行,運行時通過 uvx 按需拉取並啓動 google-classroom-mcp 服務。

核心功能

所有暴露給模型的工具均爲 只讀,命名空間爲 mcp__google-classroom__*:

工具 返回內容
list_courses 你任教或就讀的課程
get_course 單門課程詳情(含描述、加入碼)
list_coursework 作業、測驗、問題與材料(含截止日期)
list_due_soon 所有活躍課程中即將到期的作業
list_announcements 課程內近期公告
list_teachers / list_students 名冊(姓名、郵箱)
list_submissions 某次作業的提交狀態與成績

前置條件

啓用插件前需完成 Google OAuth 與一次性登錄(步驟以 google-classroom-mcp — Setup 第 1–3 步爲準):

  1. 在 Google Cloud 創建面向 Classroom API 的 OAuth 桌面客戶端,保存爲 ~/.google-classroom-mcp/client_secret.json。
  2. 安裝 uv(提供 uvx),可從 astral.sh/uv 安裝,或 pip install uv。bundle 用 uvx 按需運行服務端,無需單獨 pip install MCP 包。
  3. 執行一次性登錄:
uvx --from git+https://github.com/praisethefacts/google-classroom-mcp@v0.1.0 google-classroom-mcp-auth

憑證與 token 落在 ~/.google-classroom-mcp/。DSH 啓動 stdio 子進程時會 scrub 名稱像憑證的環境變量(KEY、PASSWORD、SECRET、TOKEN),因此本 bundle 依賴上述 token 文件,不依賴環境變量注入密鑰。

安裝與啓用

在 DSH 側邊欄打開 Plugins,填入下列 spec 之一併 Enable now:

  • github:praisethefacts/dsh-plugin-google-classroom
  • 或本倉庫目錄的絕對路徑(若本地已有副本)

或在終端執行(將 <profile> 換成你的 profile 名,例如 web 或 desktop):

dsh plugin --profile <profile> add github:praisethefacts/dsh-plugin-google-classroom

默認補丁會通過 uvx 運行:

uvx --from git+https://github.com/praisethefacts/google-classroom-mcp@v0.1.0 google-classroom-mcp

若已本地安裝或克隆 MCP 服務,可在 安裝前 編輯 cordis.patch.yml,改 command / args,例如:

- insert:
    - id: mcp-google-classroom
      name: '@deepseek-ai/dsh-mcp-client'
      config:
        serverName: google-classroom
        transport: stdio
        command: google-classroom-mcp

典型用法與驗證

安裝並完成 Prerequisites 後,可直接問模型:What do I have due this week?,或讓模型調用 mcp__google-classroom__list_courses。

首次工具調用可能較慢(uvx 需下載服務端與依賴),之後通常會快很多。

若每次調用都返回 No valid Google credentials found...,說明尚未完成一次性 sign-in,請回到前置條件。若 Google API 報錯與 scope 相關,說明 OAuth 同意屏幕未授權 Classroom 只讀 scope:刪除 ~/.google-classroom-mcp/token.json 後重新 sign in。

適用場景與注意

適合:已在 Google Classroom 管理或學習、希望在 DSH 對話裏彙總截止作業、查公告或名冊的開發者或師生;需要模型在 Harness 內結構化讀 Classroom 而非手動導出 CSV 的場景。

注意:

  • 插件以 當前 DSH 進程的用戶權限 運行,MCP 子進程同樣在該環境下讀 ~/.google-classroom-mcp/。安裝前應閱讀 倉庫源碼與 LICENSE,確認只讀範圍與數據出境策略符合你的組織要求。
  • 能力邊界爲 README 所列只讀工具;寫操作不在本 bundle 範圍內。
  • OAuth 與 Classroom API 配額、同意屏幕配置由你在 Google Cloud 側負責。

結尾

dsh-plugin-google-classroom 把 Google Classroom 只讀查詢收成 DSH 裏的 MCP 工具集,配置輕、依賴 uvx 按需拉服務。完成 OAuth 與 google-classroom-mcp-auth 後,即可在對話裏查課程、截止日與提交狀態。

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

小夜