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.
Files changed (102) hide show
  1. package/README.fa.md +29 -70
  2. package/README.md +92 -65
  3. package/dist/cli/main.d.ts.map +1 -1
  4. package/dist/cli/main.js +354 -133
  5. package/dist/cli/main.js.map +1 -1
  6. package/dist/core/audit.d.ts +40 -0
  7. package/dist/core/audit.d.ts.map +1 -0
  8. package/dist/core/audit.js +96 -0
  9. package/dist/core/audit.js.map +1 -0
  10. package/dist/core/config.d.ts +37 -5
  11. package/dist/core/config.d.ts.map +1 -1
  12. package/dist/core/config.js +111 -34
  13. package/dist/core/config.js.map +1 -1
  14. package/dist/core/context.d.ts +23 -0
  15. package/dist/core/context.d.ts.map +1 -0
  16. package/dist/core/context.js +32 -0
  17. package/dist/core/context.js.map +1 -0
  18. package/dist/core/crypto.d.ts +6 -0
  19. package/dist/core/crypto.d.ts.map +1 -0
  20. package/dist/core/crypto.js +16 -0
  21. package/dist/core/crypto.js.map +1 -0
  22. package/dist/core/policy.d.ts +19 -0
  23. package/dist/core/policy.d.ts.map +1 -1
  24. package/dist/core/policy.js +57 -0
  25. package/dist/core/policy.js.map +1 -1
  26. package/dist/core/rate-limit.d.ts +14 -0
  27. package/dist/core/rate-limit.d.ts.map +1 -0
  28. package/dist/core/rate-limit.js +67 -0
  29. package/dist/core/rate-limit.js.map +1 -0
  30. package/dist/server/app.d.ts +18 -1
  31. package/dist/server/app.d.ts.map +1 -1
  32. package/dist/server/app.js +123 -24
  33. package/dist/server/app.js.map +1 -1
  34. package/dist/server/run.d.ts +5 -1
  35. package/dist/server/run.d.ts.map +1 -1
  36. package/dist/server/run.js +31 -8
  37. package/dist/server/run.js.map +1 -1
  38. package/dist/tools/filesystem.d.ts +3 -2
  39. package/dist/tools/filesystem.d.ts.map +1 -1
  40. package/dist/tools/filesystem.js +34 -23
  41. package/dist/tools/filesystem.js.map +1 -1
  42. package/dist/tools/git.d.ts +2 -2
  43. package/dist/tools/git.d.ts.map +1 -1
  44. package/dist/tools/git.js +33 -4
  45. package/dist/tools/git.js.map +1 -1
  46. package/dist/tools/http.d.ts +2 -1
  47. package/dist/tools/http.d.ts.map +1 -1
  48. package/dist/tools/http.js +47 -5
  49. package/dist/tools/http.js.map +1 -1
  50. package/dist/tools/index.d.ts +6 -3
  51. package/dist/tools/index.d.ts.map +1 -1
  52. package/dist/tools/index.js +29 -9
  53. package/dist/tools/index.js.map +1 -1
  54. package/dist/tools/logs.d.ts +4 -0
  55. package/dist/tools/logs.d.ts.map +1 -0
  56. package/dist/tools/logs.js +78 -0
  57. package/dist/tools/logs.js.map +1 -0
  58. package/dist/tools/packages.d.ts +4 -0
  59. package/dist/tools/packages.d.ts.map +1 -0
  60. package/dist/tools/packages.js +75 -0
  61. package/dist/tools/packages.js.map +1 -0
  62. package/dist/tools/planning.d.ts +4 -0
  63. package/dist/tools/planning.d.ts.map +1 -0
  64. package/dist/tools/planning.js +118 -0
  65. package/dist/tools/planning.js.map +1 -0
  66. package/dist/tools/policy.d.ts +7 -2
  67. package/dist/tools/policy.d.ts.map +1 -1
  68. package/dist/tools/policy.js +29 -18
  69. package/dist/tools/policy.js.map +1 -1
  70. package/dist/tools/project.d.ts +4 -0
  71. package/dist/tools/project.d.ts.map +1 -0
  72. package/dist/tools/project.js +141 -0
  73. package/dist/tools/project.js.map +1 -0
  74. package/dist/tools/schedule.d.ts +17 -0
  75. package/dist/tools/schedule.d.ts.map +1 -0
  76. package/dist/tools/schedule.js +113 -0
  77. package/dist/tools/schedule.js.map +1 -0
  78. package/dist/tools/security.d.ts +4 -0
  79. package/dist/tools/security.d.ts.map +1 -0
  80. package/dist/tools/security.js +103 -0
  81. package/dist/tools/security.js.map +1 -0
  82. package/dist/tools/services.d.ts +4 -0
  83. package/dist/tools/services.d.ts.map +1 -0
  84. package/dist/tools/services.js +56 -0
  85. package/dist/tools/services.js.map +1 -0
  86. package/dist/tools/shell.d.ts +2 -2
  87. package/dist/tools/shell.d.ts.map +1 -1
  88. package/dist/tools/shell.js +25 -10
  89. package/dist/tools/shell.js.map +1 -1
  90. package/dist/tools/sqlite.d.ts +2 -2
  91. package/dist/tools/sqlite.d.ts.map +1 -1
  92. package/dist/tools/sqlite.js +44 -9
  93. package/dist/tools/sqlite.js.map +1 -1
  94. package/dist/tools/system.d.ts +2 -1
  95. package/dist/tools/system.d.ts.map +1 -1
  96. package/dist/tools/system.js +6 -2
  97. package/dist/tools/system.js.map +1 -1
  98. package/dist/tools/web.d.ts +4 -0
  99. package/dist/tools/web.d.ts.map +1 -0
  100. package/dist/tools/web.js +77 -0
  101. package/dist/tools/web.js.map +1 -0
  102. package/package.json +1 -1
package/README.fa.md CHANGED
@@ -1,11 +1,12 @@
1
1
  # remote-access-mcp
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/remote-access-mcp.svg)](https://www.npmjs.com/package/remote-access-mcp)
4
+ [![CI](https://github.com/AmirAliManzar/remote-access-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/AmirAliManzar/remote-access-mcp/actions/workflows/ci.yml)
4
5
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](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 وصل میشن و به‌صورت امن سرورت رو کنترل می‌کنن: خواندن و نوشتن فایل، اجرای دستورات شل، وضعیت سیستم، دیتابیس SQLite و کار با گیت — همه پشت یک توکن.
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
- npm install -g remote-access-mcp
41
- ramcp init
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
- $ ramcp url
74
- https://mcp.example.com/6kX9mQf2.../mcp
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
- **فایل‌سیستم** (۷) — `list_directory`, `read_file`, `write_file`, `edit_file`, `delete_path`, `search_code`, `file_info`
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
- **گیت** (۱) `git`
46
+ هر توکن خودش داره: مسیرهای مجاز/غیرمجاز، گروه ابزارها (scopes)، فلگ شل، حالت فقط-خواندنی، محدودیت نرخ، و تاریخ انقضا.
93
47
 
94
- **SQLite** (۲) `sqlite_query`, `sqlite_schema`
48
+ ## ۳۸ ابزار در ۱۵ گروه
95
49
 
96
- **سیاست دسترسی** (۴) `list_allowed_paths`, `allow_path`, `deny_path`, `shell_enabled`
50
+ فایل‌سیستم (۷)، شل (۳)، سیستم (۳)، HTTP با محافظ SSRF (۳)، گیت با whitelist فعل‌ها (۱)، SQLite تک-دستوره (۲)، لاگ/journalctl (۳)، سرویس‌های systemd (۲)، پکیج‌ها apt/npm (۳)، زمان‌بند (۳)، اسکن امنیتی (۲)، تحلیل پروژه (۲)، پلنینگ + اسنپ‌شات/rollback (۴)، مدیریت پالیسی (۴).
97
51
 
98
52
  ## مدل امنیتی
99
53
 
100
- - **فقط loopback.** گیت‌وی روی `127.0.0.1:8765` گوش میده — از شبکه مستقیم قابل دسترسی نیست.
101
- - **احراز هویت توکنی روی هر درخواست.** دو فرمت: هدر bearer یا مسیر URL.
102
- - **موتور سیاست مسیر.** ابزارهای فایل‌سیستم symlinkها رو resolve و `..` رو قبل از چک allow/deny نرمال‌سازی می‌کنن. deny همیشه برنده‌ست.
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
- انتظار اینه که TLS جلوش باشه (nginx + Let's Encrypt یا لبه CDN). خود گیت‌وی HTTP ساده روی loopback حرف می‌زنه.
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
  [![npm version](https://img.shields.io/npm/v/remote-access-mcp.svg)](https://www.npmjs.com/package/remote-access-mcp)
4
+ [![CI](https://github.com/AmirAliManzar/remote-access-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/AmirAliManzar/remote-access-mcp/actions/workflows/ci.yml)
4
5
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](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, inspect system state, query SQLite databases, work with git — all behind a single bearer token.
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 on the server" or "deploy the new branch and tail the logs" become actual conversations.
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/Caddy (with Cloudflare or any TLS edge in front) and expose exactly one HTTPS endpoint to the world. Every request must carry your token — either as `Authorization: Bearer <token>` header or embedded in the URL path (`/<token>/mcp`) for clients like ChatGPT's custom connectors that can't set custom headers.
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
- $ ramcp init
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 the gateway in the foreground. |
71
- | `ramcp url` | Print the MCP endpoint URL for chatbot connectors. |
72
- | `ramcp token rotate` | Generate a new token (old one stops working immediately). |
73
- | `ramcp policy` | Show which paths the AI may access. |
74
- | `ramcp policy allow <path>` | Allow the AI access to a directory. |
75
- | `ramcp policy deny <path>` | Revoke access to a directory. |
76
- | `ramcp policy shell on/off` | Enable/disable shell command execution. |
77
- | `ramcp service install` | Install systemd service + nginx reverse-proxy vhost. |
78
- | `ramcp service uninstall` | Remove service + nginx vhost. |
79
- | `ramcp status` | Check if the service is running. |
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: `https://your-domain.com/mcp`
101
- Header: `Authorization: Bearer <token>`
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
- ## Tools exposed
114
+ **Git** (1) `git` — verb-whitelisted; option injection (`--upload-pack`) and shell metacharacters blocked
104
115
 
105
- **Filesystem** (7) `list_directory`, `read_file`, `write_file`, `edit_file`, `delete_path`, `search_code`, `file_info`
116
+ **SQLite** (2) `sqlite_query` `sqlite_schema` single-statement, ATTACH blocked
106
117
 
107
- **Shell** (3) `run_command`, `process_list`, `kill_process`
118
+ **Logs** (3) `tail_logs` `search_logs` `journal` (unit name validated)
108
119
 
109
- **System** (3) `system_info`, `disk_usage`, `network_interfaces`
120
+ **Services** (2) `service_status` `service_action` — protected units (ssh, gateway itself, targets) refused
110
121
 
111
- **HTTP** (2) `http_request`, `port_check`
122
+ **Packages** (3) `package_list` `package_install` `package_remove` (refuses nodejs/nginx/ssh)
112
123
 
113
- **Git** (1) `git` (status, diff, log, add, commit, push, pull…)
124
+ **Scheduler** (3) `schedule_command` `list_scheduled_tasks` `cancel_scheduled_task` min 60s intervals, shell-token-gated
114
125
 
115
- **SQLite** (2) `sqlite_query`, `sqlite_schema`
126
+ **Security** (2) `secret_scan` (10 credential patterns, masked output) `port_scan_local`
116
127
 
117
- **Policy** (4) `list_allowed_paths`, `allow_path`, `deny_path`, `shell_enabled`
128
+ **Project** (2) `analyze_project` `project_health_check`
118
129
 
119
- Filesystem tools are sandboxed by an allow/deny policy (`ramcp policy`). By default nothing is allowed you decide what the AI can touch. Shell is off by default too.
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
- - **Bind-local only.** The gateway listens on `127.0.0.1:8765` — unreachable from the network directly.
124
- - **Token auth on every request.** Two forms supported: bearer header or URL path.
125
- - **Path policy engine.** Filesystem tools resolve symlinks and normalize `..` traversal before checking allow/deny lists. Deny always wins.
126
- - **Shell behind a flag.** Off until you explicitly turn it on.
127
- - **No secrets in logs.** The token is never printed to stdout in full after generation.
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 are expected to put TLS in front (nginx + Let's Encrypt, or your CDN edge). The gateway itself speaks plain HTTP on loopback — same pattern as phpMyAdmin, Redis, and every other loopback service.
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. The token gates everything; shell is opt-in; filesystem is policy-sandboxed. If you wouldn't give an intern SSH access, don't give them this token.
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
- **Why stateless mode?**
137
- Each request creates a fresh MCP transport. No session state to corrupt, trivially horizontal-scalable, and it's what ChatGPT's connector flow works best with.
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
- **Does it run as root?**
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
 
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/cli/main.ts"],"names":[],"mappings":"AAqXA,wBAAsB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAuBxD"}
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"}