Connect Google Drive to Claude Code

Find, read and organise files, create folders and documents, and manage who can see them. Add Toolspoke to Claude Code once and it can use 16 Google Drive actions. Your Google Drive credential stays in Toolspoke, and you choose which actions Claude Code may call.

Set it up in Claude Code

Three steps, the first one once for every toolkit you will ever add.

  1. Add Toolspoke to Claude Code

    Run it in your project, then /mcp to sign in

    claude mcp add --transport http toolspoke https://toolspoke.com/mcp

    The sign-in opens in your browser, and Toolspoke asks you to approve it.

  2. Install Google Drive and connect it

    Add Google Drive to a project in your Toolspoke workspace.

    Press connect and sign in to Google Drive. Toolspoke keeps the token encrypted and refreshes it when it expires, so there is nothing to copy and nothing to rotate by hand.

  3. Choose what Claude Code may do

    All 16 actions start on. Switch off any of the 9 actions that change something in Google Drive, and Claude Code gets a refusal if it tries.

What you can ask Claude Code for

A few of the Google Drive actions that only read, so they are safe to try first.

  • Search this connection's files and folders
  • Read the contents of a Google Doc, Sheet or Slides file as text
  • Download an uploaded file's own bytes
  • List the shared drives this account can reach

What Claude Code can do in Google Drive

7 actions read, 5 write and 4 delete or permanently change something.

Reads

  • Get account

    Read the signed-in Drive account: who it is, how much storage is used against the limit, and the largest upload it accepts. It touches no file and no file's contents, which makes it the cheapest proof that the connection works.

  • List files

    Search this connection's files and folders. `q` is Drive's own query language, "name contains 'invoice'", "fullText contains 'renewal'", "mimeType = 'application/vnd.google-apps.folder'", "'FOLDER_ID' in parents", combined with `and`. It defaults to "trashed = false", because Drive otherwise includes trashed files in every result. Remember what this connection can see: only files it created itself, or that somebody explicitly gave it, so an empty result means this connection has not been given anything matching, not that the Drive is empty.

  • Get file

    Read one file's or folder's metadata by id, name, type, size, parent folder, when it changed, and the link to open it. Drive returns almost nothing unless `fields` asks, so this asks for a useful set by default. Use "root" as the id for the My Drive root folder.

  • Export file

    Read the contents of a Google Doc, Sheet or Slides file as text. A Google-native file has no bytes to download, so this converts it: use "text/plain" or "text/markdown" for a Doc, "text/csv" for one sheet of a Sheet, "text/plain" for Slides. This is the operation for reading a document's words. Google caps an export at 10 MB.

  • Download file

    Download an uploaded file's own bytes. Only useful for text, a .txt, .md, .csv, .json or source file comes back readable, while a PDF, image, or Office document comes back as bytes nothing can use. For a Google Doc, Sheet or Slides file use export_file instead; this endpoint refuses them, because a Google-native file has no bytes of its own.

  • List permissions

    List who can reach one file or folder and in what role, reader, commenter, writer, fileOrganizer, organizer, or owner. Call this before share_file to see what access already exists, and after it to confirm what changed.

  • List shared drives

    List the shared drives this account can reach. A shared drive is owned by a team rather than a person; its id goes to list_files as driveId to look inside one.

Writes

  • Create folder

    Create an empty folder. Give `parent_id` to put it inside another folder; leave it out and the folder lands in the root of My Drive. A folder in Drive is a file whose type is application/vnd.google-apps.folder, which this sets for you.

  • Create file

    Create an empty file. Pass a Google type to get a native document ready to be written in, application/vnd.google-apps.document for a Doc, .spreadsheet for a Sheet, .presentation for Slides. This creates the file and its name only: uploading contents needs Drive's multipart or resumable upload, which this connector does not carry, so a file created here starts empty.

  • Copy file

    Copy a file, optionally under a new name and into a different folder. The copy is a new file with its own id; the original is untouched. Folders cannot be copied this way. Drive copies files only.

  • Update file

    Rename a file or folder, change its description, star it, or move it. A move is `add_parent` plus `remove_parent` together. Drive allows one parent, so the old one has to be named to be let go of. Only what is passed changes. This cannot trash a file or alter who can see it: those are trash_file and share_file.

  • Unshare file

    Remove one person's, domain's, or link's access to a file. Only ever takes access away, which is why it is a write rather than sitting with share_file. Get the permission id from list_permissions; removing the owner's permission is not possible.

Deletes or permanently changes

  • Share file

    Give somebody access to a file or folder. Classified destructive because it hands out a document rather than editing one, and there is no undoing what has already been read. `type` "user" or "group" needs `email_address`; "domain" needs `domain`; "anyone" makes the file reachable by link to anybody who has it. Google emails users and groups by default, pass send_notification_email false to stay quiet, which it does not permit for domain or anyone. Transferring ownership needs role "owner" and transfer_ownership true, and cannot be done silently.

  • Trash file

    Move a file or folder to the trash. Recoverable for 30 days from the Drive interface, after which Google removes it for good, and everything inside a trashed folder goes with it. This is the safer of the two ways to remove something; delete_file is the one with no way back.

  • Delete file

    Delete a file or folder outright. This skips the trash: there is no recovery, and deleting a folder deletes everything inside it. Prefer trash_file unless permanence is the point.

  • Empty trash

    Permanently delete every file currently in the trash. This is not a per-file delete and it cannot be undone, everything the account has thrown away goes at once. Prefer trash_file, which is recoverable, unless somebody has asked for the trash to be emptied.

Google Drive in Claude Code: questions

Does Claude Code see my Google Drive credential?

No. The credential is stored encrypted in Toolspoke, and the gateway adds it to each call. Claude Code only ever talks to Toolspoke, and the dashboard shows the last four characters of the credential and nothing more.

Can I stop Claude Code from changing things in Google Drive?

Yes. Each of the 16 actions can be switched off for a project. Turn off the 9 that change something and Claude Code can only read.

Will 16 actions crowd Claude Code's context?

No. Toolspoke shows Claude Code five bridge tools, plus a guide where a toolkit has one, and Claude Code searches for the Google Drive action it needs when it needs it. Adding more toolkits does not add more tools to its list.

Can I add it once for every project?

Yes. Add --scope user to the command and Claude Code keeps Toolspoke in every project on this machine. Without it, the server is added to the project you ran the command in.

What does it cost?

Tool calls are free on every plan, and a Google Drive call does not run in a sandbox, so it bills nothing.

Try Google Drive in Claude Code

Free to start, and tool calls cost nothing on any plan.