sync-project-mcps 1.0.1 → 1.0.3

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
@@ -5,7 +5,7 @@
5
5
  One command. All your project MCP servers. Every editor.
6
6
 
7
7
  ```bash
8
- npx -y sync-project-mcps
8
+ npx -y sync-project-mcps@latest
9
9
  ```
10
10
 
11
11
  ---
@@ -37,19 +37,19 @@ You use multiple AI coding assistants - Cursor, Claude Code, Windsurf, Cline. Ea
37
37
  ### Run Once (npx)
38
38
 
39
39
  ```bash
40
- npx -y sync-project-mcps
40
+ npx -y sync-project-mcps@latest
41
41
  ```
42
42
 
43
43
  ### Preview Changes
44
44
 
45
45
  ```bash
46
- npx -y sync-project-mcps --dry-run
46
+ npx -y sync-project-mcps@latest --dry-run
47
47
  ```
48
48
 
49
49
  ### Verbose Output
50
50
 
51
51
  ```bash
52
- npx -y sync-project-mcps -v
52
+ npx -y sync-project-mcps@latest -v
53
53
  ```
54
54
 
55
55
  ---
@@ -73,7 +73,7 @@ npx -y sync-project-mcps -v
73
73
  No installation needed:
74
74
 
75
75
  ```bash
76
- npx -y sync-project-mcps
76
+ npx -y sync-project-mcps@latest
77
77
  ```
78
78
 
79
79
  ### Option 2: Install Globally
@@ -130,7 +130,7 @@ Or add to project-level `.mcp.json`:
130
130
  ### Then Sync
131
131
 
132
132
  ```bash
133
- npx -y sync-project-mcps
133
+ npx -y sync-project-mcps@latest
134
134
  ```
135
135
 
136
136
  Your MCP server is now available in **all** your AI coding assistants.
@@ -144,7 +144,7 @@ Your MCP server is now available in **all** your AI coding assistants.
144
144
  3. **Writes** the unified config to every client location
145
145
 
146
146
  ```
147
- $ npx -y sync-project-mcps
147
+ $ npx -y sync-project-mcps@latest
148
148
 
149
149
  Sync MCP Configurations
150
150
 
@@ -1,26 +1,13 @@
1
1
  import { existsSync, readFileSync } from "node:fs";
2
2
  import { join } from "node:path";
3
- import { homedir } from "node:os";
4
- function getGlobalConfigPath() {
5
- const platform = process.platform;
6
- if (platform === "darwin") {
7
- return join(homedir(), "Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json");
8
- }
9
- else if (platform === "win32") {
10
- return join(process.env.APPDATA || "", "Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json");
11
- }
12
- return join(homedir(), ".config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json");
13
- }
3
+ const CONFIG_PATH = ".cline/mcp.json";
14
4
  export function getClineConfig(projectRoot) {
15
- const projectPath = join(projectRoot, ".cline/mcp.json");
16
- const globalPath = getGlobalConfigPath();
17
- // Prefer project-level config, fall back to global
18
- const configPath = existsSync(projectPath) ? projectPath : globalPath;
5
+ const configPath = join(projectRoot, CONFIG_PATH);
19
6
  const exists = existsSync(configPath);
20
7
  if (!exists) {
21
8
  return {
22
9
  name: "Cline",
23
- path: projectPath,
10
+ path: configPath,
24
11
  config: null,
25
12
  exists: false,
26
13
  };
@@ -1,19 +1,13 @@
1
1
  import { existsSync, readFileSync } from "node:fs";
2
2
  import { join } from "node:path";
3
- import { homedir } from "node:os";
4
- function getGlobalConfigPath() {
5
- return join(homedir(), ".codeium/windsurf/mcp_config.json");
6
- }
3
+ const CONFIG_PATH = ".windsurf/mcp.json";
7
4
  export function getWindsurfConfig(projectRoot) {
8
- const projectPath = join(projectRoot, ".windsurf/mcp.json");
9
- const globalPath = getGlobalConfigPath();
10
- // Prefer project-level config, fall back to global
11
- const configPath = existsSync(projectPath) ? projectPath : globalPath;
5
+ const configPath = join(projectRoot, CONFIG_PATH);
12
6
  const exists = existsSync(configPath);
13
7
  if (!exists) {
14
8
  return {
15
9
  name: "Windsurf",
16
- path: projectPath, // Default to project path for creation
10
+ path: configPath,
17
11
  config: null,
18
12
  exists: false,
19
13
  };
package/dist/index.js CHANGED
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { existsSync, mkdirSync, writeFileSync } from "node:fs";
3
- import { dirname } from "node:path";
2
+ import { writeFileSync } from "node:fs";
4
3
  import { parseArgs } from "node:util";
5
4
  import { getCursorConfig } from "./clients/cursor.js";
6
5
  import { getClaudeCodeConfig } from "./clients/claude-code.js";
@@ -99,7 +98,7 @@ function run() {
99
98
  }
100
99
  }
101
100
  if (missingClients.length > 0 && verbose) {
102
- console.log(c("dim", "\nNot found (will be created):"));
101
+ console.log(c("dim", "\nNot found (skipped):"));
103
102
  for (const client of missingClients) {
104
103
  console.log(c("dim", ` - ${client.name}`));
105
104
  }
@@ -111,7 +110,7 @@ function run() {
111
110
  console.log(` ${c("blue", "-")} ${name}`);
112
111
  }
113
112
  console.log(`\n${c("cyan", "Syncing to clients...")}`);
114
- for (const client of clients) {
113
+ for (const client of existingClients) {
115
114
  const changes = getChanges(client, merged);
116
115
  const parts = [];
117
116
  if (changes.added.length > 0) {
@@ -121,18 +120,13 @@ function run() {
121
120
  parts.push(c("red", `-${changes.removed.length}`));
122
121
  }
123
122
  const changeInfo = parts.length > 0 ? ` (${parts.join(", ")})` : c("dim", " (no changes)");
124
- const status = client.exists ? c("green", "update") : c("yellow", "create");
125
- console.log(` [${status}] ${client.name}${changeInfo}`);
123
+ console.log(` [${c("green", "sync")}] ${client.name}${changeInfo}`);
126
124
  if (verbose && changes.added.length > 0) {
127
125
  for (const name of changes.added) {
128
126
  console.log(c("green", ` + ${name}`));
129
127
  }
130
128
  }
131
129
  if (!dryRun) {
132
- const dir = dirname(client.path);
133
- if (!existsSync(dir)) {
134
- mkdirSync(dir, { recursive: true });
135
- }
136
130
  writeFileSync(client.path, JSON.stringify(merged, null, 2) + "\n");
137
131
  }
138
132
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sync-project-mcps",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Sync project-level MCP configurations across AI coding assistants (Cursor, Claude Code, Windsurf, Cline)",
5
5
  "type": "module",
6
6
  "bin": {