Skip to content

Installation

You need OpenCode >=2.4.1 <2.5.0, the plugin's tested range, and Node 24. The plugin has no runtime dependency and the built entry is committed, so the install needs no build step.

Add the plugin

opencode plugin add github:we-the-rebel-alliance/gws-plugin#v0.0.3

The tag is the release you install. v0.0.3 is the latest release.

Sign in

Each account is one OpenCode MCP server: gws for the default account, gws-work for an account named work. In OpenCode, run /connect and choose Google Workspace (or Google Workspace (work)), paste a Desktop OAuth client's ID and secret, choose read-only or read and write, and approve the scopes. One client can serve every alias.

Google requires two settings on that client before its Gmail MCP server accepts the token:

  • in Google Auth Platform → Clients, select Use this client for an AI-powered agent;
  • in the client's Google Cloud project, enable gmailmcp.googleapis.com with gmail.googleapis.com.

Google's setup guide lists the other services.

From a terminal, opencode auth login gws-work starts the same flow.

The executable

On the first call that needs gws, the plugin downloads the pinned 0.22.5 build from its release assets and checks it against native/provenance.json and the release manifest manifest/native.json. binary.path can name an absolute system copy instead. The plugin never runs a gws found on PATH, and it refuses a writable or project-local copy.

Several accounts

One alias per Google account, each signed in on its own:

{
  "options": {
    "accounts": {
      "work": { "enabledServices": ["gmail", "calendar", "drive"] },
      "personal": { "mode": "access_token", "enabledServices": ["drive"], "tokenEnv": "GWS_PERSONAL_TOKEN" }
    }
  }
}

Each alias is one Gmail MCP server, gws for the default account and gws-<alias> for the others, and each is signed in with /connect. A headless profile reads a credentials file or an access token from the environment variable its profile names; it needs no browser and keeps the plugin's own Gmail operations. See Accounts for the profile and the server names.

Check the sign-in

Ask OpenCode for the plugin's status, or call it in Code Mode:

await tools.gws.status()

Every account's state is one line. An account that needs a new sign-in reads needs_sign_in and names the server to choose in /connect.

Next