@mediagraph/mcp 1.0.4 → 1.0.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/dist/index.js +21 -16
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -329,26 +329,38 @@ var TokenStore = class {
329
329
  * Save tokens to encrypted file
330
330
  */
331
331
  save(data) {
332
- const dir = dirname(this.filePath);
333
- if (!existsSync(dir)) {
334
- mkdirSync(dir, { recursive: true, mode: 448 });
332
+ try {
333
+ const dir = dirname(this.filePath);
334
+ console.error(`[TokenStore] Saving tokens to: ${this.filePath}`);
335
+ if (!existsSync(dir)) {
336
+ console.error(`[TokenStore] Creating directory: ${dir}`);
337
+ mkdirSync(dir, { recursive: true, mode: 448 });
338
+ }
339
+ const encrypted = this.encrypt(JSON.stringify(data));
340
+ writeFileSync(this.filePath, encrypted, { mode: 384 });
341
+ console.error(`[TokenStore] Tokens saved successfully`);
342
+ } catch (error) {
343
+ console.error(`[TokenStore] Failed to save tokens:`, error);
344
+ throw error;
335
345
  }
336
- const encrypted = this.encrypt(JSON.stringify(data));
337
- writeFileSync(this.filePath, encrypted, { mode: 384 });
338
346
  }
339
347
  /**
340
348
  * Load tokens from encrypted file
341
349
  */
342
350
  load() {
351
+ console.error(`[TokenStore] Loading tokens from: ${this.filePath}`);
343
352
  if (!existsSync(this.filePath)) {
353
+ console.error(`[TokenStore] Token file does not exist`);
344
354
  return null;
345
355
  }
346
356
  try {
347
357
  const encrypted = readFileSync(this.filePath);
348
358
  const decrypted = this.decrypt(encrypted);
349
- return JSON.parse(decrypted);
359
+ const data = JSON.parse(decrypted);
360
+ console.error(`[TokenStore] Tokens loaded for: ${data.userEmail || "unknown"}`);
361
+ return data;
350
362
  } catch (error) {
351
- console.error("Failed to load tokens:", error);
363
+ console.error("[TokenStore] Failed to load tokens:", error);
352
364
  return null;
353
365
  }
354
366
  }
@@ -2619,7 +2631,7 @@ All files are uploaded in a single upload session.`,
2619
2631
  guid: asset.guid,
2620
2632
  filename: asset.filename,
2621
2633
  file_size: asset.file_size,
2622
- content_type: asset.content_type
2634
+ mime_type: asset.mime_type
2623
2635
  },
2624
2636
  upload_guid: upload.guid
2625
2637
  });
@@ -3308,14 +3320,7 @@ server.setRequestHandler(ListResourceTemplatesRequestSchema, async () => {
3308
3320
  };
3309
3321
  });
3310
3322
  server.setRequestHandler(ListResourcesRequestSchema, async () => {
3311
- let token = await getAccessToken();
3312
- if (!token) {
3313
- const authSuccess = await runAutoAuth();
3314
- if (!authSuccess) {
3315
- return { resources: [] };
3316
- }
3317
- token = await getAccessToken();
3318
- }
3323
+ const token = await getAccessToken();
3319
3324
  if (!token) {
3320
3325
  return { resources: [] };
3321
3326
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mediagraph/mcp",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "MCP server for Mediagraph - Media Asset Management Platform",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",