The gslides-api MCP (Model Context Protocol) server exposes Google Slides operations as tools for AI assistants. This enables AI systems to read, modify, and manipulate Google Slides presentations programmatically.
- Installation
- Credential Setup
- Server Startup
- Tool Reference
- Output Formats
- Configuration
- Troubleshooting
Install gslides-api with the MCP extra:
pip install gslides-api[mcp]
# or with poetry
poetry add gslides-api -E mcpSee CREDENTIALS.md for detailed instructions on setting up Google API credentials.
# Using the CLI argument
python -m gslides_api.mcp.server --credential-path /path/to/credentials
# Using environment variable
export GSLIDES_CREDENTIALS_PATH=/path/to/credentials
python -m gslides_api.mcp.server
# With custom default output format
python -m gslides_api.mcp.server --credential-path /path/to/credentials --default-format outline
# Using the installed script
gslides-mcp --credential-path /path/to/credentials| Argument | Description | Default |
|---|---|---|
--credential-path |
Path to Google API credentials directory | GSLIDES_CREDENTIALS_PATH env var |
--default-format |
Default output format: raw, domain, or outline |
raw |
| Variable | Description |
|---|---|
GSLIDES_CREDENTIALS_PATH |
Alternative to --credential-path (CLI arg takes precedence) |
Add to your .mcp.json configuration:
{
"gslides": {
"type": "stdio",
"command": "python",
"args": ["-m", "gslides_api.mcp.server"]
}
}The server reads credentials from the GSLIDES_CREDENTIALS_PATH environment variable. Use --credential-path to override:
{
"gslides": {
"type": "stdio",
"command": "python",
"args": ["-m", "gslides_api.mcp.server", "--credential-path", "/path/to/credentials"]
}
}Get a full presentation by URL or deck ID.
Arguments:
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
presentation_id_or_url |
string | Yes | - | Google Slides URL or presentation ID |
how |
string | No | Server default | Output format: raw, domain, or outline |
Example:
{
"presentation_id_or_url": "https://docs.google.com/presentation/d/1abc123/edit",
"how": "outline"
}Get a single slide by name (first line of speaker notes).
Arguments:
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
presentation_id_or_url |
string | Yes | - | Google Slides URL or presentation ID |
slide_name |
string | Yes | - | Slide name (first line of speaker notes) |
how |
string | No | Server default | Output format: raw, domain, or outline |
Example:
{
"presentation_id_or_url": "1abc123",
"slide_name": "Introduction",
"how": "domain"
}Get a single element by slide name and element name (alt-title).
Arguments:
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
presentation_id_or_url |
string | Yes | - | Google Slides URL or presentation ID |
slide_name |
string | Yes | - | Slide name |
element_name |
string | Yes | - | Element name (from alt-text title) |
how |
string | No | Server default | Output format |
Get a slide thumbnail image, optionally with black borders around text boxes.
Arguments:
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
presentation_id_or_url |
string | Yes | - | Google Slides URL or presentation ID |
slide_name |
string | Yes | - | Slide name |
add_text_box_borders |
boolean | No | false |
Add 1pt black outlines to text boxes |
size |
string | No | LARGE |
Thumbnail size: SMALL (200px), MEDIUM (800px), LARGE (1600px) |
Returns: JSON with base64-encoded PNG image data.
Example Response:
{
"success": true,
"slide_name": "Introduction",
"slide_id": "p1",
"width": 1600,
"height": 900,
"mime_type": "image/png",
"image_base64": "iVBORw0KGgo..."
}Read the text content of a shape element as markdown.
Arguments:
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
presentation_id_or_url |
string | Yes | - | Google Slides URL or presentation ID |
slide_name |
string | Yes | - | Slide name |
element_name |
string | Yes | - | Element name (text box alt-title) |
Returns: Markdown content preserving bold, italic, bullets, etc.
Write markdown content to a shape element (text box).
Arguments:
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
presentation_id_or_url |
string | Yes | - | Google Slides URL or presentation ID |
slide_name |
string | Yes | - | Slide name |
element_name |
string | Yes | - | Element name (text box alt-title) |
markdown |
string | Yes | - | Markdown content to write |
Replace an image element with a new image from URL.
Arguments:
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
presentation_id_or_url |
string | Yes | - | Google Slides URL or presentation ID |
slide_name |
string | Yes | - | Slide name |
element_name |
string | Yes | - | Element name (image alt-title) |
image_url |
string | Yes | - | URL of new image |
Duplicate a slide within the presentation.
Arguments:
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
presentation_id_or_url |
string | Yes | - | Google Slides URL or presentation ID |
slide_name |
string | Yes | - | Slide name to copy |
insertion_index |
integer | No | After original | Position for new slide (0-indexed) |
Returns: New slide info including new_slide_id.
Move a slide to a new position in the presentation.
Arguments:
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
presentation_id_or_url |
string | Yes | - | Google Slides URL or presentation ID |
slide_name |
string | Yes | - | Slide name to move |
insertion_index |
integer | Yes | - | New position (0-indexed) |
Delete a slide from the presentation.
Arguments:
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
presentation_id_or_url |
string | Yes | - | Google Slides URL or presentation ID |
slide_name |
string | Yes | - | Slide name to delete |
The how parameter controls the output format for query tools:
Returns the raw JSON response from the Google Slides API. Most verbose, includes all API fields.
{
"presentationId": "1abc123",
"title": "My Presentation",
"slides": [...],
"masters": [...],
"layouts": [...]
}Returns the gslides-api domain object serialized via model_dump(). Structured Pydantic models with Python-friendly field names.
{
"presentationId": "1abc123",
"title": "My Presentation",
"slides": [...],
"pageSize": {"width": {...}, "height": {...}}
}Returns a condensed structure optimized for AI consumption. Includes slide names, element names, alt-descriptions, and text content as markdown.
{
"presentation_id": "1abc123",
"title": "My Presentation",
"slides": [
{
"slide_name": "Introduction",
"slide_id": "p1",
"elements": [
{
"element_name": "Title",
"element_id": "e1",
"type": "shape",
"alt_description": "Main title",
"content_markdown": "# Welcome to the Presentation"
},
{
"element_name": "Hero Image",
"element_id": "e2",
"type": "image",
"alt_description": "Company logo"
}
]
}
]
}Slide names are derived from the first line of the speaker notes, stripped of whitespace. If a slide has no speaker notes or the first line is empty, it cannot be referenced by name (use the outline format to discover slide IDs).
Element names come from the alt-text title of each element. In Google Slides:
- Right-click an element
- Select "Alt text"
- Enter a name in the "Title" field
Elements without alt-text titles cannot be referenced by name.
All tools return detailed error responses when failures occur:
{
"error": true,
"error_type": "SlideNotFound",
"message": "No slide found with name 'Introduction'",
"details": {
"presentation_id": "1abc123",
"searched_slide_name": "Introduction",
"available_slides": ["Cover", "Overview", "Conclusion"]
}
}| Error Type | Description |
|---|---|
ValidationError |
Invalid input parameter |
SlideNotFound |
Specified slide name not found |
ElementNotFound |
Specified element name not found on slide |
PresentationError:* |
Google API error (includes specific exception type) |
Ensure you've provided a valid credential path via --credential-path or the GSLIDES_CREDENTIALS_PATH environment variable.
Delete token.json in your credentials directory and re-authenticate.
The server implements exponential backoff for rate limits. If you continue to see errors, reduce the frequency of API calls.
- Use
get_presentationwithhow=outlineto see all available slide and element names - Ensure slides have speaker notes with content on the first line
- Ensure elements have alt-text titles set
Ensure you've installed the MCP extra:
pip install gslides-api[mcp]