elysium-mcp 0.1.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/bin/cli.js +25 -0
- package/package.json +30 -0
- package/scripts/install.js +103 -0
package/bin/cli.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { spawn } = require('child_process');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
const binaryName = process.platform === 'win32' ? 'elysium.exe' : 'elysium';
|
|
7
|
+
const binaryPath = path.join(__dirname, binaryName);
|
|
8
|
+
|
|
9
|
+
const child = spawn(binaryPath, process.argv.slice(2), {
|
|
10
|
+
stdio: 'inherit',
|
|
11
|
+
env: process.env,
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
child.on('error', (err) => {
|
|
15
|
+
if (err.code === 'ENOENT') {
|
|
16
|
+
console.error('Binary not found. Try reinstalling: npm install -g elysium-mcp');
|
|
17
|
+
} else {
|
|
18
|
+
console.error(`Error: ${err.message}`);
|
|
19
|
+
}
|
|
20
|
+
process.exit(1);
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
child.on('exit', (code) => {
|
|
24
|
+
process.exit(code || 0);
|
|
25
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "elysium-mcp",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "MCP server for Obsidian-based Second Brain with AI-powered semantic search",
|
|
5
|
+
"keywords": ["mcp", "obsidian", "semantic-search", "second-brain", "ai", "claude"],
|
|
6
|
+
"author": "junejae",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/junejae/elysium.git",
|
|
11
|
+
"directory": "npm"
|
|
12
|
+
},
|
|
13
|
+
"homepage": "https://github.com/junejae/elysium",
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/junejae/elysium/issues"
|
|
16
|
+
},
|
|
17
|
+
"bin": {
|
|
18
|
+
"elysium-mcp": "bin/cli.js"
|
|
19
|
+
},
|
|
20
|
+
"scripts": {
|
|
21
|
+
"postinstall": "node scripts/install.js"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"bin/",
|
|
25
|
+
"scripts/"
|
|
26
|
+
],
|
|
27
|
+
"engines": {
|
|
28
|
+
"node": ">=18"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const https = require('https');
|
|
4
|
+
const fs = require('fs');
|
|
5
|
+
const path = require('path');
|
|
6
|
+
const { execSync } = require('child_process');
|
|
7
|
+
|
|
8
|
+
const REPO = 'junejae/elysium';
|
|
9
|
+
const VERSION = require('../package.json').version;
|
|
10
|
+
|
|
11
|
+
const PLATFORMS = {
|
|
12
|
+
'darwin-arm64': 'elysium-macos-aarch64',
|
|
13
|
+
'darwin-x64': 'elysium-macos-x86_64',
|
|
14
|
+
'linux-x64': 'elysium-linux-x86_64',
|
|
15
|
+
'win32-x64': 'elysium-windows-x86_64.exe',
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
function getPlatformKey() {
|
|
19
|
+
const platform = process.platform;
|
|
20
|
+
const arch = process.arch;
|
|
21
|
+
return `${platform}-${arch}`;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function getBinaryName() {
|
|
25
|
+
const key = getPlatformKey();
|
|
26
|
+
const name = PLATFORMS[key];
|
|
27
|
+
if (!name) {
|
|
28
|
+
console.error(`Unsupported platform: ${key}`);
|
|
29
|
+
console.error(`Supported platforms: ${Object.keys(PLATFORMS).join(', ')}`);
|
|
30
|
+
process.exit(1);
|
|
31
|
+
}
|
|
32
|
+
return name;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function downloadFile(url, dest) {
|
|
36
|
+
return new Promise((resolve, reject) => {
|
|
37
|
+
const follow = (url, redirects = 0) => {
|
|
38
|
+
if (redirects > 10) {
|
|
39
|
+
reject(new Error('Too many redirects'));
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const protocol = url.startsWith('https') ? https : require('http');
|
|
44
|
+
protocol.get(url, { headers: { 'User-Agent': 'elysium-mcp-npm' } }, (response) => {
|
|
45
|
+
if (response.statusCode >= 300 && response.statusCode < 400 && response.headers.location) {
|
|
46
|
+
follow(response.headers.location, redirects + 1);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (response.statusCode !== 200) {
|
|
51
|
+
reject(new Error(`Failed to download: ${response.statusCode}`));
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const file = fs.createWriteStream(dest);
|
|
56
|
+
response.pipe(file);
|
|
57
|
+
file.on('finish', () => {
|
|
58
|
+
file.close();
|
|
59
|
+
resolve();
|
|
60
|
+
});
|
|
61
|
+
file.on('error', (err) => {
|
|
62
|
+
fs.unlink(dest, () => {});
|
|
63
|
+
reject(err);
|
|
64
|
+
});
|
|
65
|
+
}).on('error', reject);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
follow(url);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
async function main() {
|
|
73
|
+
const binaryName = getBinaryName();
|
|
74
|
+
const binDir = path.join(__dirname, '..', 'bin');
|
|
75
|
+
const binaryPath = path.join(binDir, process.platform === 'win32' ? 'elysium.exe' : 'elysium');
|
|
76
|
+
|
|
77
|
+
// Skip if binary already exists
|
|
78
|
+
if (fs.existsSync(binaryPath)) {
|
|
79
|
+
console.log('Binary already installed');
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const url = `https://github.com/${REPO}/releases/download/v${VERSION}/${binaryName}`;
|
|
84
|
+
console.log(`Downloading ${binaryName} from ${url}...`);
|
|
85
|
+
|
|
86
|
+
try {
|
|
87
|
+
await downloadFile(url, binaryPath);
|
|
88
|
+
|
|
89
|
+
// Make executable on Unix
|
|
90
|
+
if (process.platform !== 'win32') {
|
|
91
|
+
fs.chmodSync(binaryPath, 0o755);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
console.log('Installation complete!');
|
|
95
|
+
} catch (err) {
|
|
96
|
+
console.error(`Failed to download binary: ${err.message}`);
|
|
97
|
+
console.error('You may need to download manually from:');
|
|
98
|
+
console.error(`https://github.com/${REPO}/releases`);
|
|
99
|
+
process.exit(1);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
main();
|