@hapticpaper/mcp-server 1.0.34 → 1.0.35

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.
@@ -13,10 +13,21 @@ export class HapticPaperClient {
13
13
  this.tokenProvider = config.tokenProvider;
14
14
  // Request interceptor to add auth token
15
15
  this.client.interceptors.request.use(async (config) => {
16
+ console.error('[HapticPaperClient] Request interceptor called for:', config.url);
16
17
  if (this.tokenProvider) {
17
- const token = await this.tokenProvider();
18
- if (token) {
19
- config.headers.Authorization = `Bearer ${token}`;
18
+ try {
19
+ const token = await this.tokenProvider();
20
+ if (token) {
21
+ config.headers.Authorization = `Bearer ${token}`;
22
+ console.error('[HapticPaperClient] Token added to request');
23
+ }
24
+ else {
25
+ console.error('[HapticPaperClient] Token provider returned empty token');
26
+ }
27
+ }
28
+ catch (err) {
29
+ console.error('[HapticPaperClient] Token provider failed:', err.message, err.stack);
30
+ throw err;
20
31
  }
21
32
  }
22
33
  return config;
package/dist/index.js CHANGED
@@ -312,8 +312,11 @@ ${widgetJs}
312
312
  // MCP server is just a thin proxy - decode the token without verifying signature.
313
313
  // The backend will do full verification when we forward the token.
314
314
  // This avoids duplicating verification logic and makes debugging easier.
315
+ console.error('[MCP-Token-Debug] Decoding token...');
315
316
  const decoded = jwt.decode(token);
317
+ console.error('[MCP-Token-Debug] Token decoded successfully');
316
318
  if (!decoded || typeof decoded !== 'object') {
319
+ console.error('[MCP-Token-Debug] Token decode returned invalid format:', typeof decoded);
317
320
  throw new Error('Invalid token format');
318
321
  }
319
322
  const scopeStr = typeof decoded.scope === 'string' ? decoded.scope : '';
@@ -323,6 +326,7 @@ ${widgetJs}
323
326
  ...permissions.map((s) => (typeof s === 'string' ? s.trim() : '')).filter(Boolean),
324
327
  ];
325
328
  const exp = decoded.exp;
329
+ console.error('[MCP-Token-Debug] Returning auth result');
326
330
  return {
327
331
  token,
328
332
  clientId: decoded.client_id || 'unknown',
@@ -331,7 +335,7 @@ ${widgetJs}
331
335
  };
332
336
  }
333
337
  catch (err) {
334
- console.error('[MCP-Auth-Error] Token decode failed:', err.message);
338
+ console.error('[MCP-Auth-Error] Token decode failed:', err.message, err.stack);
335
339
  throw err;
336
340
  }
337
341
  },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hapticpaper/mcp-server",
3
3
  "mcpName": "com.hapticpaper/mcp",
4
- "version": "1.0.34",
4
+ "version": "1.0.35",
5
5
  "description": "Official MCP Server for Haptic Paper - Connect your account to create human tasks from agentic pipelines.",
6
6
  "type": "module",
7
7
  "main": "dist/index.js",
package/server.json CHANGED
@@ -25,7 +25,7 @@
25
25
  "subfolder": "packages/mcp-server"
26
26
  },
27
27
  "websiteUrl": "https://hapticpaper.com/developer",
28
- "version": "1.0.34",
28
+ "version": "1.0.35",
29
29
  "remotes": [
30
30
  {
31
31
  "type": "streamable-http",
@@ -37,7 +37,7 @@
37
37
  "registryType": "npm",
38
38
  "registryBaseUrl": "https://registry.npmjs.org",
39
39
  "identifier": "@hapticpaper/mcp-server",
40
- "version": "1.0.34",
40
+ "version": "1.0.35",
41
41
  "transport": {
42
42
  "type": "stdio"
43
43
  },