@jieunmarslim/server-editable-slides 0.2.2 → 0.2.4

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 +53 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -116,9 +116,9 @@ async function runDoctor() {
116
116
  ` ✗ ACCESS DENIED: Account [${account}] does NOT have permission to access project [${project}].`,
117
117
  );
118
118
  console.error(
119
- ` 👉 Solution 1: Switch to an account that has access to [${project}]:`,
119
+ ` 👉 Solution 1: Log in with the account that has access to [${project}]:`,
120
120
  );
121
- console.error(` gcloud config set account <ACCOUNT_WITH_ACCESS>`);
121
+ console.error(` gcloud auth login`);
122
122
  console.error(
123
123
  ` 👉 Solution 2: Switch to a project that [${account}] can access:`,
124
124
  );
@@ -344,7 +344,58 @@ async function downloadPptxHelper(downloadUrl, targetPath) {
344
344
  return null;
345
345
  }
346
346
 
347
+ function assertEnvironmentOrExit() {
348
+ const account = getAccount();
349
+ const token = getAuthToken();
350
+ const project = getProject();
351
+
352
+ if (!account || !token) {
353
+ console.error('\n[EditNBLM] ❌ Activation Failed: Google Cloud authentication required.');
354
+ console.error('[EditNBLM] Please run `gcloud auth login` before activating this MCP server.');
355
+ console.error('[EditNBLM] Run `npx -y @jieunmarslim/server-editable-slides doctor` to diagnose.\n');
356
+ process.exit(1);
357
+ }
358
+
359
+ if (!project) {
360
+ console.error('\n[EditNBLM] ❌ Activation Failed: No GCP Project configured for GEAP billing.');
361
+ console.error('[EditNBLM] Please run `gcloud config set project <PROJECT_ID>` or export EDITABLE_SLIDES_PROJECT.');
362
+ console.error('[EditNBLM] Run `npx -y @jieunmarslim/server-editable-slides doctor` to diagnose.\n');
363
+ process.exit(1);
364
+ }
365
+
366
+ // Verify that account actually has permission to access the project
367
+ try {
368
+ const check = execSync(
369
+ `gcloud projects describe ${project} --format="value(projectId)"`,
370
+ { stdio: ['ignore', 'pipe', 'pipe'] },
371
+ )
372
+ .toString()
373
+ .trim();
374
+ if (check !== project) {
375
+ throw new Error(`Project mismatch`);
376
+ }
377
+ } catch (err) {
378
+ const stderr = err.stderr ? err.stderr.toString() : err.message;
379
+ console.error(`\n[EditNBLM] ❌ Activation Failed: Account [${account}] does NOT have access to project [${project}].`);
380
+ if (
381
+ stderr.includes('does not have permission') ||
382
+ stderr.includes('caller does not have permission')
383
+ ) {
384
+ console.error(`[EditNBLM] 👉 Solution 1: Log in with an account that has access: gcloud auth login`);
385
+ console.error(`[EditNBLM] 👉 Solution 2: Switch to a project that [${account}] can access: gcloud config set project <PROJECT>`);
386
+ } else if (stderr.includes('not found') || stderr.includes('404')) {
387
+ console.error(`[EditNBLM] 👉 Project [${project}] does not exist. Run: gcloud config set project <VALID_PROJECT_ID>`);
388
+ } else {
389
+ console.error(`[EditNBLM] 👉 Details: ${stderr.trim()}`);
390
+ }
391
+ console.error('[EditNBLM] Run `npx -y @jieunmarslim/server-editable-slides doctor` to diagnose.\n');
392
+ process.exit(1);
393
+ }
394
+ }
395
+
347
396
  function startMcpServer() {
397
+ assertEnvironmentOrExit();
398
+
348
399
  const server = new McpServer({
349
400
  name: 'editable-slides',
350
401
  version: '1.0.0',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jieunmarslim/server-editable-slides",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "Model Context Protocol (MCP) client for Editable Slides Cloud",
5
5
  "type": "module",
6
6
  "bin": {