palan-k-mcp 0.2.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.
- package/README.md +76 -0
- package/bin/run.js +95 -0
- package/package.json +39 -0
- package/postinstall.js +103 -0
package/README.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# palan-k-mcp
|
|
2
|
+
|
|
3
|
+
> The Governance & Deployment Engine for Rust
|
|
4
|
+
>
|
|
5
|
+
> AI 코딩 어시스턴트를 위한 통합형 MCP 서버
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g palan-k-mcp
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
> Platform binaries are automatically installed from `@palan-k/mcp-*` scoped packages.
|
|
14
|
+
|
|
15
|
+
### Auto-configure MCP
|
|
16
|
+
|
|
17
|
+
**Linux/macOS:**
|
|
18
|
+
```bash
|
|
19
|
+
PALAN_K_AUTO_CONFIG=true npm install -g palan-k-mcp
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
**Windows (cmd):**
|
|
23
|
+
```cmd
|
|
24
|
+
set PALAN_K_AUTO_CONFIG=true && npm install -g palan-k-mcp
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**Windows (PowerShell):**
|
|
28
|
+
```powershell
|
|
29
|
+
$env:PALAN_K_AUTO_CONFIG="true"; npm install -g palan-k-mcp
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Features
|
|
33
|
+
|
|
34
|
+
### Governance (코드 품질 관리)
|
|
35
|
+
- `get_constitution` - 프로젝트 코딩 규칙 반환
|
|
36
|
+
- `validate_code` - 코드 헌법 준수 검사
|
|
37
|
+
- `scan_local_docs` - 로컬 문서 스캔
|
|
38
|
+
- `ingest_url` - URL 문서 크롤링
|
|
39
|
+
- `query_knowledge` - 지식 통합 검색
|
|
40
|
+
|
|
41
|
+
### Deployment (배포)
|
|
42
|
+
- `init_vps` - 서버 초기화
|
|
43
|
+
- `ship` - 빌드 + 배포
|
|
44
|
+
- `logs` - 로그 스트리밍
|
|
45
|
+
- `rollback` - 이전 버전 복구
|
|
46
|
+
|
|
47
|
+
## MCP Configuration
|
|
48
|
+
|
|
49
|
+
Add to Claude Desktop config:
|
|
50
|
+
|
|
51
|
+
**macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
52
|
+
**Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
53
|
+
**Linux**: `~/.config/Claude/claude_desktop_config.json`
|
|
54
|
+
|
|
55
|
+
```json
|
|
56
|
+
{
|
|
57
|
+
"mcpServers": {
|
|
58
|
+
"palan-k-mcp": {
|
|
59
|
+
"command": "palan-k-mcp",
|
|
60
|
+
"args": []
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Supported Platforms
|
|
67
|
+
|
|
68
|
+
| Platform | Architecture |
|
|
69
|
+
|----------|--------------|
|
|
70
|
+
| Linux | x64 |
|
|
71
|
+
| macOS | arm64 (M1/M2/M3) |
|
|
72
|
+
| Windows | x64 |
|
|
73
|
+
|
|
74
|
+
## License
|
|
75
|
+
|
|
76
|
+
MIT
|
package/bin/run.js
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Cross-platform binary runner for palan-k-mcp
|
|
5
|
+
* Finds and executes the binary from the platform-specific package
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const { spawn } = require('child_process');
|
|
9
|
+
const path = require('path');
|
|
10
|
+
const fs = require('fs');
|
|
11
|
+
const os = require('os');
|
|
12
|
+
|
|
13
|
+
function getPlatformPackage() {
|
|
14
|
+
const platform = os.platform();
|
|
15
|
+
const arch = os.arch();
|
|
16
|
+
|
|
17
|
+
const platformMap = {
|
|
18
|
+
'linux-x64': '@palan-k/mcp-linux-x64',
|
|
19
|
+
'linux-arm64': '@palan-k/mcp-linux-arm64',
|
|
20
|
+
'darwin-x64': '@palan-k/mcp-darwin-x64',
|
|
21
|
+
'darwin-arm64': '@palan-k/mcp-darwin-arm64',
|
|
22
|
+
'win32-x64': '@palan-k/mcp-win32-x64'
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const key = `${platform}-${arch}`;
|
|
26
|
+
const packageName = platformMap[key];
|
|
27
|
+
|
|
28
|
+
if (!packageName) {
|
|
29
|
+
throw new Error(`Unsupported platform: ${platform}-${arch}`);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return {
|
|
33
|
+
packageName,
|
|
34
|
+
binaryName: platform === 'win32' ? 'palan-k-mcp.exe' : 'palan-k-mcp'
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function findBinary() {
|
|
39
|
+
const { packageName, binaryName } = getPlatformPackage();
|
|
40
|
+
|
|
41
|
+
// Look for the platform package in node_modules
|
|
42
|
+
const possiblePaths = [
|
|
43
|
+
// Installed as dependency (most common)
|
|
44
|
+
path.join(__dirname, '..', 'node_modules', packageName, 'bin', binaryName),
|
|
45
|
+
// Hoisted to parent node_modules
|
|
46
|
+
path.join(__dirname, '..', '..', packageName, 'bin', binaryName),
|
|
47
|
+
// Global install
|
|
48
|
+
path.join(__dirname, '..', '..', '..', packageName, 'bin', binaryName),
|
|
49
|
+
// Fallback: same directory
|
|
50
|
+
path.join(__dirname, binaryName)
|
|
51
|
+
];
|
|
52
|
+
|
|
53
|
+
for (const binPath of possiblePaths) {
|
|
54
|
+
if (fs.existsSync(binPath)) {
|
|
55
|
+
return binPath;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
throw new Error(
|
|
60
|
+
`Binary not found for ${packageName}.\n` +
|
|
61
|
+
`Looked in:\n${possiblePaths.join('\n')}\n\n` +
|
|
62
|
+
`Try reinstalling: npm install -g palan-k-mcp`
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function main() {
|
|
67
|
+
try {
|
|
68
|
+
const binaryPath = findBinary();
|
|
69
|
+
const args = process.argv.slice(2);
|
|
70
|
+
|
|
71
|
+
const child = spawn(binaryPath, args, {
|
|
72
|
+
stdio: 'inherit',
|
|
73
|
+
shell: false
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
child.on('error', (err) => {
|
|
77
|
+
console.error(`Failed to start binary: ${err.message}`);
|
|
78
|
+
process.exit(1);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
child.on('exit', (code, signal) => {
|
|
82
|
+
if (signal) {
|
|
83
|
+
process.kill(process.pid, signal);
|
|
84
|
+
} else {
|
|
85
|
+
process.exit(code ?? 0);
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
} catch (err) {
|
|
90
|
+
console.error(`Error: ${err.message}`);
|
|
91
|
+
process.exit(1);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
main();
|
package/package.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "palan-k-mcp",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "The Governance & Deployment Engine for Rust - AI 코딩 어시스턴트를 위한 통합형 MCP 서버",
|
|
5
|
+
"bin": {
|
|
6
|
+
"palan-k-mcp": "./bin/run.js"
|
|
7
|
+
},
|
|
8
|
+
"scripts": {
|
|
9
|
+
"postinstall": "node postinstall.js"
|
|
10
|
+
},
|
|
11
|
+
"optionalDependencies": {
|
|
12
|
+
"@palan-k/mcp-linux-x64": "0.2.0",
|
|
13
|
+
"@palan-k/mcp-darwin-arm64": "0.2.0",
|
|
14
|
+
"@palan-k/mcp-win32-x64": "0.2.0"
|
|
15
|
+
},
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/naegeon/palank-mcp.git"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"mcp",
|
|
22
|
+
"model-context-protocol",
|
|
23
|
+
"governance",
|
|
24
|
+
"deployment",
|
|
25
|
+
"rust",
|
|
26
|
+
"ai",
|
|
27
|
+
"claude"
|
|
28
|
+
],
|
|
29
|
+
"author": "Palan-K",
|
|
30
|
+
"license": "MIT",
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": ">=16.0.0"
|
|
33
|
+
},
|
|
34
|
+
"files": [
|
|
35
|
+
"bin/",
|
|
36
|
+
"postinstall.js",
|
|
37
|
+
"README.md"
|
|
38
|
+
]
|
|
39
|
+
}
|
package/postinstall.js
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Post-install script for palan-k-mcp
|
|
5
|
+
* Optionally configures MCP settings for Claude Desktop
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const fs = require('fs');
|
|
9
|
+
const path = require('path');
|
|
10
|
+
const os = require('os');
|
|
11
|
+
|
|
12
|
+
// Skip in CI
|
|
13
|
+
if (process.env.CI) {
|
|
14
|
+
process.exit(0);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function getPlatformPackage() {
|
|
18
|
+
const platform = os.platform();
|
|
19
|
+
const arch = os.arch();
|
|
20
|
+
|
|
21
|
+
const platformMap = {
|
|
22
|
+
'linux-x64': '@palan-k/mcp-linux-x64',
|
|
23
|
+
'linux-arm64': '@palan-k/mcp-linux-arm64',
|
|
24
|
+
'darwin-x64': '@palan-k/mcp-darwin-x64',
|
|
25
|
+
'darwin-arm64': '@palan-k/mcp-darwin-arm64',
|
|
26
|
+
'win32-x64': '@palan-k/mcp-win32-x64'
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
return platformMap[`${platform}-${arch}`];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function findBinary() {
|
|
33
|
+
const platform = os.platform();
|
|
34
|
+
const packageName = getPlatformPackage();
|
|
35
|
+
const binaryName = platform === 'win32' ? 'palan-k-mcp.exe' : 'palan-k-mcp';
|
|
36
|
+
|
|
37
|
+
if (!packageName) {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const possiblePaths = [
|
|
42
|
+
path.join(__dirname, 'node_modules', packageName, 'bin', binaryName),
|
|
43
|
+
path.join(__dirname, '..', packageName, 'bin', binaryName),
|
|
44
|
+
path.join(__dirname, '..', '..', packageName, 'bin', binaryName),
|
|
45
|
+
];
|
|
46
|
+
|
|
47
|
+
for (const p of possiblePaths) {
|
|
48
|
+
if (fs.existsSync(p)) {
|
|
49
|
+
return p;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function configureMcpSettings() {
|
|
56
|
+
const binaryPath = findBinary();
|
|
57
|
+
if (!binaryPath) {
|
|
58
|
+
console.log('Platform binary not found. MCP auto-config skipped.');
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const platform = os.platform();
|
|
63
|
+
let configPath;
|
|
64
|
+
|
|
65
|
+
if (platform === 'darwin') {
|
|
66
|
+
configPath = path.join(os.homedir(), 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json');
|
|
67
|
+
} else if (platform === 'win32') {
|
|
68
|
+
configPath = path.join(process.env.APPDATA || path.join(os.homedir(), 'AppData', 'Roaming'), 'Claude', 'claude_desktop_config.json');
|
|
69
|
+
} else {
|
|
70
|
+
configPath = path.join(process.env.XDG_CONFIG_HOME || path.join(os.homedir(), '.config'), 'Claude', 'claude_desktop_config.json');
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (process.env.PALAN_K_AUTO_CONFIG === 'true') {
|
|
74
|
+
let config = { mcpServers: {} };
|
|
75
|
+
|
|
76
|
+
if (fs.existsSync(configPath)) {
|
|
77
|
+
try {
|
|
78
|
+
config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
|
|
79
|
+
if (!config.mcpServers) config.mcpServers = {};
|
|
80
|
+
} catch (e) {
|
|
81
|
+
config = { mcpServers: {} };
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
config.mcpServers['palan-k-mcp'] = { command: binaryPath, args: [] };
|
|
86
|
+
fs.mkdirSync(path.dirname(configPath), { recursive: true });
|
|
87
|
+
fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
|
|
88
|
+
console.log(`MCP config updated: ${configPath}`);
|
|
89
|
+
} else {
|
|
90
|
+
console.log('\npalan-k-mcp installed successfully!');
|
|
91
|
+
console.log(`Binary: ${binaryPath}`);
|
|
92
|
+
console.log('\nTo enable in Claude Desktop, add to config:');
|
|
93
|
+
console.log(JSON.stringify({
|
|
94
|
+
"mcpServers": {
|
|
95
|
+
"palan-k-mcp": { "command": binaryPath, "args": [] }
|
|
96
|
+
}
|
|
97
|
+
}, null, 2));
|
|
98
|
+
console.log(`\nConfig location: ${configPath}`);
|
|
99
|
+
console.log('Or set PALAN_K_AUTO_CONFIG=true to auto-configure.\n');
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
configureMcpSettings();
|