revsheller-mcp 0.0.0-stage → 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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 revsheller
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/README.md CHANGED
@@ -1,3 +1,36 @@
1
- # Temporary Holding Version
1
+ # revsheller-mcp
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ A stdio bridge to the [revsheller](https://revsheller.com) remote MCP server, for MCP clients that only start local processes. It reads JSON-RPC from stdin, posts each message to `https://revsheller.com/mcp` with your API key and writes the reply to stdout. It has no dependencies and needs Node 18 or newer.
4
+
5
+ revsheller gives an agent a hosted shell listener for CTF boxes and your own lab machines, and public https URLs for local web servers. Use it only on systems you own or have permission to test.
6
+
7
+ ## Setup
8
+
9
+ Create an API key on the [account page](https://revsheller.com/account), then add this to your client's config (for Claude Desktop, `claude_desktop_config.json`):
10
+
11
+ ```json
12
+ {
13
+ "mcpServers": {
14
+ "revsheller": {
15
+ "command": "npx",
16
+ "args": ["-y", "revsheller-mcp"],
17
+ "env": { "RSH_API_KEY": "rsh_your_api_key" }
18
+ }
19
+ }
20
+ }
21
+ ```
22
+
23
+ Clients that support remote servers over HTTP don't need this package. Point them at `https://revsheller.com/mcp` with the header `Authorization: Bearer rsh_your_api_key`.
24
+
25
+ ## Environment
26
+
27
+ | Variable | Meaning |
28
+ |----------|---------|
29
+ | `RSH_API_KEY` | Your key (`rsh_...`). Required for every call. |
30
+ | `RSH_MCP_URL` | Server URL. Defaults to `https://revsheller.com/mcp`. |
31
+
32
+ Docs are at [revsheller.com/api-docs#mcp](https://revsheller.com/api-docs#mcp).
33
+
34
+ ## License
35
+
36
+ MIT
@@ -0,0 +1,90 @@
1
+ #!/usr/bin/env node
2
+ // stdio bridge to the revsheller remote MCP server (https://revsheller.com/mcp).
3
+ // Reads newline-delimited JSON-RPC from stdin, POSTs each message to the server
4
+ // and writes the JSON reply to stdout. The server is stateless, so no session
5
+ // handshake or SSE is needed. No dependencies; needs Node 18+ for fetch.
6
+ "use strict";
7
+
8
+ const readline = require("node:readline");
9
+
10
+ const URL_ = process.env.RSH_MCP_URL || "https://revsheller.com/mcp";
11
+ const KEY = process.env.RSH_API_KEY || "";
12
+ // run_command waits up to 55 s and read_output up to 25 s, so leave headroom.
13
+ const TIMEOUT_MS = 90_000;
14
+
15
+ if (!KEY) {
16
+ process.stderr.write(
17
+ "revsheller-mcp: RSH_API_KEY is not set. tools/list will work, tool calls will fail.\n" +
18
+ "Create a key at https://revsheller.com/account\n",
19
+ );
20
+ }
21
+
22
+ function write(obj) {
23
+ process.stdout.write(JSON.stringify(obj) + "\n");
24
+ }
25
+
26
+ function rpcError(id, message) {
27
+ write({ jsonrpc: "2.0", id, error: { code: -32603, message } });
28
+ }
29
+
30
+ async function forward(line) {
31
+ let msg;
32
+ try {
33
+ msg = JSON.parse(line);
34
+ } catch {
35
+ write({ jsonrpc: "2.0", id: null, error: { code: -32700, message: "Parse error" } });
36
+ return;
37
+ }
38
+ const id = msg && typeof msg === "object" && "id" in msg ? msg.id : undefined;
39
+ const headers = {
40
+ "Content-Type": "application/json",
41
+ Accept: "application/json, text/event-stream",
42
+ };
43
+ if (KEY) headers.Authorization = `Bearer ${KEY}`;
44
+
45
+ let res;
46
+ try {
47
+ res = await fetch(URL_, {
48
+ method: "POST",
49
+ headers,
50
+ body: line,
51
+ signal: AbortSignal.timeout(TIMEOUT_MS),
52
+ });
53
+ } catch (err) {
54
+ if (id !== undefined) rpcError(id, `revsheller unreachable: ${err && err.message ? err.message : err}`);
55
+ return;
56
+ }
57
+
58
+ if (res.status === 202) return; // notification accepted, nothing to send back
59
+ const text = await res.text();
60
+ if (!text) {
61
+ if (id !== undefined) rpcError(id, `HTTP ${res.status} with an empty body`);
62
+ return;
63
+ }
64
+ let body;
65
+ try {
66
+ body = JSON.parse(text);
67
+ } catch {
68
+ if (id !== undefined) rpcError(id, `HTTP ${res.status}: ${text.slice(0, 200)}`);
69
+ return;
70
+ }
71
+ if (body && body.jsonrpc === "2.0") {
72
+ write(body);
73
+ } else if (id !== undefined) {
74
+ // Plain JSON errors (for example a missing or bad API key) become JSON-RPC errors.
75
+ const reason = body && body.error ? body.error : `HTTP ${res.status}`;
76
+ rpcError(id, body && body.hint ? `${reason} (${body.hint})` : reason);
77
+ }
78
+ }
79
+
80
+ const pending = new Set();
81
+ const rl = readline.createInterface({ input: process.stdin, crlfDelay: Infinity });
82
+ rl.on("line", (line) => {
83
+ if (!line.trim()) return;
84
+ const p = forward(line).finally(() => pending.delete(p));
85
+ pending.add(p);
86
+ });
87
+ rl.on("close", async () => {
88
+ await Promise.allSettled([...pending]);
89
+ process.exit(0);
90
+ });
package/package.json CHANGED
@@ -1,6 +1,12 @@
1
1
  {
2
2
  "name": "revsheller-mcp",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.0.0",
4
+ "description": "stdio MCP bridge to revsheller, a hosted shell relay for CTFs, labs and authorized testing",
5
+ "bin": { "revsheller-mcp": "bin/revsheller-mcp.js" },
6
+ "files": ["bin", "README.md", "LICENSE"],
7
+ "engines": { "node": ">=18" },
8
+ "keywords": ["mcp", "model-context-protocol", "ctf", "reverse-shell", "pentesting-labs", "security"],
9
+ "homepage": "https://revsheller.com/guides/ai-agent-shell-mcp",
10
+ "license": "MIT",
11
+ "mcpName": "com.revsheller/revsheller"
12
+ }