Google Slides MCP Server
Enables interaction with Google Slides presentations through OAuth2 authentication. Supports creating new slides, adding rectangles, and managing presentation content through natural language commands.
README
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:
npm install
- Build the TypeScript code:
npm run build
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.exampleto.env:
cp .env.example .env
- Edit
.envand add your OAuth2 credentials:
GOOGLE_CLIENT_ID=your_client_id_here
GOOGLE_CLIENT_SECRET=your_client_secret_here
GOOGLE_REDIRECT_URI=http://localhost:3000/oauth2callback
Usage
Starting the Server
npm start
Or for development with auto-reload:
npm run dev
Authentication Flow
Before using the Google Slides tools, you need to authenticate:
- Call the
get_auth_urltool to get the OAuth2 authorization URL - Visit the URL in your browser and grant permissions
- Copy the authorization code from the redirect URL
- Call the
authenticatetool 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:
{
"name": "get_auth_url",
"arguments": {}
}
2. authenticate
Complete OAuth2 authentication with authorization code.
Parameters:
code(string, required): Authorization code from OAuth2 flow
Example:
{
"name": "authenticate",
"arguments": {
"code": "4/0AX4XfWh..."
}
}
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:
{
"name": "create_slide",
"arguments": {
"presentationId": "1BxAB07047kHMdtbgoC48KDz3YMgn9_12345678",
"insertionIndex": 1
}
}
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:
{
"name": "add_rectangle",
"arguments": {
"presentationId": "1BxAB07047kHMdtbgoC48KDz3YMgn9_12345678",
"slideId": "slide_12345"
}
}
5. get_presentation_info
Get information about a Google Slides presentation.
Parameters:
presentationId(string, required): The ID of the Google Slides presentation
Example:
{
"name": "get_presentation_info",
"arguments": {
"presentationId": "1BxAB07047kHMdtbgoC48KDz3YMgn9_12345678"
}
}
6. list_slides
List all slides in a Google Slides presentation.
Parameters:
presentationId(string, required): The ID of the Google Slides presentation
Example:
{
"name": "list_slides",
"arguments": {
"presentationId": "1BxAB07047kHMdtbgoC48KDz3YMgn9_12345678"
}
}
Finding Your Presentation ID
The presentation ID can be found in the Google Slides URL:
https://docs.google.com/presentation/d/PRESENTATION_ID_HERE/edit
For example, in this URL:
https://docs.google.com/presentation/d/1BxAB07047kHMdtbgoC48KDz3YMgn9_abcdefgh/edit
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
src/
├── index.ts # Main MCP server entry point
├── auth.ts # Google OAuth2 authentication
└── slides.ts # Google Slides API service
dist/ # Compiled JavaScript (after npm run build)
package.json # Project dependencies and scripts
tsconfig.json # TypeScript configuration
.env.example # Environment variables template
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
.envfile - Make 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
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.