KosmoKrator

productivity

Google Drive MCP Integration for LangChain

Connect Google Drive to LangChain through the local KosmoKrator MCP gateway with scoped tools, credentials, and write policy.

15 functions 13 read 2 write OAuth browser flow auth

Connect Google Drive to LangChain

Bridge LangChain agents to local KosmoKrator integration tools through MCP or headless CLI calls.

Use the MCP gateway when the agent should discover tools, or wrap kosmo integrations:call for fixed chains. The gateway is local, scoped to this integration, and starts with --write=deny so LangChain can inspect read-capable tools without receiving write access by default.

Google Drive MCP Config for LangChain

Keep the gateway scoped to the integration and operation class needed by the chain.

{
  "mcpServers": {
    "kosmokrator-google_drive": {
      "type": "stdio",
      "command": "kosmo",
      "args": [
        "mcp:serve",
        "--integration=google_drive",
        "--write=deny"
      ]
    }
  }
}

Run the Gateway Manually

kosmokrator mcp:serve --integration=google_drive --write=deny

Why Use KosmoKrator Here

Scoped tools

Expose only Google Drive instead of a broad multi-service tool list.

Local credentials

Reuse credentials already configured for the KosmoKrator CLI and Lua runtime.

Write policy

Start read-only, then opt into ask or allow for trusted workspaces.

Google Drive Tools Visible to LangChain

LangChain sees stable MCP tool names generated from the Google Drive integration catalog.

MCP toolSource functionTypeDescription
integration__google_drive__google_drive_copy google_drive.google_drive_copy Read Duplicate a file in Google Drive.
integration__google_drive__google_drive_create_file google_drive.google_drive_create_file Write Create an empty Google Doc, Sheet, or Presentation in Google Drive.
integration__google_drive__google_drive_create_folder google_drive.google_drive_create_folder Write Create a folder in Google Drive.
integration__google_drive__google_drive_delete google_drive.google_drive_delete Read Permanently delete a file from Google Drive (irreversible).
integration__google_drive__google_drive_move google_drive.google_drive_move Read Move a file to a different folder in Google Drive.
integration__google_drive__google_drive_rename google_drive.google_drive_rename Read Rename a file or folder in Google Drive.
integration__google_drive__google_drive_get_file google_drive.google_drive_get_file Read Get file metadata by ID from Google Drive. For Google Docs/Sheets/Slides, use `export_as` to get content as text, csv, or markdown.
integration__google_drive__google_drive_list_permissions google_drive.google_drive_list_permissions Read List all permissions (sharing settings) on a Google Drive file or folder.
integration__google_drive__google_drive_search_files google_drive.google_drive_search_files Read Search for files in Google Drive using Drive query syntax (default: 20 results, max: 100). Trashed files are excluded by default. Drive query syntax examples: - By name: `name contains 'budget'` or `name = 'Q1 Report'` - By type: `mimeType = 'application/vnd.google-apps.spreadsheet'` (also: document, presentation, folder) - In folder: `'FOLDER_ID' in parents` - Recent: `modifiedTime > '2026-01-01'` - Shared with me: `sharedWithMe = true` - Starred: `starred = true` - By owner: `'[email protected]' in owners` - Combine: `name contains 'report' and mimeType = 'application/vnd.google-apps.spreadsheet'`
integration__google_drive__google_drive_share_file google_drive.google_drive_share_file Read Share a Google Drive file or folder. Provide `fileId`, `role` ("reader", "writer", "commenter"), and one of: - `email`: share with a specific user (e.g., "[email protected]") - `domain`: share with an entire domain (e.g., "example.com") - `type` set to `"anyone"`: make accessible to anyone with the link (no email/domain needed) - `notify` (optional, default true): send email notification (only for email shares)
integration__google_drive__google_drive_unshare_file google_drive.google_drive_unshare_file Read Remove a permission from a Google Drive file or folder. Use google_drive_list_permissions first to find the permission ID.
integration__google_drive__google_drive_star google_drive.google_drive_star Read Mark a file as starred/favorite in Google Drive.
integration__google_drive__google_drive_trash google_drive.google_drive_trash Read Move a file to trash in Google Drive (reversible).
integration__google_drive__google_drive_unstar google_drive.google_drive_unstar Read Remove star from a file in Google Drive.
integration__google_drive__google_drive_untrash google_drive.google_drive_untrash Read Restore a file from trash in Google Drive.

Related Google Drive Pages