Utilizes Google Cloud Console for project setup and API management to enable authentication and access to Google Slides services.
Requires Google Drive file access permissions to interact with Google Slides presentations stored in Google Drive.
Provides tools for creating and editing Google Slides presentations, including adding new slides, inserting rectangles, and managing presentation content programmatically.
Google Slides MCP Server
A Model Context Protocol (MCP) server that provides tools for interacting with Google Slides presentations. This server allows you to create new slides and add rectangles to existing slides.
Features
Create New Slides: Add blank slides to existing Google Slides presentations
Add Rectangles: Insert rectangles with dimensions that are 20% of the slide size
OAuth2 Authentication: Secure authentication flow with Google APIs
Presentation Management: Get presentation info and list slides
Installation
Clone or download this repository
Install dependencies:
Build the TypeScript code:
Google Cloud Console Setup
Before using this MCP server, you need to set up a Google Cloud project and enable the Google Slides API:
1. Create a Google Cloud Project
Go to the Google Cloud Console
Create a new project or select an existing one
Enable the Google Slides API:
Go to "APIs & Services" > "Library"
Search for "Google Slides API"
Click on it and press "Enable"
2. Create OAuth2 Credentials
Go to "APIs & Services" > "Credentials"
Click "Create Credentials" > "OAuth client ID"
If prompted, configure the OAuth consent screen first:
Choose "External" user type
Fill in the required fields (App name, User support email, etc.)
Add your email to test users
For the OAuth client ID:
Choose "Desktop application" as the application type
Give it a name (e.g., "Google Slides MCP Server")
Download the credentials JSON file
3. Configure Environment Variables
Copy
.env.example
to.env
:
Edit
.env
and add your OAuth2 credentials:
Usage
Starting the Server
Or for development with auto-reload:
Authentication Flow
Before using the Google Slides tools, you need to authenticate:
Call the
get_auth_url
tool to get the OAuth2 authorization URLVisit the URL in your browser and grant permissions
Copy the authorization code from the redirect URL
Call the
authenticate
tool with the authorization code
The authentication tokens will be saved locally and reused for future requests.
Available Tools
1. get_auth_url
Get the OAuth2 authorization URL for Google Slides access.
Parameters: None
Example:
2. authenticate
Complete OAuth2 authentication with authorization code.
Parameters:
code
(string, required): Authorization code from OAuth2 flow
Example:
3. create_slide
Create a new slide in a Google Slides presentation.
Parameters:
presentationId
(string, required): The ID of the Google Slides presentationinsertionIndex
(number, optional): Position where to insert the slide (defaults to 0)
Example:
4. add_rectangle
Add a rectangle to a slide with 20% of slide dimensions.
Parameters:
presentationId
(string, required): The ID of the Google Slides presentationslideId
(string, required): The ID of the slide to add the rectangle tox
(number, optional): X position of the rectangle (defaults to center)y
(number, optional): Y position of the rectangle (defaults to center)width
(number, optional): Width of the rectangle (defaults to 20% of slide width)height
(number, optional): Height of the rectangle (defaults to 20% of slide height)
Example:
5. get_presentation_info
Get information about a Google Slides presentation.
Parameters:
presentationId
(string, required): The ID of the Google Slides presentation
Example:
6. list_slides
List all slides in a Google Slides presentation.
Parameters:
presentationId
(string, required): The ID of the Google Slides presentation
Example:
Finding Your Presentation ID
The presentation ID can be found in the Google Slides URL:
For example, in this URL:
The presentation ID is: 1BxAB07047kHMdtbgoC48KDz3YMgn9_abcdefgh
Common Workflow
First time setup:
# Get authorization URL {"name": "get_auth_url", "arguments": {}} # After visiting URL and getting code {"name": "authenticate", "arguments": {"code": "your_auth_code"}}Create a new slide:
{"name": "create_slide", "arguments": {"presentationId": "your_presentation_id"}}Add a rectangle to the slide:
{"name": "add_rectangle", "arguments": {"presentationId": "your_presentation_id", "slideId": "returned_slide_id"}}
Error Handling
The server provides detailed error messages for common issues:
Authentication required
Invalid presentation ID
Invalid slide ID
Network connectivity issues
Google API quota limits
Development
Project Structure
Scripts
npm run build
- Compile TypeScript to JavaScriptnpm start
- Run the compiled servernpm run dev
- Run with ts-node for developmentnpm run watch
- Watch for changes and recompile
Troubleshooting
Authentication Issues
Ensure your Google Cloud project has the Google Slides API enabled
Check that your OAuth2 credentials are correct in the
.env
fileMake sure you're using the correct redirect URI
Verify that your email is added as a test user if using external OAuth consent
API Errors
Check that the presentation ID is correct and accessible
Ensure you have edit permissions for the Google Slides presentation
Verify that the slide ID exists when adding rectangles
Permission Errors
The server requires the following Google API scopes:
https://www.googleapis.com/auth/presentations
- For creating and editing slideshttps://www.googleapis.com/auth/drive.file
- For accessing Google Drive files
License
MIT
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Enables interaction with Google Slides presentations through OAuth2 authentication. Supports creating new slides, adding rectangles, and managing presentation content through natural language commands.