
Insert an inline image at a specific location
Create a named range (bookmark) in a document
Delete a named range from a document
Replace the content of a named range with new text. Named ranges auto-update their indices when surrounding content shifts, making them safer than replacetext for templated documents. Use createnamed_range first.
Create a header section at a section break in a document
Delete a header section from a document
Create a footer section at a section break in a document
Delete a footer section from a document
Apply bullet or numbered list formatting to all paragraphs that overlap a range. Use bulletpreset to pick the list style. To remove bullets later, call deleteparagraph_bullets with the same range.
Remove bullet/numbered list formatting from all paragraphs that overlap a range. Paragraph text is preserved.
Read a Google Docs document as lightweight markdown-lite text (headings, bullets, tab titles). Use this for reading, summarizing, or searching content cheaply when you do NOT need to edit. Lossy: drops index ranges, styling, and images. Pass tabid (from listtabs) to read one tab. To edit or get exact structure, use get_document instead.
Create a new Google Docs document with optional title
Retrieve a Google Docs document's full structural JSON by ID: the index ranges needed to edit (insert/delete/replace by index), styling, and images. Use this to edit or when exact structure matters. Response can be large; pass fields (Google field mask) or tabid to shrink it. To only read or search text, use getdocumenttext. To list tabs, use listtabs.
Get the end index for appending content to a document
Insert an image into a table cell by table position
Insert text into a table cell by table position
Create and populate a table with data in one operation
Apply multiple updates to a document in a single operation
Insert text at a specific location in a document
Delete text from a specified range in a document
Find and replace all occurrences of text in a document
Apply text formatting to a range in a document
Apply paragraph formatting to a range in a document
Append text to the end of a document
Insert a footnote reference at the given index. The API creates a numbered reference and a corresponding footnote section at the page bottom; use insert_text with the returned footnoteId to populate footnote content.
Find literal text in a Google Docs document and return each match's UTF-16 start/end index and tabid, ready to pass to inserttext, deletetext, or formattext. Use this to locate where to edit instead of fetching the full JSON via getdocument. Case-insensitive by default. Searches tab bodies only (not headers/footers/footnotes). Pair with getdocument_text for reading.
Insert a section break at a specific index. Use NEXTPAGE/EVENPAGE/ODD_PAGE to start a new page; CONTINUOUS to keep flow.
Update section style (columns, separator, content direction, margins) over a range. Provide at least one style field; use get_document to find section break indices.
Set page margins, page size, or background color on the document. Provide only the fields you want to change. Use 612pt x 792pt for US Letter, 595pt x 842pt for A4.
Redefine a named style document-wide (HEADING1 through HEADING6, NORMAL_TEXT, TITLE, SUBTITLE). All paragraphs using that named style will adopt the new typography. Use this for branded document templates instead of formatting paragraphs individually.
List all tabs in a Google Docs document, returning tab IDs, titles, and nesting only (no document content). Use this to discover tabids cheaply before reading or writing a specific tab; do not call getdocument just to enumerate tabs.
Create a new tab in a Google Docs document
Delete a tab from a Google Docs document by tab ID. Use list_tabs to find tab IDs
Update a tab's properties (e.g. rename it) in a Google Docs document
Insert a table with specified rows and columns
Insert a new row into an existing table
Insert a new column into an existing table
Delete a row from an existing table
Delete a column from an existing table
Pin the first N rows of a table as headers that repeat at the top of every page break. Pass 0 to unpin all header rows.
Set minimum row height and/or overflow prevention on one or more rows in a table. At least one of minrowheightpt or preventoverflow must be set. Omit row_indices to apply to every row.
Set width on one or more columns in a table. Use widthtype=FIXEDWIDTH with widthpt for explicit widths, or EVENLYDISTRIBUTED to mark the targeted columns as evenly distributed (Google computes their widths as the remaining table width shared across all EVENLYDISTRIBUTED columns in the table). Empty columnindices targets every column.
Update visual styling on a single table cell - background color, borders, padding, vertical alignment. Cell is identified by its containing table's start index plus zero-based row/column. Use inserttable or createandpopulatetable first.
Merge a rectangular block of table cells into one. Specify the upper-left and lower-right cell positions. Common in header rows and summary tables. Use get_document to find the table's start index.
Reverse a previous mergetablecells operation, restoring the cells in the specified range to individual cells. Use get_document to find the table's start index and the bounds of a previously merged region.
Validate Google Docs credentials. Verifies credentials during setup.

In an mcp.json file, add the configuration below, and restart Cursor.
Learn more in the official documentation ↗
1{
2 "mcpServers": {
3 "agent-handler": {
4 "url": "https://ah-api-develop.merge.dev/api/v1/tool-packs/{TOOL_PACK_ID}/registered-users/{REGISTERED_USER_ID}/mcp",
5 "headers": {
6 "Authorization": "Bearer yMt*****"
7 }
8 }
9 }
10}
11Open your Claude Desktop configuration file and add the server configuration below. You'll also need to restart the application for the changes to take effect.
Make sure Claude is using the Node v20+.
Learn more in the official documentation ↗
1{
2 "mcpServers": {
3 "agent-handler": {
4 "command": "npx",
5 "args": [
6 "-y",
7 "mcp-remote@latest",
8 "https://ah-api-develop.merge.dev/api/v1/tool-packs/{TOOL_PACK_ID}/registered-users/{REGISTERED_USER_ID}/mcp",
9 "--header",
10 "Authorization: Bearer ${AUTH_TOKEN}"
11 ],
12 "env": {
13 "AUTH_TOKEN": "yMt*****"
14 }
15 }
16 }
17}Open your Windsurf MCP configuration file and add the server configuration below.
Click on the refresh button in the top right of the Manage MCP server page or in the top right of the chat box in the box icon.
Learn more in the official documentation ↗
1{
2 "mcpServers": {
3 "agent-handler": {
4 "command": "npx",
5 "args": [
6 "-y",
7 "mcp-remote@latest",
8 "https://ah-api.merge.dev/api/v1/tool-packs/<tool-pack-id>/registered-users/<registered-user-id>/mcp",
9 "--header",
10 "Authorization: Bearer ${AUTH_TOKEN}"
11 ],
12 "env": {
13 "AUTH_TOKEN": "<ah-production-access-key>"
14 }
15 }
16 }
17 }In Command Palette (Cmd+Shift+P on macOS, Ctrl+Shift+P on Windows), run "MCP: Open User Configuration".
You can then add the configuration below and press "start" right under servers. Enter the auth token when prompted.
Learn more in the official documentation ↗
1{
2 "inputs": [
3 {
4 "type": "promptString",
5 "id": "agent-handler-auth",
6 "description": "Agent Handler AUTH_TOKEN", // "yMt*****" when prompt
7 "password": true
8 }
9 ],
10 "servers": {
11 "agent-handler": {
12 "type": "stdio",
13 "command": "npx",
14 "args": [
15 "-y",
16 "mcp-remote@latest",
17 "https://ah-api-develop.merge.dev/api/v1/tool-packs/{TOOL_PACK_ID}/registered-users/{REGISTERED_USER_ID}/mcp",
18 "--header",
19 "Authorization: Bearer ${input:agent-handler-auth}"
20 ]
21 }
22 }
23}It's an MCP server that connects your agents to Google Docs via tools. Your agents can invoke these tools to create documents, insert and format text, manage tables, add headers and footers, and more.
Google doesn't offer a standalone MCP server purpose built for Google Docs, but you can use one from a third-party platform, like Merge Agent Handler.
The use cases naturally depend on the agent you've built, but here are a few common ones:
create_document</code> and uses <code class="blog_inline-code">append_text</code> and <code class="blog_inline-code">create_and_populate_table</code> to generate a formatted report with section headers and data tables, ready to share without anyone touching a doc manuallyreplace_text</code> to fill in placeholders in a template document with the customer name, contract terms, and start date, producing a draft ready for review in secondsinsert_text</code> and <code class="blog_inline-code">format_paragraph</code> to organize raw content into a clean Google Doc with section headings, a summary, and a clearly formatted action item listappend_text</code> to add a formatted entry to a shared project log document, keeping a persistent record without requiring anyone to manually update the doc after each changeHere are some of the most commonly used tools:
<code class="blog_inline-code">create_document</code> creates a new Google Doc with a specified title. Use this when an agent needs to generate a fresh document in response to a trigger, like a new project kickoff or a completed data run<code class="blog_inline-code">append_text</code> adds text to the end of an existing document. Good for agents that maintain a running log or need to accumulate entries over time without overwriting previous content<code class="blog_inline-code">insert_text</code> places text at a specific position in the document body. Call this when an agent needs to inject content at a precise location rather than at the end of the document<code class="blog_inline-code">replace_text</code> finds all instances of a string in the document and swaps them with a new value. Useful for agents that fill in template documents with data pulled from an external system at generation time<code class="blog_inline-code">format_text</code> applies character-level formatting such as bold, italic, font size, or color to a specified text range. Helpful when an agent needs to produce a consistently styled document rather than plain unformatted output<code class="blog_inline-code">create_and_populate_table</code> inserts a new table into the document and fills it with provided row and column data in one call. Use this when an agent needs to embed structured data, like a summary table or comparison grid, directly in a documentA few things distinguish Merge Agent Handler's Google Docs MCP server from building your own or relying on a standalone option:
You can take the following steps:
1. Create or log into your Merge Agent Handler account and navigate to Tool Packs (collections of connector tools scoped to a specific use case).
2. Create a new Tool Pack, then find and enable the Google Docs connector. Choose which tools to include: enable read tools like <code class="blog_inline-code">get_document</code> for retrieval use cases, or add write tools like <code class="blog_inline-code">create_document</code> and <code class="blog_inline-code">append_text</code> if your agent needs to generate or modify documents.
3. Add a Registered User inside the Tool Pack. This is the identity context under which your agent operates. Merge generates a unique MCP URL scoped to this user once it's created.
4. From the Registered User detail page, authenticate Google Docs by completing the OAuth flow. Merge stores and manages the credentials going forward.
5. Copy the MCP URL from the Tool Pack detail page and generate an API key from Settings. You'll need both to connect your agent.
6. Add the MCP server to your agent or IDE using the MCP URL and API key. Your Google Docs tools are now accessible through that endpoint.
Whether you're an engineer experimenting with agents or a product manager looking to add tools, you can get started for free now