machine-bridge-mcp 0.3.3 → 0.4.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/CHANGELOG.md +61 -0
- package/README.md +158 -171
- package/SECURITY.md +92 -40
- package/docs/ARCHITECTURE.md +126 -59
- package/docs/CLIENTS.md +125 -0
- package/docs/OPERATIONS.md +83 -0
- package/docs/RELEASING.md +62 -0
- package/docs/TESTING.md +51 -0
- package/package.json +18 -8
- package/src/local/cli.mjs +152 -51
- package/src/local/daemon.mjs +620 -306
- package/src/local/patch.mjs +140 -0
- package/src/local/process-sessions.mjs +352 -0
- package/src/local/service.mjs +5 -16
- package/src/local/shell.mjs +22 -5
- package/src/local/state.mjs +1 -1
- package/src/local/stdio.mjs +194 -0
- package/src/local/tools.mjs +96 -0
- package/src/shared/tool-catalog.json +638 -0
- package/src/worker/index.ts +151 -162
- package/tsconfig.json +4 -2
- package/src/local/self-test.mjs +0 -227
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,65 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.2 - 2026-07-10
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- Canonicalize the configured workspace and requested targets through the same asynchronous `realpath` path on Windows, while retaining a native synchronous initial value. This prevents Windows short-path/long-path aliases for the same temporary directory from being misclassified as a workspace escape.
|
|
8
|
+
- Keep workspace confinement unchanged: only the representation comparison changed, and targets outside the canonical workspace remain rejected in restricted profiles.
|
|
9
|
+
|
|
10
|
+
### Verification
|
|
11
|
+
|
|
12
|
+
- Preserve the existing cross-platform path-boundary regression, which exposed the issue on the Windows GitHub Actions runner while Linux and macOS passed.
|
|
13
|
+
- Make the minimal-environment shell regression use a cross-platform Node command instead of POSIX parameter-expansion syntax under PowerShell.
|
|
14
|
+
- Convert test entry-point file URLs with `fileURLToPath()` so Windows does not interpret `/D:/...` URL paths as `C:\D:\...` filesystem paths.
|
|
15
|
+
- Launch Wrangler's JavaScript entry point through the active Node executable in integration tests instead of directly spawning the Windows `.cmd` shim.
|
|
16
|
+
|
|
17
|
+
## 0.4.1 - 2026-07-10
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
|
|
21
|
+
- Make `full` the default policy for newly selected workspaces and generated client configurations, prioritizing immediate usability. The default now enables all tools, unrestricted direct filesystem paths, absolute path output, shell execution, process sessions, and the complete parent environment; existing saved workspace policies remain unchanged.
|
|
22
|
+
- Reframe stdio as an optional local transport rather than a model provider or a replacement for native Claude, Cursor, Codex, or ChatGPT Desktop tooling. Expand client documentation to distinguish the MCP host/model from the Machine Bridge tool server and explain when stdio is redundant or useful.
|
|
23
|
+
- Activate cross-platform GitHub Actions checks on Linux, macOS, and Windows, update official actions to the current major releases, disable checkout credential persistence, and retain production dependency/package auditing.
|
|
24
|
+
|
|
25
|
+
### Tests and documentation
|
|
26
|
+
|
|
27
|
+
- Add regression coverage for the maximum-permission default and for `client-config` emitting `full` when no profile is supplied.
|
|
28
|
+
- Update architecture, operations, security, and client guidance for profile-dependent path display, filesystem scope, and environment inheritance.
|
|
29
|
+
|
|
30
|
+
## 0.4.0 - 2026-07-10
|
|
31
|
+
|
|
32
|
+
### Architecture and compatibility
|
|
33
|
+
|
|
34
|
+
- Refactor the project into one transport-independent local runtime shared by the existing OAuth-protected Cloudflare relay and a new local MCP stdio server.
|
|
35
|
+
- Update MCP negotiation to `2025-11-25` while retaining compatibility with `2025-06-18` and `2025-03-26`; validate protocol-version headers and implement cancellation in both transports.
|
|
36
|
+
- Add ready-to-paste stdio configuration generation for Claude Desktop, Cursor, Codex CLI, and generic MCP clients.
|
|
37
|
+
- Replace duplicated Worker/runtime tool declarations with one schema-and-annotation catalog, tested for drift and policy consistency.
|
|
38
|
+
|
|
39
|
+
### Security and privacy
|
|
40
|
+
|
|
41
|
+
- Make the least-privilege `review` profile the default for newly selected workspaces; preserve stored pre-0.4 permissions during upgrade.
|
|
42
|
+
- Add explicit `review`, `edit`, `agent`, and `full` profiles plus `off`, direct-argv, and shell execution modes.
|
|
43
|
+
- Return workspace-relative paths by default, redact canonical/platform-alias paths from tool errors, omit Git author email unless requested, and reduce operational failures to coarse error classes.
|
|
44
|
+
- Replace the previous minimal environment with isolated HOME, temp, and cache directories; retain full parent environment only through explicit opt-in.
|
|
45
|
+
- Reject duplicate in-flight JSON-RPC IDs, canonical patch-path collisions, stale edits, unsupported image signatures, oversized session data, and ambiguous patch context.
|
|
46
|
+
- Make create-only writes atomic against concurrent destination creation and strengthen multi-file patch staging, revalidation, rollback, and mutation serialization.
|
|
47
|
+
|
|
48
|
+
### Tools and runtime
|
|
49
|
+
|
|
50
|
+
- Add bounded line-range reads, native MCP raster-image results, exact text editing, and structured multi-file add/update/move/delete patches.
|
|
51
|
+
- Add staged diffs, structured Git log, bounded Git show, and privacy-aware author metadata.
|
|
52
|
+
- Add direct argv execution and bounded interactive process sessions with retained offsets, stdin, output/exit waits, cancellation, tree termination, and disconnect cleanup.
|
|
53
|
+
- Return structured tool content alongside text compatibility output and expose tool annotations for client planning.
|
|
54
|
+
|
|
55
|
+
### Reliability, testing, and operations
|
|
56
|
+
|
|
57
|
+
- Add live stdio integration coverage for initialization, tool discovery, structured/image content, edits, patches, direct execution, sessions, cancellation, and post-cancellation health.
|
|
58
|
+
- Expand Worker integration coverage for latest protocol negotiation, disconnected tool advertisement, rich content, exact daemon tool sets, and remote cancellation.
|
|
59
|
+
- Add catalog, policy-profile, canonical-collision, no-partial-patch, Git privacy, path-redaction, isolated-environment, and session tests.
|
|
60
|
+
- Add a Linux/macOS/Windows GitHub Actions template, Node 22/24 coverage, package/audit checks, and Dependabot configuration.
|
|
61
|
+
- Rewrite architecture, security, client, operations, and testing documentation around explicit trust boundaries and non-goals.
|
|
62
|
+
|
|
3
63
|
## 0.3.3 - 2026-07-10
|
|
4
64
|
|
|
5
65
|
### Security
|
|
@@ -9,6 +69,7 @@
|
|
|
9
69
|
### Changed
|
|
10
70
|
|
|
11
71
|
- Exclude the development-only Worker integration test from the published npm package while retaining it in the repository and CI.
|
|
72
|
+
- Add a fail-closed release command that synchronizes `main`, the version tag, the GitHub Release, and its npm tarball; block `npm publish` when those artifacts do not match.
|
|
12
73
|
|
|
13
74
|
## 0.3.2 - 2026-07-10
|
|
14
75
|
|
package/README.md
CHANGED
|
@@ -1,265 +1,252 @@
|
|
|
1
1
|
# machine-bridge-mcp
|
|
2
2
|
|
|
3
|
-
`machine-bridge-mcp` exposes a selected local workspace to
|
|
3
|
+
`machine-bridge-mcp` exposes a selected local workspace to MCP clients through one shared, policy-controlled runtime.
|
|
4
|
+
|
|
5
|
+
It supports two transports:
|
|
4
6
|
|
|
5
7
|
```text
|
|
6
|
-
Remote
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
Remote clients such as ChatGPT
|
|
9
|
+
HTTPS + OAuth 2.1 / PKCE
|
|
10
|
+
|
|
|
11
|
+
Cloudflare Worker + Durable Object
|
|
12
|
+
^
|
|
13
|
+
| outbound authenticated WebSocket
|
|
14
|
+
|
|
|
15
|
+
local runtime
|
|
16
|
+
|
|
17
|
+
Local clients such as Claude Desktop, Cursor, and Codex CLI
|
|
18
|
+
|
|
|
19
|
+
stdio
|
|
20
|
+
|
|
|
21
|
+
local runtime
|
|
11
22
|
```
|
|
12
23
|
|
|
13
|
-
|
|
24
|
+
The remote Worker authenticates and relays calls. It cannot directly read local files or start local processes. File, Git, image, patch, and process operations execute in the local runtime.
|
|
14
25
|
|
|
15
|
-
##
|
|
26
|
+
## Default behavior and policy profiles
|
|
16
27
|
|
|
17
|
-
|
|
28
|
+
A newly selected workspace starts with the maximum-permission `full` profile for low-friction operation:
|
|
18
29
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
30
|
+
- all read, write, edit, patch, image, Git, direct-process, process-session, and shell tools are available;
|
|
31
|
+
- direct filesystem tools may use paths outside the selected workspace;
|
|
32
|
+
- tool results may return absolute paths;
|
|
33
|
+
- child processes inherit the complete parent environment.
|
|
23
34
|
|
|
24
|
-
|
|
35
|
+
Existing workspace state keeps its saved policy during upgrade. Use `--profile full` to explicitly move an older workspace to the new maximum-permission behavior.
|
|
25
36
|
|
|
26
|
-
|
|
27
|
-
|
|
37
|
+
| Profile | File edits | Direct argv processes | Shell commands | Filesystem scope | Process environment |
|
|
38
|
+
|---|---:|---:|---:|---|---|
|
|
39
|
+
| `full` | Yes | Yes | Yes | Unrestricted | Full parent environment |
|
|
40
|
+
| `agent` | Yes | Yes | No | Selected workspace | Isolated environment |
|
|
41
|
+
| `edit` | Yes | No | No | Selected workspace | Isolated environment |
|
|
42
|
+
| `review` | No | No | No | Selected workspace | Isolated environment |
|
|
43
|
+
|
|
44
|
+
This default prioritizes usability, not least privilege. `run_process` and process sessions avoid command-shell parsing, but they are **not an operating-system sandbox**. `exec_command` additionally permits shell syntax and expansion. Use `--profile review`, `edit`, or `agent`, or use a container, VM, or dedicated low-privilege OS account when the client, repository, or instructions are not fully trusted.
|
|
45
|
+
|
|
46
|
+
## Install
|
|
47
|
+
|
|
48
|
+
Node.js 22 or newer is required.
|
|
49
|
+
|
|
50
|
+
```sh
|
|
51
|
+
npm install -g machine-bridge-mcp@latest
|
|
28
52
|
```
|
|
29
53
|
|
|
30
54
|
From a source checkout:
|
|
31
55
|
|
|
32
|
-
```
|
|
56
|
+
```sh
|
|
33
57
|
npm install
|
|
34
|
-
./mbm
|
|
35
|
-
.\mbm.cmd
|
|
58
|
+
./mbm # macOS/Linux
|
|
59
|
+
.\mbm.cmd # Windows cmd
|
|
36
60
|
```
|
|
37
61
|
|
|
38
|
-
|
|
62
|
+
## Remote MCP for ChatGPT
|
|
39
63
|
|
|
40
|
-
|
|
41
|
-
2. Generates an MCP connection password, daemon secret, and OAuth token version.
|
|
42
|
-
3. Authenticates Wrangler if required.
|
|
43
|
-
4. Deploys a per-workspace Worker.
|
|
44
|
-
5. Installs a login autostart entry unless `--no-autostart` is used.
|
|
45
|
-
6. Starts the outbound local daemon.
|
|
46
|
-
7. Prints the Remote MCP URL and connection password.
|
|
64
|
+
Start the bridge from the project directory or select a workspace explicitly:
|
|
47
65
|
|
|
48
|
-
|
|
66
|
+
```sh
|
|
67
|
+
machine-mcp --workspace /path/to/project
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
On first remote start, the CLI:
|
|
49
71
|
|
|
50
|
-
|
|
72
|
+
1. canonicalizes and remembers the workspace;
|
|
73
|
+
2. creates independent credentials and state for that workspace;
|
|
74
|
+
3. signs in to Cloudflare Wrangler when needed;
|
|
75
|
+
4. deploys a per-workspace Worker;
|
|
76
|
+
5. installs a platform-native login service unless `--no-autostart` is used;
|
|
77
|
+
6. starts an outbound-only daemon connection;
|
|
78
|
+
7. prints the Remote MCP URL and connection password.
|
|
51
79
|
|
|
52
|
-
Use the values
|
|
80
|
+
Use the printed values in the MCP client:
|
|
53
81
|
|
|
54
82
|
```text
|
|
55
83
|
MCP Server URL: https://<worker>.<account>.workers.dev/mcp
|
|
56
84
|
MCP connection password: mcp_password_...
|
|
57
85
|
```
|
|
58
86
|
|
|
59
|
-
The
|
|
60
|
-
|
|
61
|
-
The former experimental local OpenAI-compatible `/v1` API has been removed. Use the Remote MCP endpoint directly.
|
|
62
|
-
|
|
63
|
-
## Security defaults
|
|
64
|
-
|
|
65
|
-
Version 0.3.0 changes the default filesystem boundary:
|
|
87
|
+
The remote authorization flow uses an authorization code, PKCE S256, exact redirect/resource binding, expiring access tokens stored as hashes, and a token-version value for bulk revocation.
|
|
66
88
|
|
|
67
|
-
|
|
68
|
-
- Reads, writes, directory traversal, searches, and Git operations are confined to that workspace by default.
|
|
69
|
-
- Symbolic links cannot be used to escape the workspace boundary.
|
|
70
|
-
- `write_file` and `exec_command` remain enabled by default.
|
|
71
|
-
- Shell commands receive a minimal environment by default.
|
|
72
|
-
- `write_file` is limited to 5 MiB, writes atomically, and refuses to overwrite symbolic links.
|
|
73
|
-
- Files that look sensitive, including `.env` and key files, are readable when they are inside the selected workspace. The bridge does not infer sensitivity from filenames.
|
|
89
|
+
## Optional local stdio MCP
|
|
74
90
|
|
|
75
|
-
|
|
91
|
+
stdio is a local transport, not a model provider. Claude Desktop, Cursor, Codex CLI, ChatGPT Desktop, or another MCP host supplies its own model/session and launches `machine-bridge-mcp` as a subprocess. The MCP server only exposes tools and returns their results; it does not borrow the model running in ChatGPT web.
|
|
76
92
|
|
|
77
|
-
|
|
78
|
-
machine-mcp --no-write --no-exec
|
|
79
|
-
```
|
|
93
|
+
Many coding clients already have strong native filesystem and terminal tools, so configuring this stdio server is optional. It is useful when you want the same Machine Bridge tool schemas, patch behavior, process sessions, policy profiles, and logs across several clients, or when you want local access without deploying Cloudflare. If the client's built-in tools already meet your needs, there is no reason to add this server.
|
|
80
94
|
|
|
81
|
-
|
|
95
|
+
Generate ready-to-paste configuration:
|
|
82
96
|
|
|
83
|
-
```
|
|
84
|
-
machine-mcp --
|
|
97
|
+
```sh
|
|
98
|
+
machine-mcp client-config --client all --workspace /path/to/project
|
|
85
99
|
```
|
|
86
100
|
|
|
87
|
-
|
|
101
|
+
Or run stdio directly:
|
|
88
102
|
|
|
89
|
-
```
|
|
90
|
-
machine-mcp --
|
|
103
|
+
```sh
|
|
104
|
+
machine-mcp stdio --workspace /path/to/project
|
|
91
105
|
```
|
|
92
106
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
## Commands
|
|
107
|
+
The stdio server writes only JSON-RPC messages to stdout and operational logs to stderr. See [docs/CLIENTS.md](docs/CLIENTS.md) for the host/model distinction and transport trade-offs.
|
|
96
108
|
|
|
97
|
-
|
|
98
|
-
machine-mcp [start options]
|
|
99
|
-
machine-mcp workspace show
|
|
100
|
-
machine-mcp workspace set [PATH]
|
|
101
|
-
machine-mcp service status|install|start|stop|uninstall
|
|
102
|
-
machine-mcp status
|
|
103
|
-
machine-mcp doctor
|
|
104
|
-
machine-mcp rotate-secrets
|
|
105
|
-
machine-mcp uninstall [--keep-worker] [--yes]
|
|
106
|
-
```
|
|
109
|
+
## Policy controls
|
|
107
110
|
|
|
108
|
-
|
|
111
|
+
The default is `full`. Narrow or customize it with explicit flags:
|
|
109
112
|
|
|
110
113
|
```text
|
|
111
|
-
--
|
|
112
|
-
--
|
|
113
|
-
--force-worker
|
|
114
|
-
--rotate-secrets
|
|
115
|
-
--daemon-only
|
|
116
|
-
--no-autostart
|
|
117
|
-
--no-print-credentials
|
|
118
|
-
--print-mcp-credentials
|
|
114
|
+
--profile full|agent|edit|review
|
|
115
|
+
--exec-mode off|direct|shell
|
|
119
116
|
--no-write
|
|
120
117
|
--no-exec
|
|
121
118
|
--full-env
|
|
122
119
|
--unrestricted-paths
|
|
123
|
-
--
|
|
124
|
-
--json
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
Unknown, duplicate, malformed, and command-inapplicable options are rejected. Boolean options do not consume a following positional workspace path; use `--option=false` when an explicit false value is needed.
|
|
128
|
-
|
|
129
|
-
## Workspace selection
|
|
130
|
-
|
|
131
|
-
```zsh
|
|
132
|
-
machine-mcp workspace set
|
|
133
|
-
machine-mcp workspace set /path/to/project
|
|
134
|
-
machine-mcp workspace show
|
|
135
|
-
machine-mcp workspace reset
|
|
120
|
+
--absolute-paths
|
|
136
121
|
```
|
|
137
122
|
|
|
138
|
-
|
|
123
|
+
Important distinctions:
|
|
139
124
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
-
|
|
145
|
-
- Linux: `systemd --user`, with best-effort user lingering
|
|
146
|
-
- Windows: Scheduled Task at logon
|
|
147
|
-
|
|
148
|
-
```zsh
|
|
149
|
-
machine-mcp service status
|
|
150
|
-
machine-mcp service install
|
|
151
|
-
machine-mcp service start
|
|
152
|
-
machine-mcp service stop
|
|
153
|
-
machine-mcp service uninstall
|
|
154
|
-
```
|
|
125
|
+
- The default `full` profile already enables unrestricted paths, absolute path output, and the complete parent environment.
|
|
126
|
+
- `--unrestricted-paths=false`, `--absolute-paths=false`, and `--full-env=false` can narrow those individual settings.
|
|
127
|
+
- `--absolute-paths` changes returned path metadata; it does not independently grant additional access.
|
|
128
|
+
- In isolated-environment profiles, commands receive private HOME, temp, and cache directories plus a small set of platform variables.
|
|
129
|
+
- Files with sensitive-looking names are not automatically blocked inside the workspace. A workspace `.env` remains readable when read tools are enabled.
|
|
155
130
|
|
|
156
|
-
|
|
131
|
+
## Tools
|
|
157
132
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
```zsh
|
|
161
|
-
machine-mcp rotate-secrets
|
|
162
|
-
machine-mcp
|
|
163
|
-
```
|
|
133
|
+
The exact `tools/list` response reflects the active local policy. Definitions come from one shared catalog used by both Worker and stdio transports.
|
|
164
134
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
## MCP tools
|
|
135
|
+
### Workspace and content
|
|
168
136
|
|
|
169
137
|
- `server_info`
|
|
170
138
|
- `project_overview`
|
|
171
139
|
- `list_roots`
|
|
172
140
|
- `list_dir`
|
|
173
141
|
- `list_files`
|
|
174
|
-
- `read_file`
|
|
175
|
-
- `
|
|
142
|
+
- `read_file` — whole UTF-8 files or bounded line ranges
|
|
143
|
+
- `view_image` — bounded PNG, JPEG, GIF, or WebP as native MCP image content
|
|
176
144
|
- `search_text`
|
|
177
|
-
- `git_status`
|
|
178
|
-
- `git_diff`
|
|
179
|
-
- `exec_command`
|
|
180
145
|
|
|
181
|
-
|
|
146
|
+
### Mutation
|
|
182
147
|
|
|
183
|
-
|
|
148
|
+
- `write_file` — atomic whole-file write with create-only and SHA-256 checks
|
|
149
|
+
- `edit_file` — exact text replacement with ambiguity rejection
|
|
150
|
+
- `apply_patch` — bounded multi-file add/update/move/delete transaction with rollback
|
|
184
151
|
|
|
185
|
-
|
|
152
|
+
### Git
|
|
186
153
|
|
|
187
|
-
-
|
|
188
|
-
-
|
|
189
|
-
-
|
|
154
|
+
- `git_status`
|
|
155
|
+
- `git_diff` — working tree or staged
|
|
156
|
+
- `git_log` — structured commits; author email omitted unless explicitly requested
|
|
157
|
+
- `git_show`
|
|
190
158
|
|
|
191
|
-
|
|
159
|
+
Repository-configured external diff, text conversion, and filesystem-monitor helpers are disabled for bridge Git inspection.
|
|
192
160
|
|
|
193
|
-
|
|
161
|
+
### Processes
|
|
194
162
|
|
|
195
|
-
|
|
163
|
+
- `run_process` — one-shot argv execution without a shell
|
|
164
|
+
- `start_process`
|
|
165
|
+
- `read_process`
|
|
166
|
+
- `write_process`
|
|
167
|
+
- `kill_process`
|
|
168
|
+
- `exec_command` — shell execution, available only in `shell` mode
|
|
196
169
|
|
|
197
|
-
|
|
170
|
+
Process sessions retain bounded stdout/stderr, support offsets and short waits, accept stdin, and are killed when the daemon connection is lost or replaced. They are pipe-based and do not emulate a terminal/PTY.
|
|
198
171
|
|
|
199
|
-
|
|
172
|
+
## Path and write behavior
|
|
200
173
|
|
|
201
|
-
|
|
202
|
-
- Hashed access-token storage and token-version revocation.
|
|
203
|
-
- Exact resource, client, and redirect URI binding.
|
|
204
|
-
- Bounded registration metadata, clients, authorization codes, tokens, and failed-login records.
|
|
205
|
-
- Per-source dynamic-client registration limits and password-failure throttling.
|
|
206
|
-
- A consent page that displays the validated client and redirect URI.
|
|
207
|
-
- Request-body and concurrent daemon-call limits.
|
|
208
|
-
- Same-origin browser access by default, exact configured-origin CORS/preflight support, and rejection of unlisted cross-origin requests.
|
|
209
|
-
- `no-store`, content-type protection, CSP, frame denial, and referrer suppression on authorization responses.
|
|
210
|
-
- Minimal public health output; live daemon/workspace details require an authenticated MCP call.
|
|
174
|
+
When workspace confinement is enabled (`agent`, `edit`, `review`, or an explicit override), existing paths are resolved with `realpath` and must remain inside the canonical workspace. New write paths validate the nearest existing ancestor, preventing missing-path writes through escaping symbolic-link directories. The default `full` profile permits direct filesystem paths outside the workspace.
|
|
211
175
|
|
|
212
|
-
|
|
176
|
+
Writes use same-directory temporary files and atomic commit. Create-only writes use an atomic hard-link commit so a concurrent file cannot be silently overwritten. Patch operations are prevalidated, serialized, staged, rechecked, committed with backups, and rolled back on failure.
|
|
213
177
|
|
|
214
|
-
|
|
178
|
+
The default `full` profile returns absolute paths. The `agent`, `edit`, and `review` profiles return workspace-relative paths to reduce unnecessary disclosure of usernames and local directory layouts.
|
|
215
179
|
|
|
216
|
-
|
|
180
|
+
## Commands
|
|
217
181
|
|
|
218
|
-
```
|
|
219
|
-
machine-mcp
|
|
182
|
+
```text
|
|
183
|
+
machine-mcp [start options]
|
|
184
|
+
machine-mcp stdio [options]
|
|
185
|
+
machine-mcp client-config [all|claude|cursor|codex|generic]
|
|
186
|
+
machine-mcp workspace show|set|reset
|
|
187
|
+
machine-mcp service status|install|start|stop|uninstall
|
|
188
|
+
machine-mcp status
|
|
189
|
+
machine-mcp doctor
|
|
190
|
+
machine-mcp rotate-secrets
|
|
191
|
+
machine-mcp uninstall [--keep-worker] [--yes]
|
|
220
192
|
```
|
|
221
193
|
|
|
222
|
-
|
|
194
|
+
Each canonical workspace has an independent profile, Worker name, credential set, state file, startup lock, and daemon lock.
|
|
223
195
|
|
|
224
|
-
|
|
225
|
-
machine-mcp uninstall --yes
|
|
226
|
-
```
|
|
196
|
+
## Autostart
|
|
227
197
|
|
|
228
|
-
|
|
198
|
+
Remote mode supports:
|
|
229
199
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
200
|
+
- macOS user LaunchAgent;
|
|
201
|
+
- Linux `systemd --user`, with best-effort lingering;
|
|
202
|
+
- Windows Scheduled Task at logon.
|
|
233
203
|
|
|
234
|
-
|
|
204
|
+
The service definition contains neither credentials nor a duplicate policy. It loads the selected policy from owner-only local state and uses the documented `full` default if policy state is absent. Service logs are owner-only where supported and trimmed before daemon startup.
|
|
235
205
|
|
|
236
|
-
|
|
237
|
-
|
|
206
|
+
## Secret rotation
|
|
207
|
+
|
|
208
|
+
```sh
|
|
209
|
+
machine-mcp rotate-secrets --no-print-credentials
|
|
210
|
+
machine-mcp
|
|
238
211
|
```
|
|
239
212
|
|
|
240
|
-
|
|
213
|
+
Rotation stops the installed service, refuses to proceed while another foreground daemon owns the workspace lock, rotates the MCP password, daemon secret, and OAuth token version, and requires redeployment. Previously issued access tokens then fail validation.
|
|
214
|
+
|
|
215
|
+
## State and observability
|
|
241
216
|
|
|
242
|
-
|
|
217
|
+
Default state roots:
|
|
218
|
+
|
|
219
|
+
- macOS/Linux: `~/.local/state/machine-bridge-mcp`
|
|
220
|
+
- Linux with `XDG_STATE_HOME`: `$XDG_STATE_HOME/machine-bridge-mcp`
|
|
221
|
+
- Windows: `%APPDATA%\machine-bridge-mcp`
|
|
243
222
|
|
|
244
|
-
|
|
223
|
+
State/config writes use owner-only temporary files, flushes, and atomic rename. Malformed state is retained as a bounded corrupt backup before reconstruction. Uninstall validates markers, canonical paths, active locks, workspace/source exclusions, and known contents before recursive deletion.
|
|
245
224
|
|
|
246
|
-
|
|
247
|
-
- Pending calls are bound to the socket that received them, so a stale socket cannot complete or cancel calls on the replacement connection; active child processes are terminated when that connection is lost or replaced.
|
|
248
|
-
- The daemon reconnects after transient Worker/network failures using bounded exponential backoff with jitter, and terminates active child processes when the active relay socket closes.
|
|
249
|
-
- Tool calls and Wrangler subprocesses have bounded execution time and output; timed-out commands terminate their process tree where the platform permits.
|
|
250
|
-
- Separate per-workspace startup and daemon locks prevent overlapping deploy/rotation operations and duplicate local daemons.
|
|
251
|
-
- Uninstall stops and removes autostart first, refuses to proceed while an active startup or daemon process owns a lock, and preserves local state when Worker deletion fails so the operation can be retried.
|
|
252
|
-
- Worker health checks verify the expected package/Worker version before a deployment hash is accepted.
|
|
225
|
+
Operational logs record bounded metadata such as component, tool name, shortened call ID, duration, outcome, and error class. They do not intentionally log file contents, patch bodies, command strings, stdin, OAuth passwords, access tokens, or daemon secrets. See [docs/OPERATIONS.md](docs/OPERATIONS.md).
|
|
253
226
|
|
|
254
|
-
## Development
|
|
227
|
+
## Development and verification
|
|
255
228
|
|
|
256
|
-
```
|
|
229
|
+
```sh
|
|
257
230
|
npm ci
|
|
258
231
|
npm run check
|
|
259
232
|
npm run worker:dry-run
|
|
260
233
|
npm audit --omit=dev --audit-level=high
|
|
234
|
+
npm pack --dry-run
|
|
261
235
|
```
|
|
262
236
|
|
|
263
|
-
`npm run check`
|
|
237
|
+
`npm run check` covers generated Worker types, TypeScript, JavaScript syntax, the shared tool catalog, local path/write/process/state/log/service invariants, a live stdio MCP flow, and a live local OAuth/Worker/WebSocket/MCP flow. GitHub Actions runs the suite on Linux, macOS, and Windows with supported Node versions.
|
|
238
|
+
|
|
239
|
+
See [docs/TESTING.md](docs/TESTING.md), [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md), and [SECURITY.md](SECURITY.md).
|
|
240
|
+
|
|
241
|
+
## Uninstall
|
|
242
|
+
|
|
243
|
+
```sh
|
|
244
|
+
machine-mcp uninstall
|
|
245
|
+
npm uninstall -g machine-bridge-mcp
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
Use `--keep-worker` to retain deployed Workers while removing local state and autostart.
|
|
249
|
+
|
|
250
|
+
## License
|
|
264
251
|
|
|
265
|
-
|
|
252
|
+
MIT
|