Google Drive Model Context Protocol (MCP) Server for AI Agents - n8n Workflow

Build a powerful Google Drive MCP server using n8n to enable AI agents to search, download, and read complex file contents (PDF, CSV, image, audio) via a single n8n workflow.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

AI developers seeking to build custom tools for large language models (LLMs).
Organizations needing to expose structured Google Drive content securely to internal AI agents.
Users interested in advanced server creation using the Model Context Protocol (MCP) and n8n templates.
n8n automation specialists looking for examples of recursive workflow execution.

Overview

The Model Context Protocol (MCP) allows large language models (LLMs) to interact with external systems using defined tools. This specific n8n workflow transforms your n8n instance into a sophisticated Google Drive MCP server. It solves the critical problem of handling diverse binary file formats (like PDF, CSV, images, and audio) which standard AI tools cannot read directly. By combining the power of the specialized MCP n8n trigger with robust n8n nodes for file handling and OpenAI for multimodal analysis, this n8n template ensures that agents receive clean, textual representations of complex files, drastically improving the utility and accuracy of AI agents working with cloud storage.

How it Works

This powerful n8n workflow operates in two main stages, driven by a dedicated MCP server n8n trigger.


  1. Agent Interaction and Tool Selection: The workflow begins with the Google Drive MCP Server n8n trigger. This trigger exposes two key capabilities (tools) to the connected AI agent.

Search Files from Gdrive: This tool uses an n8n node configured to search Google Drive based on a query generated by the AI agent.
Read File From GDrive: This tool is implemented using a Custom Workflow n8n node, which recursively calls this same n8n workflow instance using the When Executed by Another Workflow n8n trigger, passing the specific fileId and operation: readFile.


  1. File Download and Conversion: Upon recursive trigger, the workflow verifies the readFile operation via a Switch n8n node. It then uses the Google Drive n8n node (Download File1) to fetch the requested file. Crucially, it attempts internal Google conversions (e.g., converting Google Docs to plain text).


  1. Content Routing and Extraction: The FileType Switch n8n node examines the file's MIME type. If the file is a PDF or CSV, it uses the Extract from File n8n node to parse the content into structured text. If the file is an image or audio, it routes the data to the dedicated OpenAI n8n node. The Analyse Image n8n node uses a vision model (like GPT-4o-mini) to describe the image, and the Transcribe Audio n8n node transcribes the audio, ensuring the AI agent always receives usable text output.

Installation Guide

To deploy this comprehensive n8n template, follow these steps:


  1. Import: Copy the provided n8n workflow JSON and paste it into your n8n instance using the 'New' -> 'Import from JSON' function.

  2. Google Drive Credentials: Locate the Google Drive n8n node (Download File1 and Search Files from Gdrive). Click 'Credentials' and authenticate your Google Drive account, ensuring it has read access to the relevant files or folders.

  3. OpenAI Credentials: Locate the OpenAI n8n node (Analyse Image and Transcribe Audio). Set up or select your OpenAI API Key credentials. The OpenAI n8n node requires access to models capable of vision and transcription (like gpt-4o-mini).

  4. MCP Server Setup: The primary Google Drive MCP Server n8n trigger is pre-configured with a path. Before going live, it is highly recommended to enable authentication on this n8n trigger for security (as noted in the sticky note).

  5. Activation: Ensure the n8n workflow is set to 'Active' to start listening for MCP requests from AI agents.

Node Details

Google Drive MCP Server (MCP Trigger): This is the core n8n trigger. It listens for incoming requests from MCP clients (AI agents) and presents the available tools defined within the n8n workflow.
When Executed by Another Workflow (Trigger): A specialized n8n trigger used here for recursive execution. It enables the Read File From GDrive tool to call back to the main n8n workflow structure to handle the file processing logic.
Search Files from Gdrive (Google Drive Tool): An auxiliary tool using the Google Drive n8n node. It accepts the AI's search query and returns metadata about matching files.
Download File1 (Google Drive n8n node): Downloads the target file using the received fileId. Key configuration includes setting Google File Conversion options to convert certain document formats to plain text.
Operation / FileType (Switch n8n node): These flow control n8n nodes are essential for routing. The 'Operation' switch handles different MCP commands, while the 'FileType' switch inspects the MIME type of the downloaded binary data to route it correctly to the appropriate extraction or AI processing n8n node.
Extract from PDF / Extract from CSV (Extract from File n8n node): These built-in utility n8n nodes efficiently parse binary PDF or CSV file data and transform it into text or structured JSON data, respectively.


  • Analyse Image / Transcribe Audio (OpenAI n8n node): These powerful n8n nodes handle multimodal data. They utilize OpenAI's capabilities (vision models and transcription APIs) to describe images or transcribe audio, ensuring complex binary files are converted into contextually rich text for the AI agent.

Related n8n Workflows

Free

Nodes: 10 Nodes
Updated: December 26 2025
View all
Created by
Jimleuk
Jimleuk

Freelance consultant based in the UK specialising in AI-powered automations. I work with select clients tackling their most challenging projects. For business enquiries, send me an email at [email protected] LinkedIn: https://www.linkedin.com/in/jimleuk/ X/Twitter: https://x.com/jimle_uk

Featured*