@jieunmarslim/server-editable-slides 0.2.5 → 0.2.6

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.
Files changed (2) hide show
  1. package/index.js +22 -7
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -155,7 +155,8 @@ async function runDoctor() {
155
155
  console.error(` ✓ Active: Google Drive access granted.`);
156
156
  console.error(` ✓ Presentations will automatically convert into live Google Slides.`);
157
157
  } else {
158
- console.error(` ⚠️ Scope Missing: Token lacks Google Drive access.`);
158
+ hasError = true;
159
+ console.error(` ✗ FAILED: Token lacks Google Drive access.`);
159
160
  console.error(` 👉 To enable automatic Google Slides creation in your Drive, run:`);
160
161
  console.error(` gcloud auth login --enable-gdrive-access`);
161
162
  }
@@ -305,7 +306,10 @@ if (
305
306
  ) {
306
307
  runDoctor();
307
308
  } else {
308
- startMcpServer();
309
+ startMcpServer().catch((err) => {
310
+ console.error('[EditNBLM] Fatal error:', err);
311
+ process.exit(1);
312
+ });
309
313
  }
310
314
 
311
315
  async function callRemoteMcp(method, params, apiKey) {
@@ -424,14 +428,25 @@ async function downloadPptxHelper(downloadUrl, targetPath) {
424
428
  return null;
425
429
  }
426
430
 
427
- function assertEnvironmentOrExit() {
431
+ async function assertEnvironmentOrExit() {
428
432
  const account = getAccount();
429
433
  const token = getAuthToken();
430
434
  const project = getProject();
431
435
 
432
436
  if (!account || !token) {
433
437
  console.error('\n[EditNBLM] ❌ Activation Failed: Google Cloud authentication required.');
434
- console.error('[EditNBLM] Please run `gcloud auth login` before activating this MCP server.');
438
+ console.error('[EditNBLM] Please run `gcloud auth login --enable-gdrive-access` before activating this MCP server.');
439
+ console.error('[EditNBLM] Run `npx -y @jieunmarslim/server-editable-slides doctor` to diagnose.\n');
440
+ process.exit(1);
441
+ }
442
+
443
+ // Verify Google Drive scope
444
+ const hasDrive = await checkDriveScope(token);
445
+ if (!hasDrive) {
446
+ console.error(`\n[EditNBLM] ❌ Activation Failed: Account [${account}] lacks Google Drive access.`);
447
+ console.error('[EditNBLM] EditNBLM MCP requires Google Drive scope to automatically convert presentations into live Google Slides.');
448
+ console.error('[EditNBLM] 👉 Please run in your terminal:');
449
+ console.error('[EditNBLM] gcloud auth login --enable-gdrive-access\n');
435
450
  console.error('[EditNBLM] Run `npx -y @jieunmarslim/server-editable-slides doctor` to diagnose.\n');
436
451
  process.exit(1);
437
452
  }
@@ -461,7 +476,7 @@ function assertEnvironmentOrExit() {
461
476
  stderr.includes('does not have permission') ||
462
477
  stderr.includes('caller does not have permission')
463
478
  ) {
464
- console.error(`[EditNBLM] 👉 Solution 1: Log in with an account that has access: gcloud auth login`);
479
+ console.error(`[EditNBLM] 👉 Solution 1: Log in with an account that has access: gcloud auth login --enable-gdrive-access`);
465
480
  console.error(`[EditNBLM] 👉 Solution 2: Switch to a project that [${account}] can access: gcloud config set project <PROJECT>`);
466
481
  } else if (stderr.includes('not found') || stderr.includes('404')) {
467
482
  console.error(`[EditNBLM] 👉 Project [${project}] does not exist. Run: gcloud config set project <VALID_PROJECT_ID>`);
@@ -473,8 +488,8 @@ function assertEnvironmentOrExit() {
473
488
  }
474
489
  }
475
490
 
476
- function startMcpServer() {
477
- assertEnvironmentOrExit();
491
+ async function startMcpServer() {
492
+ await assertEnvironmentOrExit();
478
493
 
479
494
  const server = new McpServer({
480
495
  name: 'editable-slides',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jieunmarslim/server-editable-slides",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "Model Context Protocol (MCP) client for Editable Slides Cloud",
5
5
  "type": "module",
6
6
  "bin": {