@krowk/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/README.md +50 -0
- package/bin/krowk-mcp.js +104 -0
- package/package.json +37 -0
package/README.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# @krowk/mcp
|
|
2
|
+
|
|
3
|
+
The krowk MCP server. It gives an agent `krowk_push`, `krowk_list_artifacts`,
|
|
4
|
+
`krowk_get_artifact`, `krowk_claim_artifact`, `krowk_get_run` and
|
|
5
|
+
`krowk_verify_key` over stdio, so output from a task becomes a permalink without
|
|
6
|
+
anybody shelling out.
|
|
7
|
+
|
|
8
|
+
```json
|
|
9
|
+
{
|
|
10
|
+
"mcpServers": {
|
|
11
|
+
"krowk": {
|
|
12
|
+
"command": "npx",
|
|
13
|
+
"args": ["-y", "@krowk/mcp"],
|
|
14
|
+
"env": { "KROWK_TOKEN": "krowk_sk_..." }
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Uploads are confined to a root directory — the working directory by default,
|
|
21
|
+
`--root` or `KROWK_MCP_ROOT` to say otherwise. The model picks the paths, so the
|
|
22
|
+
boundary is what keeps an instruction hidden in a repository file from
|
|
23
|
+
publishing something else entirely.
|
|
24
|
+
|
|
25
|
+
## What this package is
|
|
26
|
+
|
|
27
|
+
A launcher. The server itself is a single static Go binary, `krowk-mcp`.
|
|
28
|
+
Installing this package pulls one more package — `@krowk/cli-linux-x64` or
|
|
29
|
+
whichever matches your machine — through the same npm registry as everything
|
|
30
|
+
else. The platform packages carry both binaries, which is why the one this
|
|
31
|
+
server needs is named for the CLI. There
|
|
32
|
+
is no postinstall script and no download from a second host, so it works behind
|
|
33
|
+
a proxy, under `npm ci --ignore-scripts`, and off a private mirror.
|
|
34
|
+
|
|
35
|
+
If Node is not already in the picture, point the client at the binary instead:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
go install github.com/krowkcom/cli/cmd/krowk-mcp@latest
|
|
39
|
+
# or grab an archive from https://github.com/krowkcom/cli/releases/latest
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
```json
|
|
43
|
+
{ "mcpServers": { "krowk": { "command": "krowk-mcp" } } }
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Documentation
|
|
47
|
+
|
|
48
|
+
Tools, arguments, and the errors they return: <https://github.com/krowkcom/cli>.
|
|
49
|
+
|
|
50
|
+
MIT.
|
package/bin/krowk-mcp.js
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Find the binary npm installed for this platform, then become it.
|
|
3
|
+
//
|
|
4
|
+
// The binary arrives as an optional dependency, not as a postinstall download,
|
|
5
|
+
// so the only host an install talks to is the npm registry the machine is
|
|
6
|
+
// already pointed at. That is what makes this work behind a proxy, under
|
|
7
|
+
// `npm ci --ignore-scripts`, and off a private mirror.
|
|
8
|
+
//
|
|
9
|
+
// MCP speaks over stdio, so the passthrough below has to be exactly that:
|
|
10
|
+
// inherited file descriptors, nothing in this process reading or writing them.
|
|
11
|
+
//
|
|
12
|
+
// This file is duplicated in npm/krowk/bin/krowk.js. Two published packages each
|
|
13
|
+
// have to stand alone, and a shared module would mean a third package or a
|
|
14
|
+
// codegen step to save sixty lines. npm/build.mjs checks both copies name the
|
|
15
|
+
// same platforms, which is the drift that would actually bite.
|
|
16
|
+
"use strict";
|
|
17
|
+
|
|
18
|
+
const { spawnSync } = require("node:child_process");
|
|
19
|
+
const path = require("node:path");
|
|
20
|
+
|
|
21
|
+
// Keyed by `${process.platform}-${process.arch}`, so the lookup is the identity.
|
|
22
|
+
const PACKAGES = {
|
|
23
|
+
"darwin-arm64": "@krowk/cli-darwin-arm64",
|
|
24
|
+
"darwin-x64": "@krowk/cli-darwin-x64",
|
|
25
|
+
"linux-arm64": "@krowk/cli-linux-arm64",
|
|
26
|
+
"linux-x64": "@krowk/cli-linux-x64",
|
|
27
|
+
"win32-x64": "@krowk/cli-win32-x64",
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const BINARY = "krowk-mcp";
|
|
31
|
+
|
|
32
|
+
// fail prints the reason and the next action, then stops. Nothing readable
|
|
33
|
+
// reaches an MCP client from here — stdout is the protocol — so the whole
|
|
34
|
+
// explanation goes to stderr, where the client logs it.
|
|
35
|
+
function fail(lines) {
|
|
36
|
+
process.stderr.write(BINARY + ": " + lines.join("\n") + "\n");
|
|
37
|
+
process.exit(1);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function locate() {
|
|
41
|
+
const host = process.platform + "-" + process.arch;
|
|
42
|
+
const pkg = PACKAGES[host];
|
|
43
|
+
|
|
44
|
+
if (!pkg) {
|
|
45
|
+
fail([
|
|
46
|
+
"no prebuilt binary for " + host + ".",
|
|
47
|
+
"",
|
|
48
|
+
"Built for: " + Object.keys(PACKAGES).sort().join(", ") + ".",
|
|
49
|
+
"Everywhere else, build it yourself — the server is pure Go:",
|
|
50
|
+
"",
|
|
51
|
+
" go install github.com/krowkcom/cli/cmd/krowk-mcp@latest",
|
|
52
|
+
]);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
let manifest;
|
|
56
|
+
try {
|
|
57
|
+
manifest = require.resolve(pkg + "/package.json");
|
|
58
|
+
} catch {
|
|
59
|
+
fail([
|
|
60
|
+
pkg + " is not installed, so there is no " + BINARY + " binary to run.",
|
|
61
|
+
"",
|
|
62
|
+
"It is an optional dependency, and installers skip those under",
|
|
63
|
+
"--no-optional, --omit=optional and --ignore-optional. A lockfile",
|
|
64
|
+
"written on another platform does the same thing.",
|
|
65
|
+
"",
|
|
66
|
+
" npm install @krowk/mcp --include=optional",
|
|
67
|
+
"",
|
|
68
|
+
"Or take the binary straight from the release, no Node involved:",
|
|
69
|
+
"",
|
|
70
|
+
" https://github.com/krowkcom/cli/releases/latest",
|
|
71
|
+
]);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return path.join(
|
|
75
|
+
path.dirname(manifest),
|
|
76
|
+
"bin",
|
|
77
|
+
BINARY + (process.platform === "win32" ? ".exe" : ""),
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const binary = locate();
|
|
82
|
+
|
|
83
|
+
// stdio: "inherit" hands the child the real file descriptors, so the MCP client
|
|
84
|
+
// on the other end is talking to the Go server directly.
|
|
85
|
+
const result = spawnSync(binary, process.argv.slice(2), { stdio: "inherit" });
|
|
86
|
+
|
|
87
|
+
if (result.error) {
|
|
88
|
+
fail([
|
|
89
|
+
"could not run " + binary + ": " + result.error.message,
|
|
90
|
+
"",
|
|
91
|
+
"The file is there but would not start. On a shared volume or an",
|
|
92
|
+
"extracted archive that usually means the execute bit was lost:",
|
|
93
|
+
"",
|
|
94
|
+
" chmod +x " + binary,
|
|
95
|
+
]);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Re-raise the signal that killed the child, so `krowk-mcp` dies the way the
|
|
99
|
+
// binary did and a client waiting on the exit status reads the same thing.
|
|
100
|
+
if (result.signal) {
|
|
101
|
+
process.kill(process.pid, result.signal);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
process.exit(result.status === null ? 1 : result.status);
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@krowk/mcp",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "MCP server for krowk — permalinks for agent output, over stdio.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"krowk",
|
|
7
|
+
"mcp",
|
|
8
|
+
"model-context-protocol",
|
|
9
|
+
"screenshot",
|
|
10
|
+
"permalink",
|
|
11
|
+
"agent"
|
|
12
|
+
],
|
|
13
|
+
"homepage": "https://krowk.com",
|
|
14
|
+
"bugs": "https://github.com/krowkcom/cli/issues",
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/krowkcom/cli.git",
|
|
18
|
+
"directory": "npm/mcp"
|
|
19
|
+
},
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"bin": {
|
|
22
|
+
"krowk-mcp": "bin/krowk-mcp.js"
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"bin"
|
|
26
|
+
],
|
|
27
|
+
"engines": {
|
|
28
|
+
"node": ">=18"
|
|
29
|
+
},
|
|
30
|
+
"optionalDependencies": {
|
|
31
|
+
"@krowk/cli-darwin-arm64": "0.1.1",
|
|
32
|
+
"@krowk/cli-darwin-x64": "0.1.1",
|
|
33
|
+
"@krowk/cli-linux-arm64": "0.1.1",
|
|
34
|
+
"@krowk/cli-linux-x64": "0.1.1",
|
|
35
|
+
"@krowk/cli-win32-x64": "0.1.1"
|
|
36
|
+
}
|
|
37
|
+
}
|