purmemo-mcp 2.1.3 → 2.1.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.
package/README.md CHANGED
@@ -229,6 +229,66 @@ The following remain proprietary:
229
229
  - Workflow intelligence system
230
230
  - Performance optimization techniques
231
231
 
232
+ ## 🔧 Troubleshooting
233
+
234
+ ### Common Issues and Solutions
235
+
236
+ #### "Server disconnected" or "Connection closed" errors
237
+ This usually happens when the MCP server produces console output that interferes with the JSON protocol.
238
+
239
+ **Solution**: Update to the latest version:
240
+ ```bash
241
+ npx purmemo-mcp@latest setup
242
+ ```
243
+
244
+ #### "Unexpected token" or "Unexpected end of JSON input"
245
+ This indicates console output is breaking the MCP protocol.
246
+
247
+ **Quick fix**: Run diagnostics to identify the issue:
248
+ ```bash
249
+ npx purmemo-mcp diagnose
250
+ ```
251
+
252
+ #### Tools hang or timeout during authentication
253
+ This happens when OAuth authentication blocks the MCP protocol.
254
+
255
+ **Solution**: The latest version (2.1.3+) uses non-blocking authentication that returns helpful prompts instead of hanging.
256
+
257
+ ### Step-by-Step Debugging
258
+
259
+ 1. **Update to latest version**:
260
+ ```bash
261
+ npx purmemo-mcp@latest
262
+ ```
263
+
264
+ 2. **Run diagnostics**:
265
+ ```bash
266
+ npx purmemo-mcp diagnose
267
+ ```
268
+
269
+ 3. **Check Claude Desktop config**:
270
+ Ensure you're using `purmemo-mcp@^2.1.3` or later in your configuration:
271
+ ```json
272
+ {
273
+ "mcpServers": {
274
+ "purmemo": {
275
+ "command": "npx",
276
+ "args": ["-y", "purmemo-mcp@^2.1.3"],
277
+ "env": {
278
+ "PURMEMO_API_URL": "https://api.purmemo.ai",
279
+ "PURMEMO_OAUTH_CALLBACK_URL": "http://localhost:3456/callback",
280
+ "PURMEMO_FRONTEND_URL": "https://app.purmemo.ai"
281
+ }
282
+ }
283
+ }
284
+ }
285
+ ```
286
+
287
+ 4. **Restart Claude Desktop** completely:
288
+ - Quit with Cmd+Q (macOS) or close completely
289
+ - Reopen Claude Desktop
290
+ - Try connecting again
291
+
232
292
  ## 🆘 Support
233
293
 
234
294
  - 📧 Email: support@purmemo.ai
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "purmemo-mcp",
3
- "version": "2.1.3",
3
+ "version": "2.1.4",
4
4
  "description": "Official Model Context Protocol (MCP) server for Purmemo - Seamless OAuth authentication for your AI-powered second brain",
5
5
  "main": "src/server-oauth.js",
6
6
  "type": "module",
@@ -19,8 +19,9 @@
19
19
  "setup": "node src/setup.js setup",
20
20
  "status": "node src/setup.js status",
21
21
  "logout": "node src/setup.js logout",
22
+ "diagnose": "node src/diagnose.js",
22
23
  "test": "echo \"No tests yet\"",
23
- "postinstall": "node -e \"console.log('\\n🧠 pūrmemo MCP v2.0.0 installed!\\n\\nNew users: Run \\'npx purmemo-mcp setup\\' to connect your account.\\nExisting users: Your API key still works (backwards compatible).\\n')\""
24
+ "postinstall": "node -e \"console.log('\\n🧠 pūrmemo MCP v2.1.3 installed!\\n\\nNew users: Run \\'npx purmemo-mcp setup\\' to connect your account.\\nIf you have connection issues: Run \\'npx purmemo-mcp diagnose\\'\\n')\""
24
25
  },
25
26
  "keywords": [
26
27
  "mcp",
@@ -0,0 +1,107 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Purmemo MCP Diagnostic Tool
4
+ * Helps users diagnose and fix common MCP connection issues
5
+ */
6
+
7
+ import { spawn } from 'child_process';
8
+ import { fileURLToPath } from 'url';
9
+ import { dirname, join } from 'path';
10
+
11
+ const __filename = fileURLToPath(import.meta.url);
12
+ const __dirname = dirname(__filename);
13
+
14
+ async function runDiagnostics() {
15
+ console.log('🔧 Purmemo MCP Diagnostic Tool');
16
+ console.log('================================\n');
17
+
18
+ // Test 1: Check if server starts without console output
19
+ console.log('1️⃣ Testing server startup (should be silent)...');
20
+
21
+ const serverPath = join(__dirname, 'server-oauth.js');
22
+ const serverProcess = spawn('node', [serverPath], {
23
+ stdio: ['ignore', 'pipe', 'pipe']
24
+ });
25
+
26
+ let hasOutput = false;
27
+ let outputBuffer = '';
28
+
29
+ serverProcess.stdout.on('data', (data) => {
30
+ hasOutput = true;
31
+ outputBuffer += data.toString();
32
+ });
33
+
34
+ serverProcess.stderr.on('data', (data) => {
35
+ hasOutput = true;
36
+ outputBuffer += data.toString();
37
+ });
38
+
39
+ // Give server 2 seconds to start
40
+ await new Promise(resolve => setTimeout(resolve, 2000));
41
+
42
+ if (hasOutput) {
43
+ console.log('❌ Server produces console output (will break MCP protocol)');
44
+ console.log('📝 Output detected:', outputBuffer.substring(0, 200) + '...');
45
+ console.log('🔧 This will cause "Unexpected token" errors in Claude Desktop');
46
+ } else {
47
+ console.log('✅ Server starts silently (MCP protocol compatible)');
48
+ }
49
+
50
+ serverProcess.kill();
51
+
52
+ // Test 2: Check package.json version
53
+ console.log('\n2️⃣ Checking package version...');
54
+
55
+ try {
56
+ const packagePath = join(__dirname, '..', 'package.json');
57
+ const { readFile } = await import('fs/promises');
58
+ const packageData = JSON.parse(await readFile(packagePath, 'utf8'));
59
+
60
+ if (packageData.version >= '2.1.3') {
61
+ console.log(`✅ Using fixed version: ${packageData.version}`);
62
+ } else {
63
+ console.log(`⚠️ Using old version: ${packageData.version}`);
64
+ console.log('🔧 Please update to version 2.1.3 or higher');
65
+ }
66
+ } catch (error) {
67
+ console.log('❌ Could not check package version:', error.message);
68
+ }
69
+
70
+ // Test 3: Check environment variables
71
+ console.log('\n3️⃣ Checking environment configuration...');
72
+
73
+ const requiredEnvs = [
74
+ 'PURMEMO_API_URL',
75
+ 'PURMEMO_OAUTH_CALLBACK_URL',
76
+ 'PURMEMO_FRONTEND_URL'
77
+ ];
78
+
79
+ let envIssues = 0;
80
+ for (const env of requiredEnvs) {
81
+ if (process.env[env]) {
82
+ console.log(`✅ ${env}: ${process.env[env]}`);
83
+ } else {
84
+ console.log(`⚠️ ${env}: Not set (will use defaults)`);
85
+ envIssues++;
86
+ }
87
+ }
88
+
89
+ if (envIssues === 0) {
90
+ console.log('✅ All environment variables properly configured');
91
+ }
92
+
93
+ // Final recommendation
94
+ console.log('\n🎯 Final Diagnosis:');
95
+
96
+ if (!hasOutput && envIssues === 0) {
97
+ console.log('✅ Your MCP server should work perfectly with Claude Desktop!');
98
+ console.log('📱 If you still have issues, try restarting Claude Desktop');
99
+ } else {
100
+ console.log('⚠️ Issues detected that may cause Claude Desktop connection failures');
101
+ console.log('🔧 Please address the issues above and run diagnostics again');
102
+ }
103
+
104
+ console.log('\n📚 For help: https://github.com/coladapo/purmemo-mcp/issues');
105
+ }
106
+
107
+ runDiagnostics().catch(console.error);