remote-access-mcp 1.0.6 → 1.1.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.fa.md +29 -70
- package/README.md +92 -65
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +354 -133
- package/dist/cli/main.js.map +1 -1
- package/dist/core/audit.d.ts +40 -0
- package/dist/core/audit.d.ts.map +1 -0
- package/dist/core/audit.js +96 -0
- package/dist/core/audit.js.map +1 -0
- package/dist/core/config.d.ts +37 -5
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +111 -34
- package/dist/core/config.js.map +1 -1
- package/dist/core/context.d.ts +23 -0
- package/dist/core/context.d.ts.map +1 -0
- package/dist/core/context.js +32 -0
- package/dist/core/context.js.map +1 -0
- package/dist/core/crypto.d.ts +6 -0
- package/dist/core/crypto.d.ts.map +1 -0
- package/dist/core/crypto.js +16 -0
- package/dist/core/crypto.js.map +1 -0
- package/dist/core/policy.d.ts +19 -0
- package/dist/core/policy.d.ts.map +1 -1
- package/dist/core/policy.js +57 -0
- package/dist/core/policy.js.map +1 -1
- package/dist/core/rate-limit.d.ts +14 -0
- package/dist/core/rate-limit.d.ts.map +1 -0
- package/dist/core/rate-limit.js +67 -0
- package/dist/core/rate-limit.js.map +1 -0
- package/dist/server/app.d.ts +18 -1
- package/dist/server/app.d.ts.map +1 -1
- package/dist/server/app.js +123 -24
- package/dist/server/app.js.map +1 -1
- package/dist/server/run.d.ts +5 -1
- package/dist/server/run.d.ts.map +1 -1
- package/dist/server/run.js +31 -8
- package/dist/server/run.js.map +1 -1
- package/dist/tools/filesystem.d.ts +3 -2
- package/dist/tools/filesystem.d.ts.map +1 -1
- package/dist/tools/filesystem.js +34 -23
- package/dist/tools/filesystem.js.map +1 -1
- package/dist/tools/git.d.ts +2 -2
- package/dist/tools/git.d.ts.map +1 -1
- package/dist/tools/git.js +33 -4
- package/dist/tools/git.js.map +1 -1
- package/dist/tools/http.d.ts +2 -1
- package/dist/tools/http.d.ts.map +1 -1
- package/dist/tools/http.js +47 -5
- package/dist/tools/http.js.map +1 -1
- package/dist/tools/index.d.ts +6 -3
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +29 -9
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/logs.d.ts +4 -0
- package/dist/tools/logs.d.ts.map +1 -0
- package/dist/tools/logs.js +78 -0
- package/dist/tools/logs.js.map +1 -0
- package/dist/tools/packages.d.ts +4 -0
- package/dist/tools/packages.d.ts.map +1 -0
- package/dist/tools/packages.js +75 -0
- package/dist/tools/packages.js.map +1 -0
- package/dist/tools/planning.d.ts +4 -0
- package/dist/tools/planning.d.ts.map +1 -0
- package/dist/tools/planning.js +118 -0
- package/dist/tools/planning.js.map +1 -0
- package/dist/tools/policy.d.ts +7 -2
- package/dist/tools/policy.d.ts.map +1 -1
- package/dist/tools/policy.js +29 -18
- package/dist/tools/policy.js.map +1 -1
- package/dist/tools/project.d.ts +4 -0
- package/dist/tools/project.d.ts.map +1 -0
- package/dist/tools/project.js +141 -0
- package/dist/tools/project.js.map +1 -0
- package/dist/tools/schedule.d.ts +17 -0
- package/dist/tools/schedule.d.ts.map +1 -0
- package/dist/tools/schedule.js +113 -0
- package/dist/tools/schedule.js.map +1 -0
- package/dist/tools/security.d.ts +4 -0
- package/dist/tools/security.d.ts.map +1 -0
- package/dist/tools/security.js +103 -0
- package/dist/tools/security.js.map +1 -0
- package/dist/tools/services.d.ts +4 -0
- package/dist/tools/services.d.ts.map +1 -0
- package/dist/tools/services.js +56 -0
- package/dist/tools/services.js.map +1 -0
- package/dist/tools/shell.d.ts +2 -2
- package/dist/tools/shell.d.ts.map +1 -1
- package/dist/tools/shell.js +25 -10
- package/dist/tools/shell.js.map +1 -1
- package/dist/tools/sqlite.d.ts +2 -2
- package/dist/tools/sqlite.d.ts.map +1 -1
- package/dist/tools/sqlite.js +44 -9
- package/dist/tools/sqlite.js.map +1 -1
- package/dist/tools/system.d.ts +2 -1
- package/dist/tools/system.d.ts.map +1 -1
- package/dist/tools/system.js +6 -2
- package/dist/tools/system.js.map +1 -1
- package/dist/tools/web.d.ts +4 -0
- package/dist/tools/web.d.ts.map +1 -0
- package/dist/tools/web.js +77 -0
- package/dist/tools/web.js.map +1 -0
- package/package.json +1 -1
package/README.fa.md
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
# remote-access-mcp
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/remote-access-mcp)
|
|
4
|
+
[](https://github.com/AmirAliManzar/remote-access-mcp/actions/workflows/ci.yml)
|
|
4
5
|
[](https://opensource.org/licenses/MIT)
|
|
5
6
|
|
|
6
7
|
هر سرور لینوکسی رو با MCP ([Model Context Protocol](https://modelcontextprotocol.io)) به ماشینی تبدیل کن که هوش مصنوعی بهش وصل بشه.
|
|
7
8
|
|
|
8
|
-
ChatGPT (حالت Developer)، Claude، Grok و هر کلاینت MCP-دیگه از طریق HTTPS وصل میشن و بهصورت امن سرورت رو کنترل
|
|
9
|
+
ChatGPT (حالت Developer)، Claude، Grok و هر کلاینت MCP-دیگه از طریق HTTPS وصل میشن و بهصورت امن سرورت رو کنترل میکنن — همه پشت دسترسیهای per-token.
|
|
9
10
|
|
|
10
11
|
**بدون پایتون. بدون داکر. فقط Node.js.**
|
|
11
12
|
|
|
@@ -14,96 +15,54 @@ npm install -g remote-access-mcp
|
|
|
14
15
|
ramcp init
|
|
15
16
|
```
|
|
16
17
|
|
|
17
|
-
## فلسفه
|
|
18
|
-
|
|
19
|
-
دستیارهای هوش مصنوعی قویان ولی از زیرساخت شما دورن. این گیتوی اون رو برعکس میکنه: چتبات شما خودش مهندس DevOps میشه. «ببین چرا دیسک سرور پر میشه» یا «برنچ جدید رو دیپلوی کن و لاگها رو نگاه کن» تبدیل به گفتگوهای واقعی میشن.
|
|
20
|
-
|
|
21
|
-
سرور فقط روی `127.0.0.1` گوش میده. پشت nginx/Caddy (با Cloudflare یا هر لبه TLS دیگه) قرارش میدی و دقیقاً یک endpoint HTTPS به دنیا ارائه میشه. هر درخواست باید توکن داشته باشه — یا بهصورت هدر `Authorization: Bearer` یا داخل مسیر URL (`/<token>/mcp`) برای کلاینتهایی مثل کانکتور ChatGPT که نمیتونن هدر سفارشی ست کنن.
|
|
22
|
-
|
|
23
18
|
## نصب
|
|
24
19
|
|
|
25
|
-
### یک خطی (هر سرور اوبونتو/دبیان)
|
|
26
|
-
|
|
27
20
|
```bash
|
|
28
21
|
curl -fsSL https://raw.githubusercontent.com/AmirAliManzar/remote-access-mcp/main/install.sh | bash
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
سپس:
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
22
|
ramcp init
|
|
35
23
|
```
|
|
36
24
|
|
|
37
|
-
|
|
25
|
+
## شروع سریع
|
|
38
26
|
|
|
39
27
|
```bash
|
|
40
|
-
|
|
41
|
-
ramcp
|
|
28
|
+
ramcp init # کانفیگ + اولین توکن
|
|
29
|
+
ramcp policy allow /srv/myapp # چه مسیرهایی رو AI ببینه
|
|
30
|
+
ramcp policy shell on # اجازه اجرای دستور (اختیاری)
|
|
31
|
+
ramcp service install --domain mcp.example.com # systemd + nginx
|
|
32
|
+
ramcp doctor # بررسی سلامت همهچیز
|
|
33
|
+
ramcp url # URL کانکتور برای چتبات
|
|
42
34
|
```
|
|
43
35
|
|
|
44
|
-
##
|
|
45
|
-
|
|
46
|
-
| دستور | توضیح |
|
|
47
|
-
|---|---|
|
|
48
|
-
| `ramcp init` | ساخت کانفیگ + توکن. اجرای مجدد امنه. |
|
|
49
|
-
| `ramcp start` | اجرا در foreground. |
|
|
50
|
-
| `ramcp url` | چاپ URL کانکتور برای چتبات. |
|
|
51
|
-
| `ramcp token rotate` | تولید توکن جدید (قبلی فوراً باطل میشه). |
|
|
52
|
-
| `ramcp policy` | نمایش مسیرهای مجاز. |
|
|
53
|
-
| `ramcp policy allow <path>` | دادن دسترسی AI به یک دایرکتوری. |
|
|
54
|
-
| `ramcp policy deny <path>` | سلب دسترسی از یک دایرکتوری. |
|
|
55
|
-
| `ramcp policy shell on/off` | فعال/غیرفعال کردن اجرای شل. |
|
|
56
|
-
| `ramcp service install` | نصب سرویس systemd + vhostnginx. |
|
|
57
|
-
| `ramcp service uninstall` | حذف سرویس و کانفیگ nginx. |
|
|
58
|
-
| `ramcp status` | وضعیت سرویس. |
|
|
59
|
-
|
|
60
|
-
## اتصال چتبات
|
|
61
|
-
|
|
62
|
-
### ChatGPT (Developer Mode → Connectors)
|
|
63
|
-
|
|
64
|
-
از فرمت URL استفاده کن (ChatGPT نمیتونه هدر سفارشی ست کنه):
|
|
65
|
-
|
|
66
|
-
```
|
|
67
|
-
https://دامنه.com/<token>/mcp
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
آمادهش رو بگیر:
|
|
36
|
+
## توکنهای چندگانه — کمترین دسترسی بهصورت پیشفرض
|
|
71
37
|
|
|
72
38
|
```bash
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
### Claude و هر کلاینت MCP با پشتیبانی هدر
|
|
78
|
-
|
|
79
|
-
Endpoint: `https://دامنه.com/mcp`
|
|
80
|
-
هدر: `Authorization: Bearer <token>`
|
|
39
|
+
# توکن فقط-خواندنی برای ممیزی
|
|
40
|
+
ramcp token add --name auditor --paths /srv --scopes filesystem --read-only
|
|
81
41
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
**شل** (۳) — `run_command`, `process_list`, `kill_process`
|
|
87
|
-
|
|
88
|
-
**سیستم** (۳) — `system_info`, `disk_usage`, `network_interfaces`
|
|
89
|
-
|
|
90
|
-
**HTTP** (۲) — `http_request`, `port_check`
|
|
42
|
+
# توکن دیپلوی: فایل + گیت + شل، با محدودیت نرخ و انقضا
|
|
43
|
+
ramcp token add --name deploy --paths /srv/app --scopes filesystem,git,shell --shell --rpm 30 --expires 2026-12-31
|
|
44
|
+
```
|
|
91
45
|
|
|
92
|
-
|
|
46
|
+
هر توکن خودش داره: مسیرهای مجاز/غیرمجاز، گروه ابزارها (scopes)، فلگ شل، حالت فقط-خواندنی، محدودیت نرخ، و تاریخ انقضا.
|
|
93
47
|
|
|
94
|
-
|
|
48
|
+
## ۳۸ ابزار در ۱۵ گروه
|
|
95
49
|
|
|
96
|
-
|
|
50
|
+
فایلسیستم (۷)، شل (۳)، سیستم (۳)، HTTP با محافظ SSRF (۳)، گیت با whitelist فعلها (۱)، SQLite تک-دستوره (۲)، لاگ/journalctl (۳)، سرویسهای systemd (۲)، پکیجها apt/npm (۳)، زمانبند (۳)، اسکن امنیتی (۲)، تحلیل پروژه (۲)، پلنینگ + اسنپشات/rollback (۴)، مدیریت پالیسی (۴).
|
|
97
51
|
|
|
98
52
|
## مدل امنیتی
|
|
99
53
|
|
|
100
|
-
- **فقط loopback
|
|
101
|
-
-
|
|
102
|
-
-
|
|
103
|
-
-
|
|
104
|
-
-
|
|
54
|
+
- **فقط loopback** — سرور روی `127.0.0.1` گوش میده
|
|
55
|
+
- **توکن timing-safe** روی هر درخواست — در لاگها فقط fingerprint ذخیره میشه
|
|
56
|
+
- **Sandbox per-token** — resolve سیملینک و `..` قبل از چک؛ deny همیشه برندهست
|
|
57
|
+
- **محدودههای SSRF بسته** — AI نمیتونه به metadata کلود یا سرویسهای داخلی برسه
|
|
58
|
+
- **ضد injection** — فعلهای git whitelist، SQL تک-دستوره، ATTACH بسته
|
|
59
|
+
- **لاگ audit ضد-دستکاری** — hash chain؛ `ramcp audit --verify` هر حذف/ویرایش رو لو میده؛ رازهای داخل آرگومانها redact میشن
|
|
60
|
+
- **Hot-reload** — تغییر پالیسی از درخواست بعدی اعمال میشه، بدون ریستارت
|
|
61
|
+
- **کلید-کشِ حالت فقط-خواندن** — `ramcp policy readonly on` همه ابزارهای تغییردهنده رو قفل میکنه
|
|
62
|
+
|
|
63
|
+
## دستورات کامل
|
|
105
64
|
|
|
106
|
-
|
|
65
|
+
`init` `start` `url` `doctor` `status` `token list|add|show|rotate|revoke` `policy [token] allow|deny|shell|readonly` `audit [--verify]` `service install|uninstall|logs|status` `schedule list` — جزئیات: [README انگلیسی](README.md)
|
|
107
66
|
|
|
108
67
|
## مجوز
|
|
109
68
|
|
package/README.md
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
# remote-access-mcp
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/remote-access-mcp)
|
|
4
|
+
[](https://github.com/AmirAliManzar/remote-access-mcp/actions/workflows/ci.yml)
|
|
4
5
|
[](https://opensource.org/licenses/MIT)
|
|
5
6
|
|
|
6
7
|
Turn any Linux server into an AI-agent-accessible machine via the [Model Context Protocol](https://modelcontextprotocol.io) (MCP).
|
|
7
8
|
|
|
8
|
-
ChatGPT (Developer Mode), Claude, Grok, and any MCP-compatible client connect over HTTPS and securely control your server: read/write files, run shell commands,
|
|
9
|
+
ChatGPT (Developer Mode), Claude, Grok, and any MCP-compatible client connect over HTTPS and securely control your server: read/write files, run shell commands, manage services, query databases, audit everything — all behind per-token permissions.
|
|
9
10
|
|
|
10
11
|
**Zero Python. Zero Docker. Just Node.js.**
|
|
11
12
|
|
|
@@ -16,9 +17,9 @@ ramcp init
|
|
|
16
17
|
|
|
17
18
|
## Why
|
|
18
19
|
|
|
19
|
-
AI assistants are great, but they're sandboxed away from your infrastructure. This gateway flips that: your chatbot *becomes* the ops engineer. "Check why the disk is filling up
|
|
20
|
+
AI assistants are great, but they're sandboxed away from your infrastructure. This gateway flips that: your chatbot *becomes* the ops engineer. "Check why the disk is filling up, fix it, and show me the logs" becomes an actual conversation.
|
|
20
21
|
|
|
21
|
-
The server binds to `127.0.0.1` only. You put it behind nginx
|
|
22
|
+
The server binds to `127.0.0.1` only. You put it behind nginx (with Cloudflare or any TLS edge in front) and expose exactly one HTTPS endpoint to the world. Every request carries a token — as an `Authorization: Bearer` header or embedded in the URL path (`/<token>/mcp`) for clients like ChatGPT's connectors that can't set custom headers.
|
|
22
23
|
|
|
23
24
|
## Install
|
|
24
25
|
|
|
@@ -26,11 +27,6 @@ The server binds to `127.0.0.1` only. You put it behind nginx/Caddy (with Cloudf
|
|
|
26
27
|
|
|
27
28
|
```bash
|
|
28
29
|
curl -fsSL https://raw.githubusercontent.com/AmirAliManzar/remote-access-mcp/main/install.sh | bash
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
Installs Node.js (if missing) via NodeSource, then the package globally. Then run:
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
30
|
ramcp init
|
|
35
31
|
```
|
|
36
32
|
|
|
@@ -44,100 +40,131 @@ ramcp init
|
|
|
44
40
|
## Quick start
|
|
45
41
|
|
|
46
42
|
```bash
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|___/ remote-access-mcp v1.0.0
|
|
54
|
-
|
|
55
|
-
✔ Config written to /root/.config/remote-access-mcp/config.json
|
|
56
|
-
✔ Token generated: 6kX9mQ... (stored in config, never shown again in full)
|
|
57
|
-
✔ Test the server: ramcp start --dry-run
|
|
58
|
-
|
|
59
|
-
Next steps:
|
|
60
|
-
1. ramcp start # run in foreground
|
|
61
|
-
2. ramcp service install # systemd unit + nginx vhost (recommended)
|
|
62
|
-
3. ramcp url # show the connector URL for your chatbot
|
|
43
|
+
ramcp init # config + first token
|
|
44
|
+
ramcp policy allow /srv/myapp # what the AI may touch
|
|
45
|
+
ramcp policy shell on # let it run commands (optional)
|
|
46
|
+
ramcp service install --domain mcp.example.com # systemd + nginx
|
|
47
|
+
ramcp doctor # verify everything end-to-end
|
|
48
|
+
ramcp url # connector URL for your chatbot
|
|
63
49
|
```
|
|
64
50
|
|
|
65
51
|
## Commands
|
|
66
52
|
|
|
67
53
|
| Command | Description |
|
|
68
54
|
|---|---|
|
|
69
|
-
| `ramcp init` | Generate config + token. Safe to re-run. |
|
|
70
|
-
| `ramcp start` | Run
|
|
71
|
-
| `ramcp url` |
|
|
72
|
-
| `ramcp
|
|
73
|
-
| `ramcp
|
|
74
|
-
| `ramcp
|
|
75
|
-
| `ramcp
|
|
76
|
-
| `ramcp
|
|
77
|
-
| `ramcp
|
|
78
|
-
| `ramcp
|
|
79
|
-
| `ramcp
|
|
55
|
+
| `ramcp init` | Generate config + first token. Safe to re-run. |
|
|
56
|
+
| `ramcp start [--read-only]` | Run in the foreground. |
|
|
57
|
+
| `ramcp url [token]` | Connector URL for a chatbot. |
|
|
58
|
+
| `ramcp doctor` | One-pass diagnosis: tokens, port, gateway, nginx, public URL, audit chain. |
|
|
59
|
+
| `ramcp status` | Service + config summary. |
|
|
60
|
+
| `ramcp token list [--json]` | All tokens (fingerprints only). |
|
|
61
|
+
| `ramcp token add --name N` | Create a scoped token — see options below. |
|
|
62
|
+
| `ramcp token rotate [name]` | Rotate a token (old one dies instantly). |
|
|
63
|
+
| `ramcp token revoke name` | Delete a token. |
|
|
64
|
+
| `ramcp policy [token]` | Show/set path policy, shell flag. |
|
|
65
|
+
| `ramcp policy readonly on` | Global kill-switch for ALL mutating tools. |
|
|
66
|
+
| `ramcp audit [--tool T]` | Query the audit log. `--verify` checks the hash chain. |
|
|
67
|
+
| `ramcp service install` | systemd unit (+ nginx vhost with `--domain`). |
|
|
68
|
+
| `ramcp service logs -f` | Tail gateway logs. |
|
|
69
|
+
| `ramcp schedule list` | List scheduled tasks. |
|
|
70
|
+
|
|
71
|
+
### `token add` options
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
ramcp token add --name chatgpt \
|
|
75
|
+
--paths /srv/app \ # allowed directories (symlink-safe)
|
|
76
|
+
--deny /srv/app/.env \ # explicitly denied (deny always wins)
|
|
77
|
+
--shell \ # allow shell commands (default: off)
|
|
78
|
+
--scopes filesystem,git \ # limit to tool groups (default: all)
|
|
79
|
+
--read-only \ # refuse every mutating tool
|
|
80
|
+
--rpm 30 \ # max requests per minute
|
|
81
|
+
--expires 2026-12-31 # auto-expiry
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Example — a token that can only read files, never write or execute:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
ramcp token add --name auditor --paths /srv --scopes filesystem --read-only
|
|
88
|
+
```
|
|
80
89
|
|
|
81
90
|
## Connecting your chatbot
|
|
82
91
|
|
|
83
92
|
### ChatGPT (Developer Mode → Connectors)
|
|
84
93
|
|
|
85
|
-
Use the URL form (ChatGPT can't set custom headers):
|
|
86
|
-
|
|
87
94
|
```
|
|
88
95
|
https://your-domain.com/<token>/mcp
|
|
89
96
|
```
|
|
90
97
|
|
|
91
|
-
Get it ready-made:
|
|
92
|
-
|
|
93
|
-
```bash
|
|
94
|
-
$ ramcp url
|
|
95
|
-
https://mcp.example.com/6kX9mQf2.../mcp
|
|
96
|
-
```
|
|
98
|
+
Get it ready-made: `ramcp url`
|
|
97
99
|
|
|
98
100
|
### Claude / any MCP client with header support
|
|
99
101
|
|
|
100
|
-
Endpoint
|
|
101
|
-
|
|
102
|
+
Endpoint `https://your-domain.com/mcp` + header `Authorization: Bearer <token>`
|
|
103
|
+
|
|
104
|
+
## Tools (38 across 15 suites)
|
|
105
|
+
|
|
106
|
+
**Filesystem** (7) `list_directory` `read_file` (offset/limit) `write_file` `edit_file` `delete_path` `search_code` `file_info`
|
|
107
|
+
|
|
108
|
+
**Shell** (3) `run_command` (opt-in, timeout, output cap) `process_list` `kill_process` (refuses gateway/PID 1)
|
|
109
|
+
|
|
110
|
+
**System** (3) `system_info` `disk_usage` `network_interfaces`
|
|
111
|
+
|
|
112
|
+
**HTTP** (3) `http_request` `port_check` `web_fetch` — all SSRF-guarded: loopback, private ranges, and cloud metadata endpoints are refused
|
|
102
113
|
|
|
103
|
-
|
|
114
|
+
**Git** (1) `git` — verb-whitelisted; option injection (`--upload-pack`) and shell metacharacters blocked
|
|
104
115
|
|
|
105
|
-
**
|
|
116
|
+
**SQLite** (2) `sqlite_query` `sqlite_schema` — single-statement, ATTACH blocked
|
|
106
117
|
|
|
107
|
-
**
|
|
118
|
+
**Logs** (3) `tail_logs` `search_logs` `journal` (unit name validated)
|
|
108
119
|
|
|
109
|
-
**
|
|
120
|
+
**Services** (2) `service_status` `service_action` — protected units (ssh, gateway itself, targets) refused
|
|
110
121
|
|
|
111
|
-
**
|
|
122
|
+
**Packages** (3) `package_list` `package_install` `package_remove` (refuses nodejs/nginx/ssh)
|
|
112
123
|
|
|
113
|
-
**
|
|
124
|
+
**Scheduler** (3) `schedule_command` `list_scheduled_tasks` `cancel_scheduled_task` — min 60s intervals, shell-token-gated
|
|
114
125
|
|
|
115
|
-
**
|
|
126
|
+
**Security** (2) `secret_scan` (10 credential patterns, masked output) `port_scan_local`
|
|
116
127
|
|
|
117
|
-
**
|
|
128
|
+
**Project** (2) `analyze_project` `project_health_check`
|
|
118
129
|
|
|
119
|
-
|
|
130
|
+
**Planning** (4) `create_task_plan` `task_status` `workspace_snapshot` `rollback_changes` — snapshot before risky edits, roll back atomically
|
|
131
|
+
|
|
132
|
+
**Policy** (4) `list_allowed_paths` `allow_path` `deny_path` `shell_enabled` — each token manages only its own sandbox
|
|
120
133
|
|
|
121
134
|
## Security model
|
|
122
135
|
|
|
123
|
-
- **
|
|
124
|
-
- **
|
|
125
|
-
- **
|
|
126
|
-
- **
|
|
127
|
-
- **
|
|
136
|
+
- **Loopback only.** The gateway listens on `127.0.0.1` — unreachable directly from the network.
|
|
137
|
+
- **Timing-safe token auth** on every request; tokens never appear in logs (audits store fingerprints).
|
|
138
|
+
- **Per-token sandbox.** Path policy resolves symlinks and collapses `..` before checking; deny always wins.
|
|
139
|
+
- **Per-token scopes + read-only + rate limit + expiry.** Least privilege by construction.
|
|
140
|
+
- **SSRF guards** on all outbound fetch tools — the AI can't reach your metadata endpoints or internal services.
|
|
141
|
+
- **Injection guards.** git verbs whitelisted, SQL single-statement, ATTACH blocked, unit names validated.
|
|
142
|
+
- **Tamper-evident audit.** Every tool invocation → SQLite with a hash chain; `ramcp audit --verify` detects deletions/edits. Secrets in arguments are redacted before storage.
|
|
143
|
+
- **Hot-reload.** Policy edits apply on the next request — no restart, no downtime.
|
|
144
|
+
- **Global read-only** kill-switch: `ramcp policy readonly on`.
|
|
128
145
|
|
|
129
|
-
You
|
|
146
|
+
You provide TLS (nginx + Cloudflare/Let's Encrypt). The gateway speaks plain HTTP on loopback, like every other loopback service.
|
|
130
147
|
|
|
131
148
|
## FAQ
|
|
132
149
|
|
|
133
150
|
**Is exposing a shell to an AI safe?**
|
|
134
|
-
It's exposing a shell to *you*, via the AI as the interface.
|
|
151
|
+
It's exposing a shell to *you*, via the AI as the interface. Least-privilege tokens, scoped tools, off-by-default shell, tamper-evident audit, and a read-only mode give you dials that raw SSH doesn't.
|
|
152
|
+
|
|
153
|
+
**Stateless sessions?**
|
|
154
|
+
Each request builds a fresh MCP transport. No session state to corrupt, trivially scalable, and it's the mode ChatGPT's connector flow works best with.
|
|
155
|
+
|
|
156
|
+
**Where does config live?**
|
|
157
|
+
`~/.config/remote-access-mcp/config.json` (0600) + `audit.db` + `schedule.json` alongside it.
|
|
135
158
|
|
|
136
|
-
|
|
137
|
-
|
|
159
|
+
## Development
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
git clone https://github.com/AmirAliManzar/remote-access-mcp
|
|
163
|
+
cd remote-access-mcp
|
|
164
|
+
npm ci && npm run build && npm test
|
|
165
|
+
```
|
|
138
166
|
|
|
139
|
-
|
|
140
|
-
It can, and on a dedicated server that's often simplest — the tools need broad access to be useful. The policy engine is the guardrail, not the UID.
|
|
167
|
+
42 tests: policy engine, auth matrix, tools-over-MCP integration, full v2 security matrix (scopes, read-only, SSRF, injection, audit chain), CLI lifecycle. CI runs on Node 18/20/22.
|
|
141
168
|
|
|
142
169
|
## License
|
|
143
170
|
|
package/dist/cli/main.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/cli/main.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/cli/main.ts"],"names":[],"mappings":"AAqlBA,wBAAsB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAyBxD"}
|