
Google Slides
STDIOMCP server for creating and modifying Google Slides presentations programmatically
MCP server for creating and modifying Google Slides presentations programmatically
This project provides a Model Context Protocol (MCP) server for interacting with the Google Slides API. It allows you to create, read, and modify Google Slides presentations programmatically.
Clone the repository (if applicable) or ensure you are in the project directory.
Install dependencies:
npm install
Build the Server: Compile the TypeScript code to JavaScript:
npm run build
This will create a build
directory containing the compiled JavaScript code.
Obtain Google API Credentials:
https://www.googleapis.com/auth/presentations
(To view and manage your presentations)https://www.googleapis.com/auth/drive.readonly
or other Drive scopes if needed for specific operations like listing files, although not strictly required for basic Slides operations)Obtain a Google Refresh Token:
https://www.googleapis.com/auth/presentations
scope (and any other Drive scopes if you added them).Alternatively, you can use the provided get-token
script to obtain a refresh token. This script will build the project and then run a utility that guides you through the OAuth flow to get a refresh token. Ensure your GOOGLE_CLIENT_ID
and GOOGLE_CLIENT_SECRET
are configured in your environment or a .env
file if the script requires them (you may need to check the src/getRefreshToken.ts
file for details on how it expects credentials). To run the script:
npm run get-token
Configure Credentials and Command in MCP Settings:
Locate your MCP settings file (e.g., .../User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
). Find or create the entry for "google-slides-mcp"
and configure it with the command to run the server and your credentials:
"google-slides-mcp": { "transportType": "stdio", "command": "node", "args": [ "/path/to/google-slides-mcp/build/index.js" ], "env": { "GOOGLE_CLIENT_ID": "YOUR_CLIENT_ID", "GOOGLE_CLIENT_SECRET": "YOUR_CLIENT_SECRET", "GOOGLE_REFRESH_TOKEN": "YOUR_REFRESH_TOKEN" } // ... other optional settings like description ... }
Replace /path/to/google-slides-mcp/build/index.js
with the actual path to the compiled server index file on your system. Replace YOUR_CLIENT_ID
, YOUR_CLIENT_SECRET
, and YOUR_REFRESH_TOKEN
with the actual values you obtained. The MCP runner will inject these values into the server's environment when it starts.
Execute the compiled code:
npm run start
The server will start and listen for MCP requests on standard input/output (stdio). You should see a message like: Google Slides MCP server running and connected via stdio.
The server exposes the following tools via the Model Context Protocol:
create_presentation
: Creates a new Google Slides presentation.
title
(string, required): The title for the new presentation.get_presentation
: Retrieves details about an existing presentation.
presentationId
(string, required): The ID of the presentation to retrieve.fields
(string, optional): A field mask (e.g., "slides,pageSize") to limit the returned data.batch_update_presentation
: Applies a series of updates to a presentation. This is the primary method for modifying slides (adding text, shapes, images, creating slides, etc.).
presentationId
(string, required): The ID of the presentation to update.requests
(array, required): An array of request objects defining the updates. Refer to the Google Slides API batchUpdate
documentation for the structure of individual requests.writeControl
(object, optional): Controls write request execution (e.g., using revision IDs).get_page
: Retrieves details about a specific page (slide) within a presentation.
presentationId
(string, required): The ID of the presentation containing the page.pageObjectId
(string, required): The object ID of the page (slide) to retrieve.summarize_presentation
: Extracts and formats all text content from a presentation for easier summarization.
presentationId
(string, required): The ID of the presentation to summarize.include_notes
(boolean, optional): Whether to include speaker notes in the summary. Defaults to false.title
: The presentation's titleslideCount
: Total number of slideslastModified
: Revision informationslides
: Array of slide objects containing:
slideNumber
: Position in presentationslideId
: Object ID of the slidecontent
: All text extracted from the slidenotes
: Speaker notes (if requested and available)(More tools can be added by extending src/index.ts
)