mcp-user-system 1.0.0 → 1.0.1
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/install.cjs +89 -0
- package/package.json +4 -2
package/install.cjs
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* One-click installer for mcp-user-system
|
|
4
|
+
* Detects OS and writes configuration to the correct MCP config file.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
const fs = require("fs");
|
|
8
|
+
const path = require("path");
|
|
9
|
+
const readline = require("readline");
|
|
10
|
+
const os = require("os");
|
|
11
|
+
|
|
12
|
+
const rl = readline.createInterface({
|
|
13
|
+
input: process.stdin,
|
|
14
|
+
output: process.stdout,
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
function question(prompt) {
|
|
18
|
+
return new Promise((resolve) => rl.question(prompt, resolve));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function getConfigPath() {
|
|
22
|
+
const platform = os.platform();
|
|
23
|
+
switch (platform) {
|
|
24
|
+
case "darwin":
|
|
25
|
+
return path.join(
|
|
26
|
+
os.homedir(),
|
|
27
|
+
"Library/Application Support/Claude/claude_desktop_config.json"
|
|
28
|
+
);
|
|
29
|
+
case "win32":
|
|
30
|
+
return path.join(os.homedir(), "AppData/Roaming/Claude/claude_desktop_config.json");
|
|
31
|
+
default:
|
|
32
|
+
return path.join(os.homedir(), ".config/claude/claude_desktop_config.json");
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function readConfig(configPath) {
|
|
37
|
+
try {
|
|
38
|
+
const content = fs.readFileSync(configPath, "utf-8");
|
|
39
|
+
return JSON.parse(content);
|
|
40
|
+
} catch {
|
|
41
|
+
return {};
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function writeConfig(configPath, config) {
|
|
46
|
+
const dir = path.dirname(configPath);
|
|
47
|
+
if (!fs.existsSync(dir)) {
|
|
48
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
49
|
+
}
|
|
50
|
+
fs.writeFileSync(configPath, JSON.stringify(config, null, 2) + "\n");
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
async function main() {
|
|
54
|
+
console.log("=== mcp-user-system Installer ===\n");
|
|
55
|
+
|
|
56
|
+
const baseUrl = await question("Backend URL (e.g. https://api.example.com): ");
|
|
57
|
+
const token = await question("Access Token (JWT): ");
|
|
58
|
+
|
|
59
|
+
if (!baseUrl || !token) {
|
|
60
|
+
console.error("Error: Both URL and token are required.");
|
|
61
|
+
process.exit(1);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const configPath = getConfigPath();
|
|
65
|
+
const config = readConfig(configPath);
|
|
66
|
+
|
|
67
|
+
if (!config.mcpServers) {
|
|
68
|
+
config.mcpServers = {};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
config.mcpServers["user-system"] = {
|
|
72
|
+
command: "npx",
|
|
73
|
+
args: ["mcp-user-system"],
|
|
74
|
+
env: {
|
|
75
|
+
TUS_BASE_URL: baseUrl.trim(),
|
|
76
|
+
TUS_ACCESS_TOKEN: token.trim(),
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
writeConfig(configPath, config);
|
|
81
|
+
|
|
82
|
+
console.log(`\nConfiguration written to: ${configPath}`);
|
|
83
|
+
console.log("Restart Claude Desktop to apply changes.");
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
main().catch((err) => {
|
|
87
|
+
console.error(err.message);
|
|
88
|
+
process.exit(1);
|
|
89
|
+
});
|
package/package.json
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-user-system",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "MCP server for token-user-system — wallet operations via Model Context Protocol",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"files": [
|
|
9
9
|
"dist",
|
|
10
|
+
"install.cjs",
|
|
10
11
|
"README.md",
|
|
11
12
|
"LICENSE"
|
|
12
13
|
],
|
|
13
14
|
"bin": {
|
|
14
|
-
"mcp-user-system": "dist/index.js"
|
|
15
|
+
"mcp-user-system": "dist/index.js",
|
|
16
|
+
"mcp-user-system-install": "install.cjs"
|
|
15
17
|
},
|
|
16
18
|
"repository": {
|
|
17
19
|
"type": "git",
|