remote-access-mcp 4.5.0 → 4.6.2

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 CHANGED
@@ -1,393 +1,407 @@
1
- # remote-access-mcp
1
+ # Remote Access MCP
2
2
 
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)
5
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
3
+ <p align="center">
4
+ <strong>Give your AI assistant real access to your computer.</strong><br>
5
+ Turn ChatGPT, Claude, Grok, Qwen Desktop, and other MCP clients into an agent that can work on your laptop, desktop, VM, or server.
6
+ </p>
6
7
 
7
- Turn any machine into a secure AI-agent-accessible endpoint via the [Model Context Protocol](https://modelcontextprotocol.io) (MCP).
8
+ <p align="center">
9
+ <a href="https://www.npmjs.com/package/remote-access-mcp"><img src="https://img.shields.io/npm/v/remote-access-mcp.svg" alt="npm"></a>
10
+ <a href="https://github.com/AmirAliManzar/remote-access-mcp/actions/workflows/ci.yml"><img src="https://github.com/AmirAliManzar/remote-access-mcp/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
11
+ <a href="https://github.com/AmirAliManzar/remote-access-mcp/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-yellow.svg" alt="MIT"></a>
12
+ <img src="https://img.shields.io/badge/Node.js-18%2B-339933.svg" alt="Node.js 18+">
13
+ </p>
8
14
 
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.
15
+ > **The idea:** Your chatbot already knows how to reason. Remote Access MCP gives that reasoning a controlled pair of hands on a machine you own.
10
16
 
11
- **Zero Python. Zero Docker. Just Node.js.**
17
+ ## What is Remote Access MCP?
12
18
 
13
- ```bash
14
- npm install -g remote-access-mcp
15
- ramcp init
16
- ```
19
+ [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) lets AI applications use external tools and data. **Remote Access MCP is the bridge between an MCP-compatible AI client and a real machine.**
17
20
 
21
+ Install it on a laptop, desktop, VM, home server, cloud server, or development box. Connect your AI client, grant it only the directories and capabilities it needs, and let the agent actually do the work.
18
22
 
19
- ### Direct HTTP fallback
23
+ Instead of:
20
24
 
21
- When no tunnel provider is available, Direct HTTP can expose the gateway on a randomly selected high dynamic port. MARS never claims common public/service ports such as 80, 443, 8443, 2083, 2087, or 2096 for this feature. On Linux, UFW is updated automatically when available, and the listener is health-checked before its connector URL is printed.
25
+ > "Here is the error. Tell me what command I should run."
22
26
 
23
- ```bash
24
- ramcp start --direct
25
- ramcp tunnel --provider auto
26
- ramcp tunnel --direct
27
- ramcp url
27
+ You can have an agentic workflow:
28
+
29
+ > "Inspect the project, reproduce the bug, edit the files, run the tests, check the logs, fix the issue, and tell me exactly what changed."
30
+
31
+ The AI can perform the loop instead of merely describing it.
32
+
33
+ ### From chatbot to agent
34
+
35
+ ```text
36
+ ┌──────────────────────┐
37
+ │ ChatGPT / Claude │
38
+ │ Grok / Qwen / etc. │
39
+ └──────────┬───────────┘
40
+ │ MCP / HTTPS
41
+
42
+ ┌──────────────────────────────┐
43
+ │ Remote Access MCP │
44
+ │ auth · policy · audit · jobs │
45
+ └──────────────┬───────────────┘
46
+ │ controlled tools
47
+ ┌───────┼────────┬──────────┐
48
+ ▼ ▼ ▼ ▼
49
+ Files Shell Git Browser
50
+ │ │ │ │
51
+ └───────┴────────┴──────────┘
52
+
53
+ Your real machine
28
54
  ```
29
55
 
30
- Auto mode remembers the last successful tunnel provider and tries it first on the next start, reducing unnecessary link changes. Provider-generated free tunnel hostnames can still change when the provider itself does not offer persistent hostnames.
56
+ ## What can the agent actually do?
31
57
 
32
- ## Why
58
+ Depending on the permissions you grant, an MCP client can:
33
59
 
34
- 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.
60
+ - inspect and understand a codebase
61
+ - create, edit, move, and delete files
62
+ - upload and download binary files
63
+ - run tests, linters, builds, scripts, and development commands
64
+ - inspect processes, disks, network interfaces, logs, and services
65
+ - work with Git repositories
66
+ - query SQLite, MySQL, PostgreSQL, and Redis through controlled adapters
67
+ - inspect HTTP endpoints and browser pages
68
+ - create background jobs and run bounded tasks in parallel
69
+ - schedule recurring work and react to webhooks, file, and health events
70
+ - diagnose infrastructure and common Docker/Kubernetes environments
71
+ - create snapshots and roll back risky filesystem changes
72
+ - use optional Context7, Codebase Memory, and other MCP integrations
35
73
 
36
- 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.
74
+ That means the AI can follow a real **observe plan change test verify** loop.
37
75
 
38
- ## Parallel execution & background workers
76
+ ## Why this is different
39
77
 
40
- Remote Access MCP includes a bounded local worker pool for long-running or parallel operations. Use `run_background` for asynchronous commands and `run_parallel` for multiple commands. Jobs have persistent metadata, output capture, cancellation, timeouts, retry limits, and per-token ownership.
78
+ Most AI chat experiences stop at generated text. Coding agents improve that by giving the model a workspace. Remote Access MCP takes the same idea to **the machine itself** while keeping the operator in control.
41
79
 
42
- ## Safe operations
80
+ It is designed for:
43
81
 
44
- - Binary-safe `upload_file` / `download_file` with size limits and SHA-256 verification.
45
- - Approval-required shell mode and command allowlists.
46
- - Managed filesystem change sets with durable pre-mutation capture, create/delete tracking, resumable rollback, and atomic per-path restore.
47
- - Token roles: `auditor`, `developer`, `deployer`, `admin`.
82
+ - 💻 **Laptops & desktops** let your AI work on your local development environment.
83
+ - 🖥️ **Servers** inspect services, logs, deployments, files, and infrastructure remotely.
84
+ - 🧪 **Development & CI environments** build, test, diagnose, and verify instead of guessing.
85
+ - 🏠 **Home labs & self-hosted systems** — connect an AI client without building a custom agent platform.
86
+ - ☁️ **Cloud VMs** — expose a controlled MCP endpoint without handing over an unrestricted SSH account.
48
87
 
49
- ## Diagnostics & extensibility
88
+ ### Cross-platform
50
89
 
51
- - Structured system/service diagnostics and persistent health watchers with webhook alerts.
52
- - MySQL/PostgreSQL/Redis query and schema tools using credentials held in environment variables.
53
- - MCP Resources and Prompts for operational context.
54
- - Isolated local plugin lifecycle: manifests are validated and fingerprinted, plugin tools are namespaced, and installed plugins run out-of-process behind Node's filesystem permission model plus a Linux network sandbox. Plugin access requires the `plugins` scope; untrusted or unverifiable plugins are skipped fail-closed.
90
+ The core gateway is designed for **Linux, macOS, and Windows** with Node.js 18+.
55
91
 
56
- ## Install
92
+ - Linux → systemd when you want a persistent service
93
+ - macOS → launchd when you want a persistent service
94
+ - Windows → Scheduled Tasks when you want a persistent service
95
+ - Any platform → foreground mode or supported tunnel/direct connection
57
96
 
58
- ### Any machine with Node.js 18+ — Linux, macOS, or Windows
97
+ ## Quick start
59
98
 
60
- The core gateway supports Node.js 18 and newer. Optional MCP integrations may have higher runtime requirements; on Node.js 18 they are skipped when their packages cannot run, while the core gateway remains available.
99
+ ### 1. Install
61
100
 
62
101
  ```bash
63
102
  npm install -g remote-access-mcp
64
- ramcp init
65
103
  ```
66
104
 
67
- ### One-liner (Ubuntu/Debian servers)
105
+ Or on Ubuntu/Debian:
68
106
 
69
107
  ```bash
70
108
  curl -fsSL https://raw.githubusercontent.com/AmirAliManzar/remote-access-mcp/main/install.sh | bash
71
- ramcp init
72
109
  ```
73
110
 
74
- ### Manual
111
+ ### 2. Initialize
75
112
 
76
113
  ```bash
77
- npm install -g remote-access-mcp
78
114
  ramcp init
79
115
  ```
80
116
 
81
- ## Quick start
117
+ `ramcp` is the CLI and interactive TUI (terminal user interface). Run it with no arguments in an interactive terminal to open the guided interface.
82
118
 
83
- On a **server** with a domain:
119
+ ### 3. Decide what the AI may access
120
+
121
+ Start narrow. For example:
84
122
 
85
123
  ```bash
86
- ramcp init # config + first token
87
- ramcp policy allow /srv/myapp # what the AI may touch
88
- ramcp policy shell on # let it run commands (optional)
89
- ramcp service install --domain mcp.example.com # systemd + nginx
90
- ramcp doctor # verify everything end-to-end
91
- ramcp url # connector URL for your chatbot
124
+ ramcp policy allow ~/Projects/my-app
125
+ ramcp policy shell on
92
126
  ```
93
127
 
94
- On a **laptop or desktop** (no domain, no port forwarding):
128
+ You can create separate tokens for separate agents or use cases:
95
129
 
96
130
  ```bash
97
- ramcp tunnel
98
- # downloads cloudflared on first run (no account needed),
99
- # prints a public https URL like https://random-words.trycloudflare.com
100
- # `ramcp url` in another terminal shows the live connector link.
131
+ ramcp token add --name developer \
132
+ --paths ~/Projects/my-app \
133
+ --scopes filesystem,git,shell \
134
+ --shell
101
135
  ```
102
136
 
103
- Works the same on Windows, macOS, and Linux — PowerShell/cmd on Windows,
104
- launchd on macOS, systemd on Linux for the autostart service.
137
+ ### 4. Connect your AI client
105
138
 
106
- ## Commands
107
-
108
- | Command | Description |
109
- |---|---|
110
- | `ramcp init` | Generate config + first token. Safe to re-run. |
111
- | `ramcp start [--read-only]` | Run in the foreground. |
112
- | `ramcp url [token]` | Connector URL for a chatbot. |
113
- | `ramcp doctor` | One-pass diagnosis: tokens, port, gateway, nginx, public URL, audit chain. |
114
- | `ramcp status` | Service + config summary. |
115
- | `ramcp token list [--json]` | All tokens (fingerprints only). |
116
- | `ramcp token add --name N` | Create a scoped token — see options below. |
117
- | `ramcp token rotate [name]` | Rotate a token (old one dies instantly). |
118
- | `ramcp token revoke name` | Delete a token. |
119
- | `ramcp policy [token]` | Show/set path policy, shell flag. |
120
- | `ramcp policy readonly on` | Global kill-switch for ALL mutating tools. |
121
- | `ramcp audit [--tool T]` | Query the audit log. `--verify` checks the hash chain. |
122
- | `ramcp service install` | systemd unit (+ nginx vhost with `--domain`). |
123
- | `ramcp service logs -f` | Tail gateway logs. |
124
- | `ramcp schedule list` | List scheduled tasks. |
125
- | `ramcp webhook add --url URL --events EVENTS` | Add a webhook subscription. |
126
- | `ramcp webhook list` | List configured webhooks. |
127
- | `ramcp webhook on URL` / `off URL` | Enable or disable a webhook. |
128
- | `ramcp webhook remove URL` | Remove a webhook. |
129
- | `ramcp config export --out FILE` | Export configuration and credentials for backup. |
130
- | `ramcp config import FILE [--merge]` | Restore or merge a configuration backup. |
131
- | `ramcp tunnel` | Start a temporary public tunnel. |
132
-
133
- ### `token add` options
134
-
135
- Role and shell controls can be combined with `--role auditor|developer|deployer|admin`, `--commands git,npm` and `--approval required|auto`. Roles act as permission ceilings; explicit token scopes can further restrict a role.
139
+ For a client that accepts a token in the URL:
136
140
 
137
- ```bash
138
- ramcp token add --name chatgpt \
139
- --paths /srv/app \ # allowed directories (symlink-safe)
140
- --deny /srv/app/.env \ # explicitly denied (deny always wins)
141
- --shell \ # allow shell commands (default: off)
142
- --scopes filesystem,git \ # limit to tool groups (default: all)
143
- --read-only \ # refuse every mutating tool
144
- --rpm 30 \ # max requests per minute
145
- --expires 2026-12-31 # auto-expiry
141
+ ```text
142
+ https://your-host/<token>/mcp
146
143
  ```
147
144
 
148
- Example a token that can only read files, never write or execute:
145
+ For clients that support an Authorization header:
149
146
 
150
- ```bash
151
- ramcp token add --name auditor --paths /srv --scopes filesystem --read-only
147
+ ```text
148
+ https://your-host/mcp
149
+ Authorization: Bearer <token>
152
150
  ```
153
151
 
154
- ## Connecting your chatbot
152
+ Use:
155
153
 
156
- ### ChatGPT (Developer Mode → Connectors)
157
-
158
- ```
159
- https://your-domain.com/<token>/mcp
154
+ ```bash
155
+ ramcp url
160
156
  ```
161
157
 
162
- Get it ready-made: `ramcp url`
163
-
164
- ### Claude / any MCP client with header support
165
-
166
- Endpoint `https://your-domain.com/mcp` + header `Authorization: Bearer <token>`
158
+ to print the connector URL for the current runtime.
167
159
 
168
- ## Tools (101 built-in operational tools, plus optional integration tools)
160
+ ## Laptop / desktop: no domain required
169
161
 
170
- The built-in tool count is stable. Optional MCP integrations can add additional namespaced tools when their upstream packages are available.
162
+ You do not need to buy a domain or configure port forwarding just to experiment.
171
163
 
172
- **Filesystem** (7) `list_directory` `read_file` (offset/limit) `write_file` `edit_file` `delete_path` `search_code` `file_info`
164
+ ```bash
165
+ ramcp tunnel
166
+ ```
173
167
 
174
- **Shell** (3) `run_command` (opt-in, timeout, output cap) `process_list` `kill_process` (refuses gateway/PID 1)
168
+ Remote Access MCP can use a supported tunnel provider and print a public HTTPS endpoint. Auto mode remembers the last successful provider and prefers it on the next run.
175
169
 
176
- **System** (3) `system_info` `disk_usage` `network_interfaces`
170
+ You can also use direct HTTP when appropriate:
177
171
 
178
- **HTTP** (3) `http_request` `port_check` `web_fetch` — all SSRF-guarded: loopback, private ranges, and cloud metadata endpoints are refused
172
+ ```bash
173
+ ramcp tunnel --direct
174
+ ```
179
175
 
180
- **Git** (1) `git` verb-whitelisted; option injection (`--upload-pack`) and shell metacharacters blocked
176
+ Direct mode chooses a high dynamic port rather than common service ports and performs availability/health checks before presenting the endpoint.
181
177
 
182
- **SQLite** (2) `sqlite_query` `sqlite_schema` single-statement, ATTACH blocked
178
+ > Free tunnel providers may assign a new hostname after a tunnel is recreated. A provider's free tier controls hostname persistence, not Remote Access MCP.
183
179
 
184
- **Logs** (3) `tail_logs` `search_logs` `journal` (unit name validated)
180
+ ## Server deployment
185
181
 
186
- **Services** (2) `service_status` `service_action` protected units (ssh, gateway itself, targets) refused
182
+ For a Linux server with a domain:
187
183
 
188
- **Packages** (3) `package_list` `package_install` `package_remove` (refuses nodejs/nginx/ssh)
184
+ ```bash
185
+ ramcp init
186
+ ramcp policy allow /srv/myapp
187
+ ramcp policy shell on
188
+ ramcp service install --domain mcp.example.com
189
+ ramcp doctor
190
+ ramcp url
191
+ ```
189
192
 
190
- **Scheduler** (3) `schedule_command` `list_scheduled_tasks` `cancel_scheduled_task` min 60s intervals, shell-token-gated
193
+ The service setup is intended to keep the gateway local and put your chosen HTTPS edge/reverse proxy in front of it.
191
194
 
192
- **Security** (2) `secret_scan` (10 credential patterns, masked output) `port_scan_local`
195
+ ## Agentic workflows
193
196
 
194
- **Project** (2) `analyze_project` `project_health_check`
197
+ Remote Access MCP is not just a collection of shell wrappers. The toolset is designed so an AI agent can complete multi-step work.
195
198
 
196
- **Planning** (4) `create_task_plan` `task_status` `workspace_snapshot` `rollback_changes` — snapshot before risky edits, roll back atomically
199
+ ### Example: fix a failing project
197
200
 
198
- **Policy** (4) `list_allowed_paths` `allow_path` `deny_path` `shell_enabled` — each token manages only its own sandbox
201
+ ```text
202
+ User:
203
+ "The tests are failing. Find the cause, fix it, run the relevant tests,
204
+ and verify that the fix didn't break anything else."
199
205
 
200
- **Operations** (2) `environment_inspect` `nginx_inspect`
206
+ Agent:
207
+ 1. Inspect project structure
208
+ 2. Read relevant files
209
+ 3. Run the failing test
210
+ 4. Inspect output/logs
211
+ 5. Edit the code
212
+ 6. Run focused tests
213
+ 7. Run broader verification
214
+ 8. Report files changed + results
215
+ ```
201
216
 
202
- **Browser** (3) `browser_open` `browser_extract` `browser_screenshot` — optional Playwright runtime; public-URL SSRF guard; screenshots must stay inside the token path sandbox
217
+ ### Example: investigate a server
203
218
 
204
- **Infrastructure** (9) `infra_probe` `docker_ps` `docker_inspect` `docker_logs` `docker_action` `kubernetes_get` `kubernetes_describe` `kubernetes_logs` `cloudflare_status` — fixed executables and validated arguments; missing CLIs degrade cleanly
219
+ ```text
220
+ "Why is this server slow? Check CPU, RAM, disk, processes, network,
221
+ logs and services. Identify the bottleneck and propose or perform the
222
+ lowest-risk fix, then verify the result."
223
+ ```
205
224
 
206
- **Database** (2) `database_query` `database_schema` — MySQL/PostgreSQL/Redis support already provided by the existing adapter
225
+ ### Example: build something
207
226
 
208
- ## Automation & Events
227
+ ```text
228
+ "Create the project in /srv/demo, install its dependencies, implement
229
+ the feature, run the tests and leave me a working build."
230
+ ```
209
231
 
210
- Automation rules are persistent, token-isolated workflows triggered by intervals or tool/webhook/file/health events. They support typed conditions, bounded action lists, manual triggering, enable/disable/delete lifecycle, execution counters, and webhook outcome notifications. Every action is executed through the normal token policy/read-only/audit wrapper; automation cannot invoke control-plane, approval, or plugin lifecycle tools. File triggers are constrained by the owner's path policy, payloads are bounded, and recursive automation chains are capped.
232
+ The important difference is that the model gets **tools + state + feedback**, so it can iterate against the real environment.
211
233
 
212
- For external events, an authenticated webhook can POST to `/<token>/automation/webhook` with a JSON body such as `{"type":"deploy.finished","data":{"service":"api"}}`. The token selects the owner's rules; the token is never copied into the event payload. Scheduler/file/health execution is persistent and protected by a cross-process execution claim so multiple gateway processes do not intentionally execute the same rule concurrently.
234
+ ## Safety model
213
235
 
214
- ## Security & Autonomous Operations
236
+ Remote Access MCP is deliberately permission-oriented. Installing it does **not** mean giving an AI unrestricted root access.
215
237
 
216
- Phase 7 adds `security_analysis` and `autonomy_check` plus bounded self-healing
217
- through `recovery_rule_create`, `recovery_rule_list`, `recovery_incidents`, and
218
- `recovery_trigger`. Recovery state is persistent and token-isolated, with
219
- maximum attempts and cooldowns. Autonomous operations are **disabled by
220
- default** and require `RAMCP_AUTONOMOUS=1`; high-risk and critical recovery
221
- also require their respective explicit environment flags. Recovery actions use
222
- the same policy, scope, read-only, audit, and context-wrapped tool execution as
223
- normal requests, and cannot invoke approvals, plugins, automation lifecycle,
224
- or recovery lifecycle tools.
238
+ ### Per-token permissions
225
239
 
226
- ## Plugin Isolation & Ecosystem
240
+ Tokens can have:
227
241
 
228
- Plugins are local, explicit installations. A plugin directory must contain a
229
- `manifest.json` with a semver-like `version` and a relative `entry` exporting
230
- `register(server, ctx)`. The gateway validates the tree, rejects symlinks and
231
- oversized packages, stores a SHA-256 fingerprint, and verifies that fingerprint
232
- before every child-process start. Plugin tools are exposed as
233
- `plugin_<name>__<tool>` and require the `plugins` token scope; declared plugin
234
- scopes must also be available to the token.
242
+ - allowed paths
243
+ - explicit denied paths
244
+ - tool scopes
245
+ - roles: `auditor`, `developer`, `deployer`, `admin`
246
+ - shell permission
247
+ - command allowlists
248
+ - read-only mode
249
+ - request-rate limits
250
+ - expiration
235
251
 
236
- Example manifest:
252
+ Example read-only token:
237
253
 
238
- ```json
239
- {
240
- "name": "my-plugin",
241
- "version": "1.0.0",
242
- "entry": "index.js",
243
- "permissions": ["fs.write"],
244
- "scopes": ["filesystem"]
245
- }
254
+ ```bash
255
+ ramcp token add \
256
+ --name auditor \
257
+ --paths /srv/myapp \
258
+ --scopes filesystem,git \
259
+ --read-only
246
260
  ```
247
261
 
248
- Runtime permissions are deliberately small: `fs.read` permits reads inside
249
- the plugin directory, `fs.write` permits writes only under the plugin's
250
- `data/` directory, and `process` permits child processes. Network access is
251
- disabled by default. On Linux the child also gets a separate network namespace
252
- and deny-by-default network filter. If the required sandbox is unavailable,
253
- the plugin is skipped unless `RAMCP_PLUGIN_UNSANDBOXED=1` is explicitly set by
254
- the operator. Plugin calls are short-lived and have a bounded execution time;
255
- there are no persistent plugin worker processes.
256
-
257
- The plugin host receives no token secret and no gateway mutation API. This is
258
- an intentional break from the old in-process `trusted: true` model: declaring
259
- trust inside a manifest is not considered a security boundary.
262
+ ### Defense in depth
260
263
 
261
- ## Webhooks
264
+ The project includes protections such as:
262
265
 
263
- Get notified when tools run (or fail) incident bots, Slack relays, anything that accepts a POST:
264
-
265
- ```bash
266
- ramcp webhook add --url https://hooks.example.com/ramcp --events tool.error
267
- ramcp webhook list
268
- ```
266
+ - path resolution that handles `..` and symlinks before policy checks
267
+ - deny rules that win over allow rules
268
+ - timing-safe token verification
269
+ - secret redaction in operational output
270
+ - SSRF protections for private/loopback/cloud metadata ranges
271
+ - Git command/argument validation
272
+ - SQLite single-statement restrictions and blocked `ATTACH`
273
+ - protected service/process controls
274
+ - bounded command output and timeouts
275
+ - persistent audit logging with hash-chain verification
276
+ - filesystem snapshots and rollback support
277
+ - optional plugin isolation with fail-closed behavior
278
+ - autonomous recovery disabled by default
269
279
 
270
- Fire-and-forget: a dead endpoint never delays a tool call (5s cap, deduped within 10s).
280
+ **Security is not a promise that an AI can never make a mistake. The goal is to make its capabilities explicit, bounded, observable, and revocable.**
271
281
 
272
- ## Backup & restore
282
+ See [SECURITY.md](SECURITY.md) for the security model and reporting guidance.
273
283
 
274
- ```bash
275
- ramcp config export --out backup.json # full snapshot, 0600 perms — contains live tokens!
276
- ramcp config import backup.json # replace
277
- ramcp config import backup.json --merge # union: keeps local identity, adds new tokens/hosts/hooks
278
- ```
284
+ ## Background jobs & parallel work
279
285
 
280
- > ⚠️ **Security warning:** configuration exports contain active authentication tokens. Treat backup files as secrets: never commit them to Git, upload them to issue trackers, or share them publicly. Store them with restricted permissions and rotate tokens if a backup is exposed.
286
+ Long-running work does not have to block the request that started it.
281
287
 
282
- ## Security model
288
+ The gateway provides bounded worker execution for:
283
289
 
284
- - **Loopback only.** The gateway listens on `127.0.0.1` — unreachable directly from the network.
285
- - **Timing-safe token auth** on every request; tokens never appear in logs (audits store fingerprints).
286
- - **Per-token sandbox.** Path policy resolves symlinks and collapses `..` before checking; deny always wins.
287
- - **Per-token scopes + read-only + rate limit + expiry.** Least privilege by construction.
288
- - **SSRF guards** on all outbound fetch tools — the AI can't reach your metadata endpoints or internal services.
289
- - **Injection guards.** git verbs whitelisted, SQL single-statement, ATTACH blocked, unit names validated.
290
- - **Tamper-evident audit.** Every tool invocation → append-only JSONL with a hash chain; `ramcp audit --verify` detects deletions/edits. Secrets in arguments are redacted before storage.
291
- - **Hot-reload.** Policy edits apply on the next request — no restart, no downtime.
292
- - **Global read-only** kill-switch: `ramcp policy readonly on`.
290
+ - background commands
291
+ - parallel operations
292
+ - retries with limits
293
+ - cancellation
294
+ - timeouts
295
+ - captured output
296
+ - persistent job metadata
297
+ - per-token ownership
293
298
 
294
- You provide TLS (nginx + Cloudflare/Let's Encrypt). The gateway speaks plain HTTP on loopback, like every other loopback service.
299
+ This is useful when an agent needs to build/test several components, wait for a long-running task, or perform independent checks concurrently.
295
300
 
296
- ## FAQ
301
+ ## Automation & events
297
302
 
298
- **Is exposing a shell to an AI safe?**
299
- 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.
303
+ Automation rules can be triggered by intervals and supported tool, webhook, file, and health events. Actions still pass through the normal token policy, scopes, read-only controls, and audit layer.
300
304
 
301
- **Stateless sessions?**
302
- 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.
305
+ This lets you build workflows such as:
303
306
 
304
- **Where does config live?**
305
- `~/.config/remote-access-mcp/config.json` (0600) + `audit.db` + `schedule.json` alongside it.
307
+ ```text
308
+ webhook inspect deployment run health checks → collect logs → notify
309
+ ```
306
310
 
307
- ## Development
311
+ or:
308
312
 
309
- ```bash
310
- git clone https://github.com/AmirAliManzar/remote-access-mcp
311
- cd remote-access-mcp
312
- npm ci && npm run build && npm test
313
+ ```text
314
+ health event → bounded recovery action → verify → record incident
313
315
  ```
314
316
 
315
- The test suite covers policy enforcement, authentication, transport compatibility (stateful, stateless, legacy SSE), cross-platform behavior, tunnel wiring, webhooks, configuration backup, CLI lifecycle, and crash regressions. CI runs on Node.js 18, 20, and 22.
317
+ Autonomous recovery is disabled by default and requires explicit operator configuration.
316
318
 
317
- ## License
319
+ ## Plugins & integrations
318
320
 
319
- MIT see [LICENSE](LICENSE).
321
+ Optional integrations can extend the gateway without making them mandatory for the core runtime.
320
322
 
321
- ---
323
+ Supported/available integrations include:
322
324
 
323
- 📚 [README فارسی](README.fa.md) | [Roadmap](ROADMAP.md) | [Security Policy](SECURITY.md) | [Changelog](CHANGELOG.md) | [Contributing](CONTRIBUTING.md)
325
+ - **Context7** for library/documentation context
326
+ - **Codebase Memory** for repository-aware code context
327
+ - **Context Mode** as an optional local integration
328
+ - local plugins with validation, fingerprints, namespaced tools, and isolation controls
324
329
 
325
- ## Capability Router & Context Efficiency
330
+ Each Remote Access MCP instance can keep its Codebase Memory runtime/data/cache identity isolated from other applications on the same machine.
326
331
 
327
- Phase 2 adds a capability catalog and discovery layer for agent clients:
328
- `capability_discover` returns only capabilities authorized for the current
329
- token and includes context-cost and latency hints. `capability_batch` runs up
330
- to eight independent read-only calls in parallel and rejects mutating actions.
332
+ ## CLI & TUI
331
333
 
332
- For tokens with explicit scopes, `RAMCP_TOOL_EXPOSURE=scoped` can also reduce
333
- `tools/list` itself to the authorized tool set. The default remains `all` for
334
- backward compatibility. In the built-in benchmark, a scoped token exposed
335
- 14 tools instead of 77 and reduced the serialized `tools/list` response by
336
- 80.3% (30,802 → 6,054 bytes).
334
+ The command line remains script-friendly while the interactive terminal UI provides a guided operator experience.
337
335
 
338
- ## Task / Workflow / Agent Engine
336
+ ```bash
337
+ ramcp # interactive TUI in a real terminal
338
+ ramcp doctor # diagnose the environment
339
+ ramcp status # runtime/service summary
340
+ ramcp service status # service state
341
+ ramcp service logs -f # follow logs
342
+ ramcp tunnel # public connection
343
+ ramcp url # current connector URL
344
+ ramcp token list # token fingerprints
345
+ ramcp audit --verify # verify audit hash chain
346
+ ```
339
347
 
340
- Phase 3 adds durable orchestration through the `task` tool. A task contains a
341
- validated action graph and can run independent actions in parallel while
342
- respecting dependencies, retries, per-action timeouts, verification hooks,
343
- dry-run mode, and compensation rollback. `supervised` tasks pause before
344
- mutating actions and resume through `task_approve`; interrupted/failed tasks
345
- can be resumed with `task_resume` because task state is persisted under RAMCP's
346
- own data directory and isolated by token.
348
+ The TUI is an operator interface, not a general server-control center. It focuses on configuring, starting, connecting, securing, diagnosing, and operating Remote Access MCP itself.
347
349
 
348
- Specialized profiles are available through `agent_profiles` and optional action
349
- assignment: `explorer`, `planner`, `implementer`, `tester`, `reviewer`,
350
- `security`, and `deployer`. Profiles constrain capability scopes and autonomy;
351
- they are deterministic execution roles, not hidden model instances. The
352
- existing `task_status` tool remains backward compatible with plan tracking and
353
- also reports workflow tasks.
350
+ ## Core capabilities
354
351
 
355
- ## Developer Intelligence
352
+ Remote Access MCP includes a broad operational toolkit covering:
356
353
 
357
- Phase 4 adds a compact developer-intelligence layer without replacing the existing policy core:
354
+ | Area | Examples |
355
+ |---|---|
356
+ | Filesystem | list, read, write, edit, delete, search, upload/download |
357
+ | Shell | controlled commands, process listing, process termination |
358
+ | System | system info, disk usage, network interfaces |
359
+ | HTTP | requests, port checks, web fetching with SSRF guards |
360
+ | Git | validated repository operations |
361
+ | Databases | SQLite, MySQL, PostgreSQL, Redis |
362
+ | Logs | files and journal/service logs |
363
+ | Services | status and controlled actions |
364
+ | Packages | inspect/install/remove with protected system packages |
365
+ | Planning | task plans, snapshots, rollback |
366
+ | Scheduling | persistent bounded scheduled tasks |
367
+ | Automation | event-driven rules and webhooks |
368
+ | Browser | optional browser open/extract/screenshot capabilities |
369
+ | Infrastructure | Docker/Kubernetes/Cloudflare diagnostics where the local CLI is available |
370
+ | Security | secret scanning, local port scanning, audit verification |
358
371
 
359
- - `project_profile` / `project_profile_list` / `project_profile_set` keep per-token workspace knowledge under RAMCP's own data directory.
360
- - `impact_analysis` builds a lightweight reverse dependency graph for changed source files.
361
- - `git_intelligence` summarizes repository state, history, diff statistics, branches, and remotes without permitting arbitrary Git verbs.
362
- - `github_repo`, `github_issues`, and `github_pull_request` provide read-only GitHub intelligence when `GITHUB_TOKEN` or `GH_TOKEN` is configured.
363
- - `sentry_projects`, `sentry_issues`, and `sentry_issue` provide read-only Sentry intelligence when `SENTRY_AUTH_TOKEN` is configured.
364
- - `developer_context_status` reports the Codebase Memory isolation contract, Context7 proxy, and Context Mode's local/client-side role.
372
+ The exact built-in tool surface can evolve between releases; use the installed version's `doctor`, documentation, and MCP tool list as the source of truth.
365
373
 
366
- GitHub and Sentry credentials are read only from environment variables and are never returned by these tools. Dynamic Context7 and Codebase Memory tools can be exposed to scoped tokens only through the explicit `integrations` scope.
374
+ ## Requirements
367
375
 
368
- ## Optional MCP integrations
376
+ - Node.js **18+** for the core gateway
377
+ - Linux, macOS, or Windows
378
+ - An MCP-compatible client for agent interaction
379
+ - Optional system utilities depending on the capabilities you want to use
369
380
 
370
- Remote Access MCP can expose selected developer-context MCPs as namespaced tools:
381
+ No Python runtime and no Docker runtime are required for the core gateway.
371
382
 
372
- - **Context7** — proxied into the gateway as namespaced tools such as `context7_resolve-library-id` and `context7_query-docs`. The MIT-licensed `@upstash/context7-mcp` package is bundled as a normal dependency. A `CONTEXT7_API_KEY` environment variable can be supplied for higher limits/private repositories.
373
- - **Codebase Memory** — the MIT-licensed `codebase-memory-mcp` package is integrated as namespaced `codebase_memory_*` tools when its optional package is available. Set `RAMCP_ENABLE_CODEBASE_MEMORY=0` to disable it. Each Remote Access MCP instance uses a dedicated Codebase Memory runtime, home, cache, data directory, runtime directory, and service identity; it never reuses another service's Codebase Memory state. Set `RAMCP_CODEBASE_ROOT` to the repository this gateway instance should expose; `index_repository` is additionally restricted to that root.
374
- - **Context Mode** — shipped as an optional local dependency only. It is a client/plugin-side context optimization layer and is **not proxied as a hosted service** because its Elastic License 2.0 prohibits providing the software as a hosted or managed service.
383
+ ## Open source
375
384
 
376
- Integrations are loaded before the MCP transport connects, so the initial `tools/list` includes them when the upstream MCP is available. If an optional integration cannot start, the core Remote Access MCP remains available and the integration is omitted with a diagnostic message.
385
+ Remote Access MCP is MIT licensed and intended to be useful as infrastructure for developers, self-hosters, AI-agent builders, and automation projects.
377
386
 
378
- ### Context Mode local setup
387
+ ```bash
388
+ git clone https://github.com/AmirAliManzar/remote-access-mcp.git
389
+ cd remote-access-mcp
390
+ npm install
391
+ npm test
392
+ npm run build
393
+ ```
379
394
 
380
- The `context-mode` package is intentionally kept as an optional dependency. Install Remote Access MCP locally, then configure the detected coding agent to run the local `context-mode` executable according to the upstream Context Mode documentation. Do not expose its MCP server through a Remote Access MCP HTTP endpoint.
395
+ Contributions, bug reports, security reports, ideas, and real-world agent workflows are welcome.
381
396
 
382
- ### Tunnel providers (4.1)
397
+ ## Documentation
383
398
 
384
- `ramcp tunnel` uses Cloudflare Quick Tunnel by default. You can select a provider explicitly or let RAMCP fall back in order:
399
+ - [Persian README](README.fa.md)
400
+ - [Roadmap](ROADMAP.md)
401
+ - [Security](SECURITY.md)
402
+ - [Changelog](CHANGELOG.md)
403
+ - [Contributing](CONTRIBUTING.md)
385
404
 
386
- ```bash
387
- ramcp tunnel --provider cloudflare
388
- ramcp tunnel --provider pinggy
389
- ramcp tunnel --provider localhostrun
390
- ramcp tunnel --provider auto
391
- ```
405
+ ## License
392
406
 
393
- `auto` tries providers sequentially and keeps only the first successful tunnel alive. Provider support is intentionally ephemeral: it does not alter `public_host` or the existing production endpoint. Quick Tunnel and other free tunnel services are best-effort and subject to their own availability, limits, and terms.
407
+ MIT © Amir Ali Manzar