Google Drive Integration
Manage Google Drive files, folders, and sharing
The Google Drive integration provides access to manage Google Drive files, folders, and sharing through the Integrate MCP server.
Installation
The Google Drive integration is included with the SDK:
import { googleDriveIntegration } from "integrate-sdk/server";Setup
1. Create a Google Drive OAuth App
- Go to Google Cloud Console
- Create a new OAuth application
- Configure your redirect URI
- Note your Client ID and Client Secret
2. Configure the Integration on Your Server
Add the Google Drive integration to your server configuration. The integration automatically reads GOOGLE_DRIVE_CLIENT_ID and GOOGLE_DRIVE_CLIENT_SECRET from your environment variables:
import { createMCPServer, googleDriveIntegration } from "integrate-sdk/server";
export const { client: serverClient } = createMCPServer({
apiKey: process.env.INTEGRATE_API_KEY,
integrations: [
googleDriveIntegration({
}),
],
});You can override the environment variables by passing explicit values:
googleDriveIntegration({
clientId: process.env.CUSTOM_GOOGLE_DRIVE_ID,
clientSecret: process.env.CUSTOM_GOOGLE_DRIVE_SECRET,
});3. Client-Side Usage
The default client automatically includes all integrations. You can use it directly:
import { client } from "integrate-sdk";
await client.authorize("google_drive");
const result = await client.google_drive.listFiles({});
console.log(result);If you're using a custom client, add the integration to the integrations array:
import { createMCPClient, googleDriveIntegration } from "integrate-sdk";
const customClient = createMCPClient({
integrations: [googleDriveIntegration()],
});Configuration Options
export interface GDriveIntegrationConfig {
/** Google OAuth client ID (defaults to GOOGLE_DRIVE_CLIENT_ID env var) */
clientId?: string;
Tools
google_drive_copy_file
Copy a file
export interface GoogleDriveCopyFileParams {
/** File ID to copy */
file_id: string;
google_drive_create_folder
Create a new folder
export interface GoogleDriveCreateFolderParams {
/** Folder name */
name: string;
google_drive_delete_file
Permanently delete a file or folder (not recoverable)
export interface GoogleDriveDeleteFileParams {
/** File or folder ID */
file_id: string;
google_drive_download_file
Download file content as text. Google Workspace files are auto-exported.
export interface GoogleDriveDownloadFileParams {
/** File ID */
file_id: string;
google_drive_get_about
Get current user info and storage quota
No parameters.
google_drive_get_file
Get metadata for a file or folder
export interface GoogleDriveGetFileParams {
/** File or folder ID */
file_id: string;
google_drive_list_files
List files and folders in Google Drive
export interface GoogleDriveListFilesParams {
/** Files to return (default 20, max 1000) */
page_size?: number;
google_drive_list_permissions
List sharing permissions on a file or folder
export interface GoogleDriveListPermissionsParams {
/** File or folder ID */
file_id: string;
google_drive_move_file
Move a file or folder to a different parent
export interface GoogleDriveMoveFileParams {
/** File or folder ID to move */
file_id: string;
google_drive_remove_permission
Remove a sharing permission
export interface GoogleDriveRemovePermissionParams {
/** File or folder ID */
file_id: string;
google_drive_rename_file
Rename a file or folder
export interface GoogleDriveRenameFileParams {
/** File or folder ID */
file_id: string;
google_drive_share_file
Share a file or folder
export interface GoogleDriveShareFileParams {
/** File or folder ID */
file_id: string;
google_drive_trash_file
Move a file or folder to trash (recoverable)
export interface GoogleDriveTrashFileParams {
/** File or folder ID */
file_id: string;
google_drive_upload_text_file
Create a new file with text content
export interface GoogleDriveUploadTextFileParams {
/** File name */
name: string;
Notes
- Category: Storage
- Authentication mode: OAuth