workfullcircle-mcp 2.0.0 → 2.0.2

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/package.json +1 -1
  2. package/src/config-writer.js +102 -102
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "workfullcircle-mcp",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
4
4
  "description": "WorkFullCircle MCP - Universal AI memory that works anywhere",
5
5
  "bin": {
6
6
  "workfullcircle-mcp": "bin/workfullcircle-mcp.js"
@@ -1,102 +1,102 @@
1
- const path = require('path');
2
- const fs = require('fs');
3
- const os = require('os');
4
-
5
- function getTargets() {
6
- const home = os.homedir();
7
- return [
8
- {
9
- name: 'Claude Desktop',
10
- path: os.platform() === 'win32'
11
- ? path.join(process.env.APPDATA || '', 'Claude', 'claude_desktop_config.json')
12
- : path.join(home, 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json')
13
- },
14
- {
15
- name: 'Cursor',
16
- path: path.join(home, '.cursor', 'mcp.json')
17
- },
18
- {
19
- name: 'Windsurf',
20
- path: os.platform() === 'win32'
21
- ? path.join(process.env.APPDATA || '', 'Windsurf', 'User', 'globalStorage', 'storage.json')
22
- : path.join(home, '.windsurf', 'mcp.json')
23
- },
24
- {
25
- name: 'VS Code',
26
- path: os.platform() === 'win32'
27
- ? path.join(process.env.APPDATA || '', 'Code', 'User', 'globalStorage', 'storage.json')
28
- : os.platform() === 'darwin'
29
- ? path.join(home, 'Library', 'Application Support', 'Code', 'User', 'globalStorage', 'storage.json')
30
- : path.join(home, '.config', 'Code', 'User', 'globalStorage', 'storage.json')
31
- }
32
- ];
33
- }
34
-
35
- function buildConfig(token, projectId) {
36
- const args = [
37
- '-y',
38
- 'workfullcircle-remote',
39
- process.env.WFC_API_URL || 'https://workfullcircle.com/api',
40
- '--header',
41
- `Authorization: Bearer ${token}`
42
- ];
43
- if (projectId) {
44
- args.push('--project', projectId);
45
- }
46
- return {
47
- mcpServers: {
48
- workfullcircle: {
49
- command: 'npx',
50
- args
51
- }
52
- }
53
- };
54
- }
55
-
56
- function mergeConfig(existing, token, projectId) {
57
- const config = existing && typeof existing === 'object' ? existing : {};
58
- if (!config.mcpServers) {
59
- config.mcpServers = {};
60
- }
61
-
62
- // Handle VS Code's different JSON structure
63
- const workfullcircleConfig = buildConfig(token, projectId).mcpServers.workfullcircle;
64
- if (existing.mcpServers && existing.mcpServers.workfullcircle) {
65
- // VS Code might store in different format, merge properly
66
- config.mcpServers.workfullcircle = {
67
- ...existing.mcpServers.workfullcircle,
68
- ...workfullcircleConfig
69
- };
70
- } else {
71
- config.mcpServers.workfullcircle = workfullcircleConfig;
72
- }
73
-
74
- return config;
75
- }
76
-
77
- function writeConfig(target, token, projectId) {
78
- const dir = path.dirname(target.path);
79
- if (!fs.existsSync(dir)) {
80
- fs.mkdirSync(dir, { recursive: true });
81
- }
82
-
83
- let existing = {};
84
- if (fs.existsSync(target.path)) {
85
- try {
86
- existing = JSON.parse(fs.readFileSync(target.path, 'utf8'));
87
- } catch (error) {
88
- return { success: false, error: `Invalid JSON in ${target.path}` };
89
- }
90
- }
91
-
92
- const merged = mergeConfig(existing, token, projectId);
93
- fs.writeFileSync(target.path, JSON.stringify(merged, null, 2));
94
- return { success: true };
95
- }
96
-
97
- module.exports = {
98
- getTargets,
99
- writeConfig,
100
- buildConfig,
101
- mergeConfig
102
- };
1
+ const path = require('path');
2
+ const fs = require('fs');
3
+ const os = require('os');
4
+
5
+ function getTargets() {
6
+ const home = os.homedir();
7
+ return [
8
+ {
9
+ name: 'Claude Desktop',
10
+ path: os.platform() === 'win32'
11
+ ? path.join(process.env.APPDATA || '', 'Claude', 'claude_desktop_config.json')
12
+ : path.join(home, 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json')
13
+ },
14
+ {
15
+ name: 'Cursor',
16
+ path: path.join(home, '.cursor', 'mcp.json')
17
+ },
18
+ {
19
+ name: 'Windsurf',
20
+ path: os.platform() === 'win32'
21
+ ? path.join(process.env.APPDATA || '', 'Windsurf', 'User', 'globalStorage', 'storage.json')
22
+ : path.join(home, '.windsurf', 'mcp.json')
23
+ },
24
+ {
25
+ name: 'VS Code',
26
+ path: os.platform() === 'win32'
27
+ ? path.join(process.env.APPDATA || '', 'Code', 'User', 'globalStorage', 'storage.json')
28
+ : os.platform() === 'darwin'
29
+ ? path.join(home, 'Library', 'Application Support', 'Code', 'User', 'globalStorage', 'storage.json')
30
+ : path.join(home, '.config', 'Code', 'User', 'globalStorage', 'storage.json')
31
+ }
32
+ ];
33
+ }
34
+
35
+ function buildConfig(token, projectId) {
36
+ const args = [
37
+ '-y',
38
+ 'workfullcircle-remote',
39
+ process.env.WFC_API_URL || process.env.RAILWAY_STATIC_URL || 'https://workfullcircle.com',
40
+ '--header',
41
+ `Authorization: Bearer ${token}`
42
+ ];
43
+ if (projectId) {
44
+ args.push('--project', projectId);
45
+ }
46
+ return {
47
+ mcpServers: {
48
+ workfullcircle: {
49
+ command: 'npx',
50
+ args
51
+ }
52
+ }
53
+ };
54
+ }
55
+
56
+ function mergeConfig(existing, token, projectId) {
57
+ const config = existing && typeof existing === 'object' ? existing : {};
58
+ if (!config.mcpServers) {
59
+ config.mcpServers = {};
60
+ }
61
+
62
+ // Handle VS Code's different JSON structure
63
+ const workfullcircleConfig = buildConfig(token, projectId).mcpServers.workfullcircle;
64
+ if (existing.mcpServers && existing.mcpServers.workfullcircle) {
65
+ // VS Code might store in different format, merge properly
66
+ config.mcpServers.workfullcircle = {
67
+ ...existing.mcpServers.workfullcircle,
68
+ ...workfullcircleConfig
69
+ };
70
+ } else {
71
+ config.mcpServers.workfullcircle = workfullcircleConfig;
72
+ }
73
+
74
+ return config;
75
+ }
76
+
77
+ function writeConfig(target, token, projectId) {
78
+ const dir = path.dirname(target.path);
79
+ if (!fs.existsSync(dir)) {
80
+ fs.mkdirSync(dir, { recursive: true });
81
+ }
82
+
83
+ let existing = {};
84
+ if (fs.existsSync(target.path)) {
85
+ try {
86
+ existing = JSON.parse(fs.readFileSync(target.path, 'utf8'));
87
+ } catch (error) {
88
+ return { success: false, error: `Invalid JSON in ${target.path}` };
89
+ }
90
+ }
91
+
92
+ const merged = mergeConfig(existing, token, projectId);
93
+ fs.writeFileSync(target.path, JSON.stringify(merged, null, 2));
94
+ return { success: true };
95
+ }
96
+
97
+ module.exports = {
98
+ getTargets,
99
+ writeConfig,
100
+ buildConfig,
101
+ mergeConfig
102
+ };