Google Docs MCP server for AI agents and assistants

Securely connect your AI agents and chatbots (Claude, ChatGPT, Cursor, etc) with Google Docs MCP or direct API to create, edit, search, summarize, and share documents through natural language.

Google Docs logoGoogle Docs
Oauth2

Google Docs is a cloud-based word processor that enables document creation and real-time collaboration. Its seamless sharing and version history make team editing and content management a breeze.

33 Tools10 Triggers

Try Google Docs now

Type what you want done — sign in and watch it run live in the Tool Router playground.

TOOL ROUTER PLAYGROUND
Google Docs
Try asking
TOOLS & TRIGGERS

Supported Tools and Triggers

Every Google Docs action and event your agent gets out of the box.

Copy Google Document

Tool to create a copy of an existing Google Document.

Create a document

Creates a new Google Docs document using the provided title as filename and inserts the initial text at the beginning if non-empty, returning the document's ID and metadata (excluding body content).

Create Document Markdown

Creates a new Google Docs document, optionally initializing it with a title and content provided as Markdown text.

Create Footer

Tool to create a new footer in a Google Document.

Create Footnote

Tool to create a new footnote in a Google Document.

Create Header

Tool to create a new header in a Google Document, optionally with text content.

Create Named Range

Tool to create a new named range in a Google Document.

Create Paragraph Bullets

Tool to add bullets to paragraphs within a specified range in a Google Document.

Delete Content Range in Document

Tool to delete a range of content from a Google Document.

Delete Footer

Tool to delete a footer from a Google Document.

Delete Header

Deletes the header from the specified section or the default header if no section is specified.

Delete Named Range

Tool to delete a named range from a Google Document.

Delete Paragraph Bullets

Tool to remove bullets from paragraphs within a specified range in a Google Document.

Delete Table Column

Tool to delete a column from a table in a Google Document.

Delete Table Row

Tool to delete a row from a table in a Google Document.

Export Google Doc as PDF

Tool to export a Google Docs file as PDF using the Google Drive API.

Get document by id

Retrieves an existing Google Document by its ID; will error if the document is not found.

Get document plain text

Retrieve a Google Doc by ID and return a best-effort plain-text rendering.

Insert Inline Image

Tool to insert an image from a given URI at a specified location in a Google Document as an inline image.

Insert Page Break

Tool to insert a page break into a Google Document.

Insert Table in Google Doc

Tool to insert a table into a Google Document.

Insert Table Column

Tool to insert a new column into a table in a Google Document.

Insert Text into Document

Tool to insert a string of text at a specified location within a Google Document.

Get Charts from Spreadsheet

Tool to retrieve a list of all charts from a specified Google Sheets spreadsheet.

Replace All Text in Document

Tool to replace all occurrences of a specified text string with another text string throughout a Google Document.

Replace Image in Document

Tool to replace a specific image in a document with a new image from a URI.

Search Documents

Search for Google Documents using various filters including name, content, date ranges, and more.

Unmerge Table Cells

Tool to unmerge previously merged cells in a table.

Update Document Markdown

Replaces the entire content of an existing Google Docs document with new Markdown text; requires edit permissions for the document.

Update Document Section Markdown

Tool to insert or replace a section of a Google Docs document with Markdown content.

Update Document Style

Tool to update the overall document style, such as page size, margins, and default text direction.

Update existing document

Applies programmatic edits, such as text insertion, deletion, or formatting, to a specified Google Doc using the `batchUpdate` API method.

Update Table Row Style

Tool to update the style of a table row in a Google Document.

SETUP GUIDE

Connect Google Docs MCP Tool with your Agent

1

Install Composio

typescript
npm install @composio/core ai @ai-sdk/mcp @ai-sdk/openai
Install the Composio SDK and your agent framework
2

Create a session with MCP enabled

typescript
import { Composio } from "@composio/core";

const composio = new Composio();
const { mcp } = await composio.create("your-user-id", {
  toolkits: ["googledocs"],
  mcp: true,
});
Create a session scoped to Google Docs and read its MCP URL and headers
3

Connect your agent to the MCP server

typescript
import { createMCPClient } from "@ai-sdk/mcp";
import { openai } from "@ai-sdk/openai";
import { generateText, stepCountIs } from "ai";

const client = await createMCPClient({
  transport: { type: "http", url: mcp.url, headers: mcp.headers },
});

const { text } = await generateText({
  model: openai("gpt-5.6-sol"),
  tools: await client.tools(),
  prompt: "Summarize the main points from my \"Q2 Planning\" document",
  stopWhen: stepCountIs(10),
});

console.log(text);
await client.close();
Pass the session's MCP URL and headers to your agent and run a Google Docs request
SETUP GUIDE

Connect Google Docs API Tool with your Agent

1

Install Composio

typescript
npm install @composio/core @composio/openai openai
Install the Composio SDK, the OpenAI provider, and the OpenAI SDK
2

Create a Composio session

typescript
import OpenAI from "openai";
import { Composio } from "@composio/core";
import { OpenAIResponsesProvider } from "@composio/openai";

const composio = new Composio({ provider: new OpenAIResponsesProvider() });
const client = new OpenAI();

const session = await composio.create("your-user-id", { toolkits: ["googledocs"] });
const tools = await session.tools();
Initialize Composio with the OpenAI Responses provider and create a session scoped to Google Docs
3

Run Google Docs tools with your agent

typescript
let response = await client.responses.create({
  model: "gpt-5.6-sol",
  tools,
  input: [{ role: "user", content: "Summarize the main points from my \"Q2 Planning\" document" }],
});

while (response.output.some((o) => o.type === "function_call")) {
  const outputs = await composio.provider.handleToolCalls(session, response.output);
  response = await client.responses.create({
    model: "gpt-5.6-sol",
    tools,
    previous_response_id: response.id,
    input: outputs,
  });
}

console.log(response.output_text);
Send a request, execute the Google Docs tool calls through the session, and print the final answer

Why Use Composio?

AI Native Google Docs Integration

  • Supports both Google Docs MCP and direct API based integrations
  • Structured, LLM-friendly schemas for reliable tool execution
  • Rich coverage for reading, writing, and querying your Google Docs data

Managed Auth

  • Built-in OAuth handling with automatic token refresh and rotation
  • Central place to manage, scope, and revoke Google Docs access
  • Per user and per environment credentials instead of hard-coded keys

Agent Optimized Design

  • Tools are tuned using real error and success rates to improve reliability over time
  • Comprehensive execution logs so you always know what ran, when, and on whose behalf

Enterprise Grade Security

  • Fine-grained RBAC so you control which agents and users can access Google Docs
  • Scoped, least privilege access to Google Docs resources
  • Full audit trail of agent actions to support review and compliance

Rolling this out across your team?

Give your team centralized access control across every framework with Composio’s MCP Gateway.

EXPLORE MCP GATEWAY
FAQ

Frequently asked questions

No. Composio provides a managed OAuth app for Google Docs, so you sign in with your normal Google Docs account and approve access. If you later want the consent screen to show your own company name, you can add your own Google Docs OAuth app in the Composio dashboard, and every connection after that uses it.

Yes! Composio's Tool Router enables agents to use multiple toolkits. Learn more.

Yes. Composio is SOC 2 Type II compliant and is built to keep your Google Docs connection and credentials secure. OAuth tokens and API keys are encrypted, and sensitive customer data is protected at rest and in transit.

Composio also undergoes independent security testing and continuously monitors its systems for security threats. You can review the latest reports and policies in the Composio Trust Center.

Composio maintains and updates all toolkit integrations automatically, so your agents always work with the latest API versions.

When you connect a Google Docs account through Composio, every action runs under that account, so anything the agent creates, sends, or changes shows up in Google Docs as done by you. Keep an approval step in your prompt for actions with side effects, such as sending or deleting, and have the agent draft first.

Exactly the ones Google Docs lists on its consent screen when you connect. Review that screen before approving. If you connect a work account, your Google Docs administrator may need to approve the app first, and you can revoke the access inside Google Docs whenever you want.

Yes. Composio supports multiple connected accounts for the same app, and that works in Claude, ChatGPT, or any other assistant you connect through Composio. Give each Google Docs connection a name such as work or personal, and the assistant uses the one you mention in the request. Each account keeps its own credentials and nothing is merged.

Composio refreshes Google Docs tokens automatically, so day to day you do nothing. If you revoke access inside Google Docs, or Google Docs invalidates the session, the connection shows as expired in Composio and the agent stops acting on that account until you reconnect it, which is a single sign-in.

Composio's free Hobby plan includes 100,000 tool calls per month with no credit card, and up to 20,000 of those can run through Composio-managed apps like Google Docs. Personal Google Docs use rarely gets near that. Paid plans add higher limits and team features, and Google Docs's own pricing is unaffected.

Built-in connectors usually give one AI access to a limited set of apps. Many people use Composio because it lets their AI connect to more apps than it normally supports, or connect to multiple accounts for the same app (e.g. connect Claude to multiple Google Docs accounts).

With Composio, you connect Google Docs once and then use it across different AI assistants without setting it up separately in each one. Connect your apps to Composio once, then connect Composio to whichever AI you use, whether that's Claude, ChatGPT, Hermes, or your own custom assistant.

Start with Google Docs.It takes 30 seconds.

Managed auth, hosted MCP servers, and every Google Docs tool your agent needs.Free to start.

Start building