argosync-mcp-install 1.0.0

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 (3) hide show
  1. package/README.md +51 -0
  2. package/bin/index.js +198 -0
  3. package/package.json +14 -0
package/README.md ADDED
@@ -0,0 +1,51 @@
1
+ # argosync-mcp-install
2
+
3
+ A simple CLI tool to install the Argosync MCP server in Claude Desktop.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npx argosync-mcp-install --token=<your-mcp-token>
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ### Basic Usage
14
+ ```bash
15
+ npx argosync-mcp-install --token=mcp_8d7e3f897fddfb95951b53d954781b56
16
+ ```
17
+
18
+ ### Specify Environment
19
+ ```bash
20
+ npx argosync-mcp-install --token=mcp_8d7e3f897fddfb95951b53d954781b56 --env=production
21
+ ```
22
+
23
+ ### Interactive Mode
24
+ ```bash
25
+ npx argosync-mcp-install
26
+ ```
27
+
28
+ ## Options
29
+
30
+ - `--token=<token>` - Your Argosync MCP token (required)
31
+ - `--env=<environment>` - Environment: 'staging' or 'production' (default: staging)
32
+ - `--help, -h` - Show help message
33
+
34
+ ## What it does
35
+
36
+ This tool automatically:
37
+ 1. Detects your operating system and finds the correct Claude Desktop config file
38
+ 2. Adds the Argosync MCP server configuration with your token
39
+ 3. Formats the configuration properly
40
+
41
+ ## Supported Platforms
42
+
43
+ - macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
44
+ - Linux: `~/.config/Claude/claude_desktop_config.json`
45
+ - Windows: `%APPDATA%\Claude\claude_desktop_config.json`
46
+
47
+ ## Next Steps
48
+
49
+ After running the installer:
50
+ 1. Restart Claude Desktop
51
+ 2. The Argosync MCP server will be available as "argosync" in your tools
package/bin/index.js ADDED
@@ -0,0 +1,198 @@
1
+ #!/usr/bin/env node
2
+
3
+ import fs from "fs";
4
+ import os from "os";
5
+ import path from "path";
6
+ import chalk from "chalk";
7
+ import inquirer from "inquirer";
8
+
9
+ /**
10
+ * Parse command line arguments
11
+ */
12
+ function parseArgs() {
13
+ const args = process.argv.slice(2);
14
+ const options = {};
15
+
16
+ for (let i = 0; i < args.length; i++) {
17
+ const arg = args[i];
18
+
19
+ if (arg === '--token' && i + 1 < args.length) {
20
+ options.token = args[i + 1];
21
+ i++; // Skip next arg
22
+ } else if (arg.startsWith('--token=')) {
23
+ options.token = arg.split('=')[1];
24
+ } else if (arg === '--env' && i + 1 < args.length) {
25
+ options.env = args[i + 1];
26
+ i++; // Skip next arg
27
+ } else if (arg.startsWith('--env=')) {
28
+ options.env = arg.split('=')[1];
29
+ } else if (arg === '--help' || arg === '-h') {
30
+ showHelp();
31
+ process.exit(0);
32
+ }
33
+ }
34
+
35
+ return options;
36
+ }
37
+
38
+ /**
39
+ * Show help message
40
+ */
41
+ function showHelp() {
42
+ console.log(chalk.cyan("\n🚀 Argosync MCP Remote Installer\n"));
43
+ console.log("Usage:");
44
+ console.log(" npx argosync-mcp-install --token=<your-token> [--env=<staging|production>]\n");
45
+ console.log("Options:");
46
+ console.log(" --token=<token> Your Argosync MCP token (required)");
47
+ console.log(" --env=<env> Environment: 'staging' or 'production' (default: staging)");
48
+ console.log(" --help, -h Show this help message\n");
49
+ console.log("Examples:");
50
+ console.log(" npx argosync-mcp-install --token=mcp_1234567890abcdef");
51
+ console.log(" npx argosync-mcp-install --token=mcp_1234567890abcdef --env=production\n");
52
+ }
53
+
54
+ /**
55
+ * Detect Claude Desktop config path
56
+ */
57
+ function getClaudeConfigPath() {
58
+ const home = os.homedir();
59
+
60
+ if (process.platform === "darwin") {
61
+ return path.join(
62
+ home,
63
+ "Library/Application Support/Claude/claude_desktop_config.json"
64
+ );
65
+ }
66
+
67
+ if (process.platform === "linux") {
68
+ return path.join(home, ".config/Claude/claude_desktop_config.json");
69
+ }
70
+
71
+ if (process.platform === "win32") {
72
+ return path.join(
73
+ home,
74
+ "AppData/Roaming/Claude/claude_desktop_config.json"
75
+ );
76
+ }
77
+
78
+ throw new Error("Unsupported OS");
79
+ }
80
+
81
+ /**
82
+ * Load config JSON safely
83
+ */
84
+ function loadConfig(filePath) {
85
+ if (!fs.existsSync(filePath)) {
86
+ return {};
87
+ }
88
+
89
+ return JSON.parse(fs.readFileSync(filePath, "utf8"));
90
+ }
91
+
92
+ /**
93
+ * Save config JSON nicely formatted
94
+ */
95
+ function saveConfig(filePath, config) {
96
+ fs.mkdirSync(path.dirname(filePath), { recursive: true });
97
+
98
+ fs.writeFileSync(filePath, JSON.stringify(config, null, 2));
99
+ }
100
+
101
+ async function main() {
102
+ const args = parseArgs();
103
+
104
+ // Show help if no token provided
105
+ if (!args.token && process.argv.slice(2).length === 0) {
106
+ showHelp();
107
+ return;
108
+ }
109
+
110
+ const configPath = getClaudeConfigPath();
111
+
112
+ console.log(chalk.gray("Claude config found at:"));
113
+ console.log(chalk.yellow(configPath), "\n");
114
+
115
+ // Get token from args or prompt
116
+ let token = args.token;
117
+ if (!token) {
118
+ const { tokenInput } = await inquirer.prompt([
119
+ {
120
+ type: "password",
121
+ name: "tokenInput",
122
+ message: "Paste your Argosync MCP token:",
123
+ mask: "*"
124
+ }
125
+ ]);
126
+ token = tokenInput;
127
+ }
128
+
129
+ // Get environment from args or prompt
130
+ let env = args.env;
131
+ if (!env) {
132
+ const { envChoice } = await inquirer.prompt([
133
+ {
134
+ type: "list",
135
+ name: "envChoice",
136
+ message: "Which Argosync environment?",
137
+ choices: [
138
+ {
139
+ name: "Staging",
140
+ value: "https://staging.argosync.com/api/mcp"
141
+ },
142
+ {
143
+ name: "Production",
144
+ value: "https://argosync.com/api/mcp"
145
+ }
146
+ ],
147
+ default: 0 // Default to staging
148
+ }
149
+ ]);
150
+ env = envChoice;
151
+ } else {
152
+ // Map string env to URL
153
+ if (env === "staging") {
154
+ env = "https://staging.argosync.com/api/mcp";
155
+ } else if (env === "production") {
156
+ env = "https://argosync.com/api/mcp";
157
+ }
158
+ }
159
+
160
+ // Load existing config
161
+ let config = loadConfig(configPath);
162
+
163
+ // Ensure mcpServers exists
164
+ if (!config.mcpServers) {
165
+ config.mcpServers = {};
166
+ }
167
+
168
+ // Add Argosync remote MCP server
169
+ config.mcpServers["argosync"] = {
170
+ command: "npx",
171
+ args: [
172
+ "-y",
173
+ "mcp-remote",
174
+ env,
175
+ "--header",
176
+ `Authorization: Bearer ${token}`
177
+ ]
178
+ };
179
+
180
+ // Save updated config
181
+ saveConfig(configPath, config);
182
+
183
+ console.log(chalk.green("\n✅ Argosync MCP Remote installed successfully!\n"));
184
+ console.log(chalk.white("Configuration added:"));
185
+ console.log(chalk.cyan("Server:"), "argosync");
186
+ console.log(chalk.cyan("Environment:"), env);
187
+ console.log(chalk.cyan("Token:"), token.substring(0, 10) + "...\n");
188
+
189
+ console.log(chalk.white("Next steps:"));
190
+ console.log(chalk.cyan("1."), "Restart Claude Desktop");
191
+ console.log(chalk.cyan("2."), "You will see 'argosync' under MCP tools\n");
192
+ }
193
+
194
+ main().catch((err) => {
195
+ console.error(chalk.red("\n❌ Installation failed:\n"));
196
+ console.error(err.message);
197
+ process.exit(1);
198
+ });
package/package.json ADDED
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "argosync-mcp-install",
3
+ "version": "1.0.0",
4
+ "description": "Installer for Argosync MCP Server in Claude",
5
+ "type": "module",
6
+ "bin": {
7
+ "argosync-mcp-install": "bin/index.js"
8
+ },
9
+ "scripts": {},
10
+ "dependencies": {
11
+ "chalk": "^5.3.0",
12
+ "inquirer": "^9.2.0"
13
+ }
14
+ }