@cnb-rs/mcp 0.0.1-init → 1.0.0-beta.10
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 +67 -0
- package/bin/mcp.js +50 -0
- package/package.json +43 -5
package/README.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# @cnb-rs/cli
|
|
2
|
+
|
|
3
|
+
[![npm][badge-npm]][npm]
|
|
4
|
+
[![Node][badge-node]][npm]
|
|
5
|
+
[![Downloads][badge-downloads]][npm]
|
|
6
|
+
[![Release][badge-release]][cnb-releases]
|
|
7
|
+
[![CNB Repo][badge-cnb]][cnb-repo]
|
|
8
|
+
[![License][badge-license]][license]
|
|
9
|
+
|
|
10
|
+
Unofficial [CNB][cnb] command-line tool built with Rust.
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
# Global install
|
|
16
|
+
npm install -g @cnb-rs/cli
|
|
17
|
+
|
|
18
|
+
# One-off usage (no install needed)
|
|
19
|
+
npx @cnb-rs/cli --help
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Supported Node.js Versions
|
|
23
|
+
|
|
24
|
+
|Version|Status|
|
|
25
|
+
|-|-|
|
|
26
|
+
|22 LTS|✅|
|
|
27
|
+
|24 LTS|✅|
|
|
28
|
+
|26+|✅|
|
|
29
|
+
|
|
30
|
+
## Supported Platforms
|
|
31
|
+
|
|
32
|
+
|Platform|Architecture|
|
|
33
|
+
|-|-|
|
|
34
|
+
|Linux|x64, arm64|
|
|
35
|
+
|macOS (Darwin)|x64, arm64|
|
|
36
|
+
|Windows|x64, arm64|
|
|
37
|
+
|
|
38
|
+
## Documentation
|
|
39
|
+
|
|
40
|
+
- [文档站][docs]
|
|
41
|
+
- [仓库][cnb-repo]
|
|
42
|
+
|
|
43
|
+
## License
|
|
44
|
+
|
|
45
|
+
[GPL-3.0-or-later][license]
|
|
46
|
+
|
|
47
|
+
<!-- badges (alpha 阶段使用 /next tag;正式版发布后取消注释切换到 latest) -->
|
|
48
|
+
|
|
49
|
+
<!-- [badge-npm]: https://img.shields.io/npm/v/@cnb-rs/cli?style=flat-square -->
|
|
50
|
+
<!-- [badge-node]: https://img.shields.io/node/v/@cnb-rs/cli?style=flat-square -->
|
|
51
|
+
<!-- [badge-license]: https://img.shields.io/npm/l/@cnb-rs/cli?style=flat-square -->
|
|
52
|
+
|
|
53
|
+
[badge-npm]: https://img.shields.io/npm/v/@cnb-rs/cli/next?style=flat-square
|
|
54
|
+
[badge-node]: https://img.shields.io/node/v/@cnb-rs/cli/next?style=flat-square
|
|
55
|
+
[badge-downloads]: https://img.shields.io/npm/dm/@cnb-rs/cli?style=flat-square
|
|
56
|
+
[badge-release]: https://cnb.cool/wwvo/cnb-rs/cnb-rs/-/badge/release
|
|
57
|
+
[badge-cnb]: https://img.shields.io/badge/CNB-wwvo%2Fcnb--rs-2F80ED?style=flat-square&logo=cloudnativebuild&logoColor=white
|
|
58
|
+
[badge-license]: https://img.shields.io/badge/license-GPL--3.0--or--later-blue?style=flat-square
|
|
59
|
+
|
|
60
|
+
<!-- links -->
|
|
61
|
+
|
|
62
|
+
[npm]: https://www.npmjs.com/package/@cnb-rs/cli
|
|
63
|
+
[cnb-releases]: https://cnb.cool/wwvo/cnb-rs/cnb-rs/-/releases
|
|
64
|
+
[cnb-repo]: https://cnb.cool/wwvo/cnb-rs/cnb-rs
|
|
65
|
+
[cnb]: https://cnb.cool
|
|
66
|
+
[docs]: https://cnb.wwvo.fun
|
|
67
|
+
[license]: https://cnb.cool/wwvo/cnb-rs/cnb-rs/-/blob/main/LICENSE
|
package/bin/mcp.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
'use strict'
|
|
4
|
+
|
|
5
|
+
const { spawnSync } = require('child_process')
|
|
6
|
+
const path = require('path')
|
|
7
|
+
const os = require('os')
|
|
8
|
+
|
|
9
|
+
const PLATFORMS = {
|
|
10
|
+
'darwin-arm64': '@cnb-rs/mcp-darwin-arm64',
|
|
11
|
+
'darwin-x64': '@cnb-rs/mcp-darwin-x64',
|
|
12
|
+
'linux-arm64': '@cnb-rs/mcp-linux-arm64',
|
|
13
|
+
'linux-x64': '@cnb-rs/mcp-linux-x64',
|
|
14
|
+
'win32-arm64': '@cnb-rs/mcp-win32-arm64',
|
|
15
|
+
'win32-x64': '@cnb-rs/mcp-win32-x64',
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const platformKey = `${os.platform()}-${os.arch()}`
|
|
19
|
+
const pkg = PLATFORMS[/** @type {keyof typeof PLATFORMS} */ (platformKey)]
|
|
20
|
+
|
|
21
|
+
if (!pkg) {
|
|
22
|
+
console.error(`cnb-rs-mcp: unsupported platform "${platformKey}"\n` + `Supported platforms: ${Object.keys(PLATFORMS).join(', ')}`)
|
|
23
|
+
process.exit(1)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
let binPath
|
|
27
|
+
try {
|
|
28
|
+
const pkgDir = path.dirname(require.resolve(`${pkg}/package.json`))
|
|
29
|
+
const ext = os.platform() === 'win32' ? '.exe' : ''
|
|
30
|
+
binPath = path.join(pkgDir, 'bin', `cnb-rs-mcp${ext}`)
|
|
31
|
+
} catch {
|
|
32
|
+
console.error(`cnb-rs-mcp: could not locate the binary package "${pkg}".\n` + `This usually means the optional dependency was not installed.\n` + `Try reinstalling: npm install -g @cnb-rs/mcp`)
|
|
33
|
+
process.exit(1)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const result = spawnSync(binPath, process.argv.slice(2), {
|
|
37
|
+
stdio: 'inherit',
|
|
38
|
+
env: process.env,
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
if (result.error) {
|
|
42
|
+
if (/** @type {NodeJS.ErrnoException} */ (result.error).code === 'ENOENT') {
|
|
43
|
+
console.error(`cnb-rs-mcp: binary not found at "${binPath}"`)
|
|
44
|
+
} else {
|
|
45
|
+
console.error(`cnb-rs-mcp: ${result.error.message}`)
|
|
46
|
+
}
|
|
47
|
+
process.exit(1)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
process.exit(result.status ?? 1)
|
package/package.json
CHANGED
|
@@ -1,7 +1,45 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cnb-rs/mcp",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
}
|
|
3
|
+
"version": "1.0.0-beta.10",
|
|
4
|
+
"description": "CNB MCP Server — Rust-native MCP server for the CNB platform (cnb.cool)",
|
|
5
|
+
"bin": {
|
|
6
|
+
"cnb-rs-mcp": "bin/mcp.js"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"bin"
|
|
10
|
+
],
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/wwvl/Mia.git"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"cnb",
|
|
17
|
+
"cnb-rs",
|
|
18
|
+
"mcp",
|
|
19
|
+
"model-context-protocol",
|
|
20
|
+
"ai",
|
|
21
|
+
"claude",
|
|
22
|
+
"cursor",
|
|
23
|
+
"windsurf"
|
|
24
|
+
],
|
|
25
|
+
"author": "wwvo",
|
|
26
|
+
"license": "GPL-3.0-or-later",
|
|
27
|
+
"homepage": "https://cnb.cool/wwvo/cnb-rs/cnb-rs",
|
|
28
|
+
"bugs": {
|
|
29
|
+
"url": "https://cnb.cool/wwvo/cnb-rs/cnb-rs/-/issues"
|
|
30
|
+
},
|
|
31
|
+
"optionalDependencies": {
|
|
32
|
+
"@cnb-rs/mcp-darwin-arm64": "1.0.0-beta.10",
|
|
33
|
+
"@cnb-rs/mcp-darwin-x64": "1.0.0-beta.10",
|
|
34
|
+
"@cnb-rs/mcp-linux-arm64": "1.0.0-beta.10",
|
|
35
|
+
"@cnb-rs/mcp-linux-x64": "1.0.0-beta.10",
|
|
36
|
+
"@cnb-rs/mcp-win32-arm64": "1.0.0-beta.10",
|
|
37
|
+
"@cnb-rs/mcp-win32-x64": "1.0.0-beta.10"
|
|
38
|
+
},
|
|
39
|
+
"publishConfig": {
|
|
40
|
+
"access": "public"
|
|
41
|
+
},
|
|
42
|
+
"engines": {
|
|
43
|
+
"node": ">=18"
|
|
44
|
+
}
|
|
45
|
+
}
|