mcp-ink 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.
- package/LICENSE +21 -0
- package/bin/ink-mcp.js +20 -0
- package/package.json +25 -0
- package/postinstall.js +103 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ink.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/bin/ink-mcp.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { execFileSync } = require("child_process");
|
|
4
|
+
const fs = require("fs");
|
|
5
|
+
const path = require("path");
|
|
6
|
+
|
|
7
|
+
const binDir = __dirname;
|
|
8
|
+
const executable = process.platform === "win32" ? "ink_mcp.exe" : "ink_mcp";
|
|
9
|
+
const binaryPath = path.join(binDir, executable);
|
|
10
|
+
|
|
11
|
+
if (!fs.existsSync(binaryPath)) {
|
|
12
|
+
console.error("@ink/mcp: binary not found. Run `npm install @ink/mcp` to download it.");
|
|
13
|
+
process.exit(1);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
try {
|
|
17
|
+
execFileSync(binaryPath, process.argv.slice(2), { stdio: "inherit" });
|
|
18
|
+
} catch (err) {
|
|
19
|
+
process.exit(err.status || 1);
|
|
20
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "mcp-ink",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Ink orchestration runtime — MCP server for IBM Bob Agent Mode",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": "https://github.com/dev-Ninjaa/ink",
|
|
7
|
+
"bin": {
|
|
8
|
+
"ink-mcp": "bin/ink-mcp.js",
|
|
9
|
+
"ink_mcp": "bin/ink-mcp.js"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"bin/",
|
|
13
|
+
"postinstall.js"
|
|
14
|
+
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"postinstall": "node postinstall.js"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"mcp",
|
|
20
|
+
"agent",
|
|
21
|
+
"orchestration",
|
|
22
|
+
"ibm",
|
|
23
|
+
"bob"
|
|
24
|
+
]
|
|
25
|
+
}
|
package/postinstall.js
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const https = require("https");
|
|
4
|
+
const http = require("http");
|
|
5
|
+
const { execSync } = require("child_process");
|
|
6
|
+
const fs = require("fs");
|
|
7
|
+
const path = require("path");
|
|
8
|
+
|
|
9
|
+
const REPO = "dev-Ninjaa/ink";
|
|
10
|
+
|
|
11
|
+
const PLATFORM_MAP = {
|
|
12
|
+
"x64-linux": { rust: "x86_64-unknown-linux-gnu", ext: "tar.gz" },
|
|
13
|
+
"arm64-darwin": { rust: "aarch64-apple-darwin", ext: "tar.gz" },
|
|
14
|
+
"x64-darwin": { rust: "x86_64-apple-darwin", ext: "tar.gz" },
|
|
15
|
+
"x64-win32": { rust: "x86_64-pc-windows-msvc", ext: "zip" },
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
function getPlatformKey() {
|
|
19
|
+
const arch = process.arch;
|
|
20
|
+
const platform = process.platform;
|
|
21
|
+
const key = `${arch}-${platform}`;
|
|
22
|
+
if (!PLATFORM_MAP[key]) {
|
|
23
|
+
throw new Error(
|
|
24
|
+
`Unsupported platform: ${arch}-${platform}\n` +
|
|
25
|
+
`Supported: ${Object.keys(PLATFORM_MAP).join(", ")}`
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
return key;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function resolveVersion() {
|
|
32
|
+
if (process.env.INK_MCP_VERSION) return process.env.INK_MCP_VERSION;
|
|
33
|
+
const pkg = require(path.join(__dirname, "package.json"));
|
|
34
|
+
return `v${pkg.version}`;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function download(url) {
|
|
38
|
+
return new Promise((resolve, reject) => {
|
|
39
|
+
const client = url.startsWith("https") ? https : http;
|
|
40
|
+
const follow = (u, depth = 0) => {
|
|
41
|
+
if (depth > 5) return reject(new Error("Too many redirects"));
|
|
42
|
+
client
|
|
43
|
+
.get(u, (res) => {
|
|
44
|
+
if ([301, 302, 307, 308].includes(res.statusCode)) {
|
|
45
|
+
return follow(res.headers.location, depth + 1);
|
|
46
|
+
}
|
|
47
|
+
if (res.statusCode !== 200) {
|
|
48
|
+
return reject(new Error(`HTTP ${res.statusCode} for ${u}`));
|
|
49
|
+
}
|
|
50
|
+
const chunks = [];
|
|
51
|
+
res.on("data", (c) => chunks.push(c));
|
|
52
|
+
res.on("end", () => resolve(Buffer.concat(chunks)));
|
|
53
|
+
res.on("error", reject);
|
|
54
|
+
})
|
|
55
|
+
.on("error", reject);
|
|
56
|
+
};
|
|
57
|
+
follow(url);
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
async function main() {
|
|
62
|
+
const key = getPlatformKey();
|
|
63
|
+
const { rust, ext } = PLATFORM_MAP[key];
|
|
64
|
+
const version = resolveVersion();
|
|
65
|
+
const binDir = path.join(__dirname, "bin");
|
|
66
|
+
const executable = process.platform === "win32" ? "ink_mcp.exe" : "ink_mcp";
|
|
67
|
+
const binaryPath = path.join(binDir, executable);
|
|
68
|
+
|
|
69
|
+
if (fs.existsSync(binaryPath)) {
|
|
70
|
+
console.log(`@ink/mcp: binary already present at ${binaryPath}`);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const filename = `ink_mcp-${rust}.${ext}`;
|
|
75
|
+
const url = `https://github.com/${REPO}/releases/download/${version}/${filename}`;
|
|
76
|
+
|
|
77
|
+
console.log(`@ink/mcp: downloading ${url}`);
|
|
78
|
+
|
|
79
|
+
fs.mkdirSync(binDir, { recursive: true });
|
|
80
|
+
const archivePath = path.join(binDir, filename);
|
|
81
|
+
const buf = await download(url);
|
|
82
|
+
fs.writeFileSync(archivePath, buf);
|
|
83
|
+
|
|
84
|
+
if (ext === "zip") {
|
|
85
|
+
execSync(`unzip -j -o "${archivePath}" -d "${binDir}"`, { stdio: "inherit" });
|
|
86
|
+
} else {
|
|
87
|
+
execSync(`tar -xzf "${archivePath}" -C "${binDir}"`, { stdio: "inherit" });
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
fs.rmSync(archivePath, { force: true });
|
|
91
|
+
|
|
92
|
+
if (process.platform !== "win32") {
|
|
93
|
+
fs.chmodSync(binaryPath, 0o755);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
console.log(`@ink/mcp: ready at ${binaryPath}`);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
main().catch((err) => {
|
|
100
|
+
console.error(`@ink/mcp: install failed — ${err.message}`);
|
|
101
|
+
console.error("You can set INK_MCP_VERSION to override the release tag.");
|
|
102
|
+
process.exit(1);
|
|
103
|
+
});
|