@a1-x-tech/mcp-google-slides 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +308 -0
- package/README.ru.md +308 -0
- package/dist/client.js +1032 -0
- package/dist/config.js +87 -0
- package/dist/index.js +131 -0
- package/dist/telemetry.js +120 -0
- package/dist/tools/comments.js +39 -0
- package/dist/tools/elements.js +164 -0
- package/dist/tools/export.js +54 -0
- package/dist/tools/notes.js +37 -0
- package/dist/tools/presentations.js +87 -0
- package/dist/tools/raw.js +30 -0
- package/dist/tools/slides.js +117 -0
- package/dist/tools/tables.js +87 -0
- package/dist/tools/text.js +129 -0
- package/dist/tools/util.js +73 -0
- package/dist/types.js +47 -0
- package/package.json +62 -0
- package/test/dist-smoke.test.js +189 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 A1 x Tech
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
# <img src="./assets/a1-logo.svg" alt="A1" width="40"> Google Slides MCP
|
|
2
|
+
|
|
3
|
+
**English** | [Русский](./README.ru.md)
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@a1-x-tech/mcp-google-slides)
|
|
6
|
+
[](https://github.com/A1-x-Tech/mcp-google-slides/actions/workflows/ci.yml)
|
|
7
|
+
[](https://glama.ai/mcp/servers/A1-x-Tech/mcp-google-slides)
|
|
8
|
+
[](./LICENSE)
|
|
9
|
+
|
|
10
|
+
**A1 Google Slides MCP** lets an AI app build and edit Google Slides presentations in plain language. Draft a deck, add and rearrange slides, write and style text, place shapes, images and tables, keep speaker notes, review comments and export the result as PDF or PPTX.
|
|
11
|
+
|
|
12
|
+
It uses the Google Slides API with your Google account. Everything inside a deck is addressed by explicit object ids, and it makes the limits of the Slides API explicit instead of implying that every presentation task is possible.
|
|
13
|
+
|
|
14
|
+
- **26 tools.** Inspect decks and pages, edit slides, text, shapes, images and tables, manage speaker notes and comments, render thumbnails and export files.
|
|
15
|
+
- **Edits are atomic.** Changes ride the API's `batchUpdate`: one invalid request voids the whole batch, so a deck is never left half-edited.
|
|
16
|
+
- **Your Drive stays out of reach.** Comments, export and local-image upload use the Drive API strictly for the one presentation file — there are no tools to list, share, rename or delete Drive files.
|
|
17
|
+
- **Minimal Google scopes.** It needs `presentations`; Drive scopes are required only for local images, comments and export.
|
|
18
|
+
|
|
19
|
+
Start with a read-only question:
|
|
20
|
+
|
|
21
|
+
> Show me the slides in the quarterly report deck and what's on each of them.
|
|
22
|
+
|
|
23
|
+
[Connect the server](#quick-start) · [Explore use cases](#what-you-can-ask-it-to-do) · [Open technical documentation](#technical-documentation)
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## See it work in a minute
|
|
28
|
+
|
|
29
|
+
> **You:** List the slides of the Q3 review deck and what's on each one.
|
|
30
|
+
>
|
|
31
|
+
> **Assistant:** Shows a compact inventory: every slide's position, layout and elements with their visible text. Nothing changes.
|
|
32
|
+
>
|
|
33
|
+
> **You:** Prepare a new slide after the agenda titled “Roadmap”, with the key dates in the body.
|
|
34
|
+
>
|
|
35
|
+
> **Assistant:** Shows the target deck, the layout and the proposed text, then asks for confirmation before adding it.
|
|
36
|
+
>
|
|
37
|
+
> **You:** Confirm.
|
|
38
|
+
>
|
|
39
|
+
> **Assistant:** Adds the slide and fills its placeholders. It does not touch the other slides.
|
|
40
|
+
|
|
41
|
+
## Contents
|
|
42
|
+
|
|
43
|
+
- [Quick start](#quick-start)
|
|
44
|
+
- [What you can ask it to do](#what-you-can-ask-it-to-do)
|
|
45
|
+
- [How a presentation changes](#how-a-presentation-changes)
|
|
46
|
+
- [What can change](#what-can-change)
|
|
47
|
+
- [Getting access](#getting-access)
|
|
48
|
+
- [Configuration](#configuration)
|
|
49
|
+
- [Data, limits and background work](#data-limits-and-background-work)
|
|
50
|
+
- [Technical documentation](#technical-documentation)
|
|
51
|
+
- [Support](#support)
|
|
52
|
+
|
|
53
|
+
## Quick start
|
|
54
|
+
|
|
55
|
+
You need Node.js 20+, a Google account and OAuth credentials from a Google Cloud project with the Google Slides API enabled.
|
|
56
|
+
|
|
57
|
+
1. [Prepare Google OAuth access](#getting-access).
|
|
58
|
+
2. Add the server to your AI app.
|
|
59
|
+
3. Ask the read-only question above.
|
|
60
|
+
|
|
61
|
+
<details open>
|
|
62
|
+
<summary><strong>Codex</strong></summary>
|
|
63
|
+
|
|
64
|
+
<br>
|
|
65
|
+
|
|
66
|
+
**In the app:** open **Settings → Plugins → MCP servers**, select **Add server**, then add `npx -y @a1-x-tech/mcp-google-slides@latest` with `GOOGLE_SLIDES_CLIENT_ID`, `GOOGLE_SLIDES_CLIENT_SECRET` and `GOOGLE_SLIDES_REFRESH_TOKEN`.
|
|
67
|
+
|
|
68
|
+
**From the command line:**
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
codex mcp add google-slides \
|
|
72
|
+
--env GOOGLE_SLIDES_CLIENT_ID=your_client_id \
|
|
73
|
+
--env GOOGLE_SLIDES_CLIENT_SECRET=your_client_secret \
|
|
74
|
+
--env GOOGLE_SLIDES_REFRESH_TOKEN=your_refresh_token \
|
|
75
|
+
-- npx -y @a1-x-tech/mcp-google-slides@latest
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
codex mcp list
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
[Codex MCP documentation](https://learn.chatgpt.com/docs/extend/mcp?surface=cli)
|
|
83
|
+
|
|
84
|
+
</details>
|
|
85
|
+
|
|
86
|
+
<details>
|
|
87
|
+
<summary><strong>Claude Code</strong></summary>
|
|
88
|
+
|
|
89
|
+
<br>
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
claude mcp add \
|
|
93
|
+
--env GOOGLE_SLIDES_CLIENT_ID=your_client_id \
|
|
94
|
+
--env GOOGLE_SLIDES_CLIENT_SECRET=your_client_secret \
|
|
95
|
+
--env GOOGLE_SLIDES_REFRESH_TOKEN=your_refresh_token \
|
|
96
|
+
--transport stdio --scope user google-slides \
|
|
97
|
+
-- npx -y @a1-x-tech/mcp-google-slides@latest
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
claude mcp list
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
[Claude Code MCP documentation](https://code.claude.com/docs/en/mcp)
|
|
105
|
+
|
|
106
|
+
</details>
|
|
107
|
+
|
|
108
|
+
<details>
|
|
109
|
+
<summary><strong>Claude Desktop</strong></summary>
|
|
110
|
+
|
|
111
|
+
<br>
|
|
112
|
+
|
|
113
|
+
Open **Settings → Developer → Edit Config** and add:
|
|
114
|
+
|
|
115
|
+
```json
|
|
116
|
+
{
|
|
117
|
+
"mcpServers": {
|
|
118
|
+
"google-slides": {
|
|
119
|
+
"command": "npx",
|
|
120
|
+
"args": ["-y", "@a1-x-tech/mcp-google-slides@latest"],
|
|
121
|
+
"env": {
|
|
122
|
+
"GOOGLE_SLIDES_CLIENT_ID": "your_client_id",
|
|
123
|
+
"GOOGLE_SLIDES_CLIENT_SECRET": "your_client_secret",
|
|
124
|
+
"GOOGLE_SLIDES_REFRESH_TOKEN": "your_refresh_token"
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
If **Edit Config** is unavailable, edit `~/Library/Application Support/Claude/claude_desktop_config.json` on macOS or `%APPDATA%\Claude\claude_desktop_config.json` on Windows.
|
|
132
|
+
|
|
133
|
+
[Claude Desktop MCP documentation](https://support.claude.com/en/articles/10949351-getting-started-with-local-mcp-servers-on-claude-desktop)
|
|
134
|
+
|
|
135
|
+
</details>
|
|
136
|
+
|
|
137
|
+
<details>
|
|
138
|
+
<summary><strong>Cursor</strong></summary>
|
|
139
|
+
|
|
140
|
+
<br>
|
|
141
|
+
|
|
142
|
+
Add this to `~/.cursor/mcp.json` on macOS/Linux or `%USERPROFILE%\.cursor\mcp.json` on Windows:
|
|
143
|
+
|
|
144
|
+
```json
|
|
145
|
+
{
|
|
146
|
+
"mcpServers": {
|
|
147
|
+
"google-slides": {
|
|
148
|
+
"type": "stdio",
|
|
149
|
+
"command": "npx",
|
|
150
|
+
"args": ["-y", "@a1-x-tech/mcp-google-slides@latest"],
|
|
151
|
+
"env": {
|
|
152
|
+
"GOOGLE_SLIDES_CLIENT_ID": "your_client_id",
|
|
153
|
+
"GOOGLE_SLIDES_CLIENT_SECRET": "your_client_secret",
|
|
154
|
+
"GOOGLE_SLIDES_REFRESH_TOKEN": "your_refresh_token"
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
[Cursor MCP documentation](https://cursor.com/docs/mcp)
|
|
162
|
+
|
|
163
|
+
</details>
|
|
164
|
+
|
|
165
|
+
<details>
|
|
166
|
+
<summary><strong>VS Code</strong></summary>
|
|
167
|
+
|
|
168
|
+
<br>
|
|
169
|
+
|
|
170
|
+
Run **MCP: Open User Configuration** and add:
|
|
171
|
+
|
|
172
|
+
```json
|
|
173
|
+
{
|
|
174
|
+
"servers": {
|
|
175
|
+
"google-slides": {
|
|
176
|
+
"type": "stdio",
|
|
177
|
+
"command": "npx",
|
|
178
|
+
"args": ["-y", "@a1-x-tech/mcp-google-slides@latest"],
|
|
179
|
+
"env": {
|
|
180
|
+
"GOOGLE_SLIDES_CLIENT_ID": "${input:slides_client_id}",
|
|
181
|
+
"GOOGLE_SLIDES_CLIENT_SECRET": "${input:slides_client_secret}",
|
|
182
|
+
"GOOGLE_SLIDES_REFRESH_TOKEN": "${input:slides_refresh_token}"
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
"inputs": [
|
|
187
|
+
{ "type": "promptString", "id": "slides_client_id", "description": "Google OAuth client ID" },
|
|
188
|
+
{ "type": "promptString", "id": "slides_client_secret", "description": "Google OAuth client secret", "password": true },
|
|
189
|
+
{ "type": "promptString", "id": "slides_refresh_token", "description": "Google OAuth refresh token", "password": true }
|
|
190
|
+
]
|
|
191
|
+
}
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Check it with **MCP: List Servers**.
|
|
195
|
+
|
|
196
|
+
[VS Code MCP documentation](https://code.visualstudio.com/docs/agent-customization/mcp-servers)
|
|
197
|
+
|
|
198
|
+
</details>
|
|
199
|
+
|
|
200
|
+
## What you can ask it to do
|
|
201
|
+
|
|
202
|
+
### Inspect a deck
|
|
203
|
+
|
|
204
|
+
- List the slides of this presentation and what's on each one.
|
|
205
|
+
- Read the speaker notes for slide 5.
|
|
206
|
+
- Render a thumbnail of the title slide.
|
|
207
|
+
|
|
208
|
+
### Build and rearrange slides
|
|
209
|
+
|
|
210
|
+
- Create a presentation for the Q3 review.
|
|
211
|
+
- Add a “Roadmap” slide after the agenda, duplicate the template slide, move the summary to the end.
|
|
212
|
+
- Insert an image from a URL or a local file, add a 4×3 table, create a text box or a rounded rectangle with its caption.
|
|
213
|
+
|
|
214
|
+
### Write and polish text
|
|
215
|
+
|
|
216
|
+
- Put this text into the title placeholder and make the deadline bold and red.
|
|
217
|
+
- Replace “Q2” with “Q3” across the whole deck.
|
|
218
|
+
- Rewrite the speaker notes of slide 3 to be shorter.
|
|
219
|
+
|
|
220
|
+
### Review and hand off
|
|
221
|
+
|
|
222
|
+
- List the open comment threads and reply to the first one, resolving it.
|
|
223
|
+
- Delete the draft slide we no longer need.
|
|
224
|
+
- Export the deck as PDF or PPTX for someone without Google access.
|
|
225
|
+
|
|
226
|
+
## How a presentation changes
|
|
227
|
+
|
|
228
|
+
1. `create_presentation` creates a **deck** with one title slide; only the title is honored at creation.
|
|
229
|
+
2. Everything inside a deck — slides, shapes, images, tables — is addressed by **object ids**. `list_slides` is the compact inventory to start from before any edit.
|
|
230
|
+
3. Edits go through the API's atomic `batchUpdate`: one invalid request voids the whole batch, so nothing is half-applied.
|
|
231
|
+
4. Tool inputs are in points; the API stores EMU (1 pt = 12700 EMU). The server converts both ways.
|
|
232
|
+
|
|
233
|
+
The Slides API cannot delete, rename or share the presentation file — those are Drive file operations outside this server's scope. It cannot import a theme (only instantiate layouts the deck already has) and cannot anchor a new comment to a specific slide. Export is capped at 10 MB, and thumbnail URLs expire after about 30 minutes.
|
|
234
|
+
|
|
235
|
+
## What can change
|
|
236
|
+
|
|
237
|
+
| Operation | What happens | Confirmation boundary |
|
|
238
|
+
|---|---|---|
|
|
239
|
+
| Inspect a deck, page, notes or comments; render a thumbnail; export a file | Reads data, writes only local files | No change |
|
|
240
|
+
| Create a presentation | Adds a new deck to your Google account | Changes Google Slides |
|
|
241
|
+
| Add, duplicate or move slides; create shapes, images, tables | Adds or rearranges deck content | Changes a deck |
|
|
242
|
+
| Set or style text, replace an image, transform an element, edit speaker notes or table structure | Overwrites existing content | Changes a deck |
|
|
243
|
+
| Find & replace across the deck | Changes every match at once | Changes a deck broadly |
|
|
244
|
+
| Delete a slide, element or comment thread | Removes content with no undo through the API | Destructive |
|
|
245
|
+
| Raw `batchUpdate` or raw API request | Can call API methods without a dedicated tool | Potentially destructive |
|
|
246
|
+
|
|
247
|
+
The AI client controls confirmation prompts. The server marks reads, writes and destructive tools so the client can distinguish an inspection from a live change.
|
|
248
|
+
|
|
249
|
+
## Getting access
|
|
250
|
+
|
|
251
|
+
Google Slides requires OAuth 2.0; an API key is not enough.
|
|
252
|
+
|
|
253
|
+
1. Create or select a Google Cloud project and enable **Google Slides API**. Enable **Google Drive API** too if you want comments, export or local-image upload.
|
|
254
|
+
2. Configure the OAuth consent screen and create a **Desktop app** OAuth client.
|
|
255
|
+
3. Authorize the Google account that owns or can edit the presentations. The [OAuth 2.0 Playground](https://developers.google.com/oauthplayground) can obtain the refresh token when **Use your own OAuth credentials** is enabled.
|
|
256
|
+
4. Request the scopes:
|
|
257
|
+
|
|
258
|
+
```text
|
|
259
|
+
https://www.googleapis.com/auth/presentations
|
|
260
|
+
https://www.googleapis.com/auth/drive.file
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
`presentations` covers all Slides reads and writes. `drive.file` covers local-image upload plus comments and export on decks created through this app; request the broader `https://www.googleapis.com/auth/drive` instead when you need comments or export on arbitrary presentations.
|
|
264
|
+
|
|
265
|
+
Testing-mode OAuth refresh tokens can expire after seven days. Publish the OAuth app, or use an Internal app in a Workspace domain, when you need long-lived access. Treat the client secret and refresh token as passwords.
|
|
266
|
+
|
|
267
|
+
## Configuration
|
|
268
|
+
|
|
269
|
+
| Variable | Required | Description |
|
|
270
|
+
|---|---|---|
|
|
271
|
+
| `GOOGLE_SLIDES_CLIENT_ID` | Yes* | OAuth client ID. |
|
|
272
|
+
| `GOOGLE_SLIDES_CLIENT_SECRET` | Yes* | OAuth client secret. |
|
|
273
|
+
| `GOOGLE_SLIDES_REFRESH_TOKEN` | Yes* | OAuth refresh token. |
|
|
274
|
+
| `GOOGLE_SLIDES_ACCESS_TOKEN` | Yes* | Short-lived (~1 h) alternative to the OAuth trio. |
|
|
275
|
+
| `GOOGLE_SLIDES_API_BASE` | No | Google Slides API base URL override. |
|
|
276
|
+
| `GOOGLE_SLIDES_DRIVE_API_BASE` | No | Google Drive API base URL override (internal dependency: comments, export, image upload). |
|
|
277
|
+
| `GOOGLE_SLIDES_TIMEOUT_MS` | No | Per-request timeout; default `60000` ms. |
|
|
278
|
+
| `GOOGLE_SLIDES_MAX_RETRIES` | No | Temporary-error retries; default `3`. |
|
|
279
|
+
|
|
280
|
+
\* Provide either the OAuth trio or an access token.
|
|
281
|
+
|
|
282
|
+
## Data, limits and background work
|
|
283
|
+
|
|
284
|
+
- **Requests go to Google Slides.** The local server refreshes Google OAuth tokens and calls the Slides API; comments, export and local-image upload ride the Drive API, scoped to the one presentation file. Its anonymous telemetry contains an installation ID, package version, AI client and platform versions, and tool names — never OAuth tokens, presentation content, tool arguments or prompts. Set `ASKADS_TELEMETRY=0` to opt out.
|
|
285
|
+
- **Google applies rate limits.** On `429`, the server uses backoff; reads also retry after network and `5xx` errors, while writes are not replayed after an uncertain failure. Thumbnails count against a more expensive read quota.
|
|
286
|
+
- **There is no background polling.** The server runs only when called. Nothing watches a deck between calls; if your AI app supports scheduled tasks, it can check a presentation periodically.
|
|
287
|
+
|
|
288
|
+
## Technical documentation
|
|
289
|
+
|
|
290
|
+
- [MCP capability catalog](./docs/capabilities/index.md) — task-oriented pages for every tool.
|
|
291
|
+
- [All tools and inputs](./docs/TOOLS.md)
|
|
292
|
+
- [Development documentation](./docs/DEVELOPMENT.md)
|
|
293
|
+
- [Publishing documentation](./docs/PUBLISHING.md)
|
|
294
|
+
- [Google Slides API reference](https://developers.google.com/slides/api)
|
|
295
|
+
|
|
296
|
+
## Support
|
|
297
|
+
|
|
298
|
+
Found a bug or need a scenario? [Create an issue](https://github.com/A1-x-Tech/mcp-google-slides/issues) or write in [Telegram](https://t.me/a1_mcp).
|
|
299
|
+
|
|
300
|
+
<br>
|
|
301
|
+
|
|
302
|
+
<p align="center">
|
|
303
|
+
<img src="https://github.com/ztemerbekov/a1-yandex-kit-skills/raw/main/assets/images/mona-hifive-yandex-kit-warm.gif" alt="Две Моны дают пять" width="256">
|
|
304
|
+
</p>
|
|
305
|
+
|
|
306
|
+
<p align="center">
|
|
307
|
+
You made it to the end!
|
|
308
|
+
</p>
|
package/README.ru.md
ADDED
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
# <img src="./assets/a1-logo.svg" alt="A1" width="40"> Google Slides MCP
|
|
2
|
+
|
|
3
|
+
[English](./README.md) | **Русский**
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@a1-x-tech/mcp-google-slides)
|
|
6
|
+
[](https://github.com/A1-x-Tech/mcp-google-slides/actions/workflows/ci.yml)
|
|
7
|
+
[](https://glama.ai/mcp/servers/A1-x-Tech/mcp-google-slides)
|
|
8
|
+
[](./LICENSE)
|
|
9
|
+
|
|
10
|
+
**A1 Google Slides MCP** позволяет AI-приложению создавать и редактировать презентации Google Slides на естественном языке. Можно собрать презентацию, добавить и переставить слайды, написать и оформить текст, разместить фигуры, изображения и таблицы, вести заметки докладчика, разобрать комментарии и выгрузить результат в PDF или PPTX.
|
|
11
|
+
|
|
12
|
+
Сервер работает с Google Slides API через ваш Google-аккаунт. Всё внутри презентации адресуется явными object id, а ограничения Slides API сервер называет прямо, вместо того чтобы делать вид, будто с презентацией возможно всё.
|
|
13
|
+
|
|
14
|
+
- **26 инструментов.** Проверка презентаций и страниц, редактирование слайдов, текста, фигур, изображений и таблиц, заметки докладчика и комментарии, миниатюры и экспорт файлов.
|
|
15
|
+
- **Правки атомарны.** Изменения идут через `batchUpdate` API: один неверный запрос отменяет весь пакет, поэтому презентация не остаётся отредактированной наполовину.
|
|
16
|
+
- **Ваш Drive недосягаем.** Комментарии, экспорт и загрузка локальных изображений используют Drive API строго для одного файла презентации — инструментов, чтобы перечислять, расшаривать, переименовывать или удалять файлы Drive, нет.
|
|
17
|
+
- **Минимальные scope Google.** Нужен `presentations`; scope Drive требуются только для локальных изображений, комментариев и экспорта.
|
|
18
|
+
|
|
19
|
+
Начните с запроса, который только читает данные:
|
|
20
|
+
|
|
21
|
+
> Покажи слайды квартального отчёта и что на каждом из них.
|
|
22
|
+
|
|
23
|
+
[Подключить сервер](#быстрый-старт) · [Посмотреть сценарии](#что-можно-поручить) · [Открыть техническую документацию](#техническая-документация)
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Увидеть работу за минуту
|
|
28
|
+
|
|
29
|
+
> **Вы:** Перечисли слайды презентации с обзором Q3 и что на каждом.
|
|
30
|
+
>
|
|
31
|
+
> **Ассистент:** Показывает компактную опись: позицию каждого слайда, его макет и элементы с видимым текстом. Ничего не меняется.
|
|
32
|
+
>
|
|
33
|
+
> **Вы:** Подготовь новый слайд после повестки с заголовком «Roadmap» и ключевыми датами в теле.
|
|
34
|
+
>
|
|
35
|
+
> **Ассистент:** Показывает целевую презентацию, макет и предлагаемый текст, затем запрашивает подтверждение перед добавлением.
|
|
36
|
+
>
|
|
37
|
+
> **Вы:** Подтверждаю.
|
|
38
|
+
>
|
|
39
|
+
> **Ассистент:** Добавляет слайд и заполняет его плейсхолдеры. Остальные слайды он не трогает.
|
|
40
|
+
|
|
41
|
+
## Содержание
|
|
42
|
+
|
|
43
|
+
- [Быстрый старт](#быстрый-старт)
|
|
44
|
+
- [Что можно поручить](#что-можно-поручить)
|
|
45
|
+
- [Как меняется презентация](#как-меняется-презентация)
|
|
46
|
+
- [Что может измениться](#что-может-измениться)
|
|
47
|
+
- [Как получить доступ](#как-получить-доступ)
|
|
48
|
+
- [Конфигурация](#конфигурация)
|
|
49
|
+
- [Данные, лимиты и работа в фоне](#данные-лимиты-и-работа-в-фоне)
|
|
50
|
+
- [Техническая документация](#техническая-документация)
|
|
51
|
+
- [Поддержка](#поддержка)
|
|
52
|
+
|
|
53
|
+
## Быстрый старт
|
|
54
|
+
|
|
55
|
+
Нужны Node.js 20+, Google-аккаунт и OAuth-данные из проекта Google Cloud с включённым Google Slides API.
|
|
56
|
+
|
|
57
|
+
1. [Подготовьте Google OAuth-доступ](#как-получить-доступ).
|
|
58
|
+
2. Добавьте сервер в AI-приложение.
|
|
59
|
+
3. Отправьте запрос, который только читает данные.
|
|
60
|
+
|
|
61
|
+
<details open>
|
|
62
|
+
<summary><strong>Codex</strong></summary>
|
|
63
|
+
|
|
64
|
+
<br>
|
|
65
|
+
|
|
66
|
+
**В приложении:** откройте **Settings → Plugins → MCP servers**, нажмите **Add server**, затем добавьте `npx -y @a1-x-tech/mcp-google-slides@latest` с `GOOGLE_SLIDES_CLIENT_ID`, `GOOGLE_SLIDES_CLIENT_SECRET` и `GOOGLE_SLIDES_REFRESH_TOKEN`.
|
|
67
|
+
|
|
68
|
+
**В командной строке:**
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
codex mcp add google-slides \
|
|
72
|
+
--env GOOGLE_SLIDES_CLIENT_ID=your_client_id \
|
|
73
|
+
--env GOOGLE_SLIDES_CLIENT_SECRET=your_client_secret \
|
|
74
|
+
--env GOOGLE_SLIDES_REFRESH_TOKEN=your_refresh_token \
|
|
75
|
+
-- npx -y @a1-x-tech/mcp-google-slides@latest
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
codex mcp list
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
[Документация Codex MCP](https://learn.chatgpt.com/docs/extend/mcp?surface=cli)
|
|
83
|
+
|
|
84
|
+
</details>
|
|
85
|
+
|
|
86
|
+
<details>
|
|
87
|
+
<summary><strong>Claude Code</strong></summary>
|
|
88
|
+
|
|
89
|
+
<br>
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
claude mcp add \
|
|
93
|
+
--env GOOGLE_SLIDES_CLIENT_ID=your_client_id \
|
|
94
|
+
--env GOOGLE_SLIDES_CLIENT_SECRET=your_client_secret \
|
|
95
|
+
--env GOOGLE_SLIDES_REFRESH_TOKEN=your_refresh_token \
|
|
96
|
+
--transport stdio --scope user google-slides \
|
|
97
|
+
-- npx -y @a1-x-tech/mcp-google-slides@latest
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
claude mcp list
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
[Документация Claude Code MCP](https://code.claude.com/docs/en/mcp)
|
|
105
|
+
|
|
106
|
+
</details>
|
|
107
|
+
|
|
108
|
+
<details>
|
|
109
|
+
<summary><strong>Claude Desktop</strong></summary>
|
|
110
|
+
|
|
111
|
+
<br>
|
|
112
|
+
|
|
113
|
+
Откройте **Settings → Developer → Edit Config** и добавьте:
|
|
114
|
+
|
|
115
|
+
```json
|
|
116
|
+
{
|
|
117
|
+
"mcpServers": {
|
|
118
|
+
"google-slides": {
|
|
119
|
+
"command": "npx",
|
|
120
|
+
"args": ["-y", "@a1-x-tech/mcp-google-slides@latest"],
|
|
121
|
+
"env": {
|
|
122
|
+
"GOOGLE_SLIDES_CLIENT_ID": "your_client_id",
|
|
123
|
+
"GOOGLE_SLIDES_CLIENT_SECRET": "your_client_secret",
|
|
124
|
+
"GOOGLE_SLIDES_REFRESH_TOKEN": "your_refresh_token"
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Если **Edit Config** недоступна, отредактируйте `~/Library/Application Support/Claude/claude_desktop_config.json` на macOS или `%APPDATA%\Claude\claude_desktop_config.json` на Windows.
|
|
132
|
+
|
|
133
|
+
[Документация Claude Desktop MCP](https://support.claude.com/en/articles/10949351-getting-started-with-local-mcp-servers-on-claude-desktop)
|
|
134
|
+
|
|
135
|
+
</details>
|
|
136
|
+
|
|
137
|
+
<details>
|
|
138
|
+
<summary><strong>Cursor</strong></summary>
|
|
139
|
+
|
|
140
|
+
<br>
|
|
141
|
+
|
|
142
|
+
Добавьте в `~/.cursor/mcp.json` на macOS/Linux или `%USERPROFILE%\.cursor\mcp.json` на Windows:
|
|
143
|
+
|
|
144
|
+
```json
|
|
145
|
+
{
|
|
146
|
+
"mcpServers": {
|
|
147
|
+
"google-slides": {
|
|
148
|
+
"type": "stdio",
|
|
149
|
+
"command": "npx",
|
|
150
|
+
"args": ["-y", "@a1-x-tech/mcp-google-slides@latest"],
|
|
151
|
+
"env": {
|
|
152
|
+
"GOOGLE_SLIDES_CLIENT_ID": "your_client_id",
|
|
153
|
+
"GOOGLE_SLIDES_CLIENT_SECRET": "your_client_secret",
|
|
154
|
+
"GOOGLE_SLIDES_REFRESH_TOKEN": "your_refresh_token"
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
[Документация Cursor MCP](https://cursor.com/docs/mcp)
|
|
162
|
+
|
|
163
|
+
</details>
|
|
164
|
+
|
|
165
|
+
<details>
|
|
166
|
+
<summary><strong>VS Code</strong></summary>
|
|
167
|
+
|
|
168
|
+
<br>
|
|
169
|
+
|
|
170
|
+
Запустите **MCP: Open User Configuration** и добавьте:
|
|
171
|
+
|
|
172
|
+
```json
|
|
173
|
+
{
|
|
174
|
+
"servers": {
|
|
175
|
+
"google-slides": {
|
|
176
|
+
"type": "stdio",
|
|
177
|
+
"command": "npx",
|
|
178
|
+
"args": ["-y", "@a1-x-tech/mcp-google-slides@latest"],
|
|
179
|
+
"env": {
|
|
180
|
+
"GOOGLE_SLIDES_CLIENT_ID": "${input:slides_client_id}",
|
|
181
|
+
"GOOGLE_SLIDES_CLIENT_SECRET": "${input:slides_client_secret}",
|
|
182
|
+
"GOOGLE_SLIDES_REFRESH_TOKEN": "${input:slides_refresh_token}"
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
"inputs": [
|
|
187
|
+
{ "type": "promptString", "id": "slides_client_id", "description": "Google OAuth client ID" },
|
|
188
|
+
{ "type": "promptString", "id": "slides_client_secret", "description": "Google OAuth client secret", "password": true },
|
|
189
|
+
{ "type": "promptString", "id": "slides_refresh_token", "description": "Google OAuth refresh token", "password": true }
|
|
190
|
+
]
|
|
191
|
+
}
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Проверьте сервер командой **MCP: List Servers**.
|
|
195
|
+
|
|
196
|
+
[Документация VS Code MCP](https://code.visualstudio.com/docs/agent-customization/mcp-servers)
|
|
197
|
+
|
|
198
|
+
</details>
|
|
199
|
+
|
|
200
|
+
## Что можно поручить
|
|
201
|
+
|
|
202
|
+
### Проверить презентацию
|
|
203
|
+
|
|
204
|
+
- Перечисли слайды этой презентации и что на каждом.
|
|
205
|
+
- Прочитай заметки докладчика к пятому слайду.
|
|
206
|
+
- Отрисуй миниатюру титульного слайда.
|
|
207
|
+
|
|
208
|
+
### Собрать и переставить слайды
|
|
209
|
+
|
|
210
|
+
- Создай презентацию для обзора Q3.
|
|
211
|
+
- Добавь слайд «Roadmap» после повестки, продублируй слайд-шаблон, перенеси итоги в конец.
|
|
212
|
+
- Вставь изображение по URL или из локального файла, добавь таблицу 4×3, создай текстовый блок или скруглённый прямоугольник с подписью.
|
|
213
|
+
|
|
214
|
+
### Написать и отшлифовать текст
|
|
215
|
+
|
|
216
|
+
- Помести этот текст в плейсхолдер заголовка и выдели дедлайн жирным красным.
|
|
217
|
+
- Замени «Q2» на «Q3» по всей презентации.
|
|
218
|
+
- Сократи заметки докладчика к третьему слайду.
|
|
219
|
+
|
|
220
|
+
### Разобрать и передать дальше
|
|
221
|
+
|
|
222
|
+
- Перечисли открытые ветки комментариев и ответь на первую, закрыв её как решённую.
|
|
223
|
+
- Удали черновой слайд, который больше не нужен.
|
|
224
|
+
- Выгрузи презентацию в PDF или PPTX для того, у кого нет доступа к Google.
|
|
225
|
+
|
|
226
|
+
## Как меняется презентация
|
|
227
|
+
|
|
228
|
+
1. `create_presentation` создаёт **презентацию** с одним титульным слайдом; при создании учитывается только название.
|
|
229
|
+
2. Всё внутри презентации — слайды, фигуры, изображения, таблицы — адресуется **object id**. `list_slides` — компактная опись, с которой стоит начинать перед любой правкой.
|
|
230
|
+
3. Правки идут через атомарный `batchUpdate` API: один неверный запрос отменяет весь пакет, поэтому ничего не применяется наполовину.
|
|
231
|
+
4. Входные значения инструментов — в пунктах; API хранит EMU (1 pt = 12700 EMU). Сервер конвертирует в обе стороны.
|
|
232
|
+
|
|
233
|
+
Slides API не может удалить, переименовать или расшарить файл презентации — это файловые операции Drive за пределами этого сервера. Он не может импортировать тему (только применять макеты, которые уже есть в презентации) и не может привязать новый комментарий к конкретному слайду. Экспорт ограничен 10 МБ, а ссылки на миниатюры истекают примерно через 30 минут.
|
|
234
|
+
|
|
235
|
+
## Что может измениться
|
|
236
|
+
|
|
237
|
+
| Операция | Что происходит | Граница подтверждения |
|
|
238
|
+
|---|---|---|
|
|
239
|
+
| Проверка презентации, страницы, заметок или комментариев; миниатюра; экспорт файла | Читает данные, пишет только локальные файлы | Ничего не меняет |
|
|
240
|
+
| Создание презентации | Добавляет новую презентацию в ваш Google-аккаунт | Меняет Google Slides |
|
|
241
|
+
| Добавление, дублирование или перемещение слайдов; создание фигур, изображений, таблиц | Добавляет или переставляет содержимое презентации | Меняет презентацию |
|
|
242
|
+
| Установка или оформление текста, замена изображения, трансформация элемента, правка заметок докладчика или структуры таблицы | Перезаписывает существующее содержимое | Меняет презентацию |
|
|
243
|
+
| Поиск и замена по всей презентации | Меняет все совпадения разом | Меняет презентацию целиком |
|
|
244
|
+
| Удаление слайда, элемента или ветки комментариев | Удаляет содержимое без отмены через API | Разрушительно |
|
|
245
|
+
| Технический `batchUpdate` или технический запрос API | Может вызвать метод API без отдельного инструмента | Потенциально разрушительно |
|
|
246
|
+
|
|
247
|
+
Как AI-приложение просит подтверждение, определяет само приложение. Сервер помечает операции чтения, записи и удаления, чтобы оно отличило проверку от рабочего изменения.
|
|
248
|
+
|
|
249
|
+
## Как получить доступ
|
|
250
|
+
|
|
251
|
+
Google Slides требует OAuth 2.0: одного API-ключа недостаточно.
|
|
252
|
+
|
|
253
|
+
1. Создайте или выберите проект Google Cloud и включите **Google Slides API**. Также включите **Google Drive API**, если нужны комментарии, экспорт или загрузка локальных изображений.
|
|
254
|
+
2. Настройте OAuth consent screen и создайте OAuth-клиент типа **Desktop app**.
|
|
255
|
+
3. Авторизуйте Google-аккаунт, который владеет презентациями или может их редактировать. [OAuth 2.0 Playground](https://developers.google.com/oauthplayground) поможет получить refresh token, если включить **Use your own OAuth credentials**.
|
|
256
|
+
4. Запросите scope:
|
|
257
|
+
|
|
258
|
+
```text
|
|
259
|
+
https://www.googleapis.com/auth/presentations
|
|
260
|
+
https://www.googleapis.com/auth/drive.file
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
`presentations` покрывает все чтения и записи Slides. `drive.file` покрывает загрузку локальных изображений, а также комментарии и экспорт для презентаций, созданных через это приложение; запросите более широкий `https://www.googleapis.com/auth/drive`, если комментарии или экспорт нужны для произвольных презентаций.
|
|
264
|
+
|
|
265
|
+
Refresh token OAuth-приложения в режиме Testing может истечь через семь дней. Для долгого доступа опубликуйте OAuth-приложение или используйте Internal-приложение в домене Workspace. Храните client secret и refresh token как пароли.
|
|
266
|
+
|
|
267
|
+
## Конфигурация
|
|
268
|
+
|
|
269
|
+
| Переменная | Обязательна | Описание |
|
|
270
|
+
|---|---|---|
|
|
271
|
+
| `GOOGLE_SLIDES_CLIENT_ID` | Да* | OAuth client ID. |
|
|
272
|
+
| `GOOGLE_SLIDES_CLIENT_SECRET` | Да* | OAuth client secret. |
|
|
273
|
+
| `GOOGLE_SLIDES_REFRESH_TOKEN` | Да* | OAuth refresh token. |
|
|
274
|
+
| `GOOGLE_SLIDES_ACCESS_TOKEN` | Да* | Короткоживущая (~1 ч) альтернатива OAuth-тройке. |
|
|
275
|
+
| `GOOGLE_SLIDES_API_BASE` | Нет | Переопределяет базовый URL Google Slides API. |
|
|
276
|
+
| `GOOGLE_SLIDES_DRIVE_API_BASE` | Нет | Переопределяет базовый URL Google Drive API (внутренняя зависимость: комментарии, экспорт, загрузка изображений). |
|
|
277
|
+
| `GOOGLE_SLIDES_TIMEOUT_MS` | Нет | Тайм-аут одного запроса; по умолчанию `60000` мс. |
|
|
278
|
+
| `GOOGLE_SLIDES_MAX_RETRIES` | Нет | Повторы временных ошибок; по умолчанию `3`. |
|
|
279
|
+
|
|
280
|
+
\* Передайте OAuth-тройку или access token.
|
|
281
|
+
|
|
282
|
+
## Данные, лимиты и работа в фоне
|
|
283
|
+
|
|
284
|
+
- **Запросы идут в Google Slides.** Локальный сервер обновляет OAuth-токены Google и вызывает Slides API; комментарии, экспорт и загрузка локальных изображений проходят через Drive API строго для одного файла презентации. Анонимная телеметрия содержит ID установки, версию пакета, версии AI-клиента и платформы и имена инструментов — но не OAuth-токены, содержимое презентаций, аргументы или промпты. Чтобы отключить её, задайте `ASKADS_TELEMETRY=0`.
|
|
285
|
+
- **У Google есть лимиты частоты.** При `429` сервер использует задержку; чтение также повторяется после сетевых и `5xx` ошибок, а запись после неопределённой ошибки не повторяется. Миниатюры расходуют более дорогую квоту чтения.
|
|
286
|
+
- **Постоянного опроса нет.** Сервер работает только при вызове. Между вызовами за презентацией никто не следит; если AI-приложение поддерживает задания по расписанию, оно может периодически её проверять.
|
|
287
|
+
|
|
288
|
+
## Техническая документация
|
|
289
|
+
|
|
290
|
+
- [Каталог MCP-возможностей](./docs/capabilities/index.md) — страницы по пользовательским задачам для каждого инструмента.
|
|
291
|
+
- [Все инструменты и параметры](./docs/TOOLS.md)
|
|
292
|
+
- [Документация по разработке](./docs/DEVELOPMENT.md)
|
|
293
|
+
- [Документация по публикации](./docs/PUBLISHING.md)
|
|
294
|
+
- [Справочник Google Slides API](https://developers.google.com/slides/api)
|
|
295
|
+
|
|
296
|
+
## Поддержка
|
|
297
|
+
|
|
298
|
+
Нашли ошибку или не хватает сценария? [Создайте issue](https://github.com/A1-x-Tech/mcp-google-slides/issues) или напишите в [Telegram](https://t.me/a1_mcp).
|
|
299
|
+
|
|
300
|
+
<br>
|
|
301
|
+
|
|
302
|
+
<p align="center">
|
|
303
|
+
<img src="https://github.com/ztemerbekov/a1-yandex-kit-skills/raw/main/assets/images/mona-hifive-yandex-kit-warm.gif" alt="Две Моны дают пять" width="256">
|
|
304
|
+
</p>
|
|
305
|
+
|
|
306
|
+
<p align="center">
|
|
307
|
+
Вы дочитали до конца!
|
|
308
|
+
</p>
|