@juexibobi/private-desktop-mcp 0.3.5 → 0.3.6
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 +3 -28
- package/bin/activity.mjs +10 -0
- package/bin/cli.mjs +5 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,15 +12,11 @@ npx.cmd --yes --prefer-online --package=@juexibobi/private-desktop-mcp@latest --
|
|
|
12
12
|
|
|
13
13
|
Each release gets its own immutable npm version. **Do not overwrite a fixed `.tgz` at a stable URL**: npm caching might start an old version.
|
|
14
14
|
|
|
15
|
-
### Terminal logging
|
|
15
|
+
### Terminal logging (v0.3.6)
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
PCC now uses **TRACE logging by default**. The normal `connect` command prints MCP call IDs, sanitized/truncated command and response previews, timings, connection details, and errors. There is no need for `--trace`.
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
```powershell
|
|
22
|
-
npx.cmd --yes --prefer-online --package=@juexibobi/private-desktop-mcp@latest -- private-desktop-mcp connect --debug
|
|
23
|
-
```
|
|
19
|
+
**Privacy:** TRACE can reveal sensitive file contents or command output. Redaction is best effort; avoid sharing or recording the terminal. Use `--debug` for detailed metadata without content previews, or `--safe` for compact logs. The former `--trace` flag remains supported for compatibility.
|
|
24
20
|
|
|
25
21
|
### Windows system proxy detection (v0.3.4)
|
|
26
22
|
|
|
@@ -72,24 +68,3 @@ Never protect the **entire Worker** with Worker-level Access: this would prevent
|
|
|
72
68
|
## Security
|
|
73
69
|
|
|
74
70
|
This tool has Windows filesystem and command-execution capabilities. Restrict Cloudflare Access to your own identity, approve only devices you control and never expose a naked HTTP MCP endpoint. See [SECURITY.md](SECURITY.md).
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
## Detailed live console (v0.3.5)
|
|
78
|
-
|
|
79
|
-
PCC now displays an expanded terminal startup banner with computer, device ID, Node version, gateway PID, local MCP URL, Cloudflare relay state and logging mode. Every incoming MCP method/tool call has a short correlation ID, safe parameter summary, MCP/HTTP outcome, duration and structured result summaries (process PID, exit code, line count and output size when available). WebSocket disconnections include close code, connection uptime, total calls and failures. A tool can fail at the MCP layer even when HTTP returns 200; this is reported as an **MCP tool error**.
|
|
80
|
-
|
|
81
|
-
Logging has three levels:
|
|
82
|
-
|
|
83
|
-
| Command option | Terminal contents | Privacy |
|
|
84
|
-
| --- | --- | --- |
|
|
85
|
-
| No option | Rich startup, call and response summaries; no raw files/commands | Default |
|
|
86
|
-
| \`--debug\` | Adds redacted request metadata, result sizes and aggregate counters | Safe diagnostic metadata |
|
|
87
|
-
| \`--trace\` | Also shows sanitized, truncated command and response previews | **Local opt-in; may expose confidential user text** |
|
|
88
|
-
|
|
89
|
-
Example for full local previews (not recommended when screen sharing or saving terminal transcripts):
|
|
90
|
-
|
|
91
|
-
\`\`\`powershell
|
|
92
|
-
npx.cmd --yes --prefer-online --package=@juexibobi/private-desktop-mcp@latest -- private-desktop-mcp connect --trace
|
|
93
|
-
\`\`\`
|
|
94
|
-
|
|
95
|
-
**Important:** \`--trace\` is best-effort redaction, not a guarantee that arbitrary secrets embedded in file contents or command results will be removed. Use normal logging or \`--debug\` for everyday use. All logs print to the local terminal and are not transmitted to third-party logging services by this feature. The underlying gateway's diagnostics remain in \`%TEMP%\private-desktop-mcp-device.log\`.
|
package/bin/activity.mjs
CHANGED
|
@@ -110,3 +110,13 @@ export function shortCallId(id){
|
|
|
110
110
|
export function formatElapsed(ms){
|
|
111
111
|
return ms>=1000?(ms/1000).toFixed(2)+"s":ms+"ms";
|
|
112
112
|
}
|
|
113
|
+
|
|
114
|
+
/** Terminal logging defaults to TRACE unless explicitly reduced. */
|
|
115
|
+
export function loggingOptions(args=[]){
|
|
116
|
+
const flags=new Set(args);
|
|
117
|
+
const safe=flags.has("--safe");
|
|
118
|
+
const debugOnly=flags.has("--debug")&&!flags.has("--trace");
|
|
119
|
+
const trace=!safe&&!debugOnly;
|
|
120
|
+
const debug=!safe&&(debugOnly||trace);
|
|
121
|
+
return {trace,debug,mode:trace?"TRACE":debug?"DEBUG":"LIVE"};
|
|
122
|
+
}
|
package/bin/cli.mjs
CHANGED
|
@@ -9,10 +9,11 @@ import { ProxyAgent } from "undici";
|
|
|
9
9
|
import { resolveProxyForUrl } from "./proxy.mjs";
|
|
10
10
|
import { HttpsProxyAgent } from "https-proxy-agent";
|
|
11
11
|
import { logLine, sanitizeText } from "./logging.mjs";
|
|
12
|
-
import { callInfo, requestBrief, requestDebug, responseBrief, safeTraceRequest, safeTraceOutput, shortCallId, formatElapsed } from "./activity.mjs";
|
|
12
|
+
import { callInfo, requestBrief, requestDebug, responseBrief, safeTraceRequest, safeTraceOutput, shortCallId, formatElapsed, loggingOptions } from "./activity.mjs";
|
|
13
13
|
|
|
14
14
|
const root=path.dirname(path.dirname(fileURLToPath(import.meta.url)));
|
|
15
|
-
const command=process.argv.slice(2).find(a=>!a.startsWith("--"))||"connect",
|
|
15
|
+
const command=process.argv.slice(2).find(a=>!a.startsWith("--"))||"connect",relay="https://private-desktop-device-relay.ljx2043979076.workers.dev";
|
|
16
|
+
const {trace,debug}=loggingOptions(process.argv.slice(2));
|
|
16
17
|
const config=path.join(process.env.APPDATA||path.join(os.homedir(),".config"),"PrivateDesktopMCP","device.json");
|
|
17
18
|
const sleep=ms=>new Promise(resolve=>setTimeout(resolve,ms));
|
|
18
19
|
let currentProxy=null,proxyCheckedAt=0,lastProxyNotice="";
|
|
@@ -129,11 +130,11 @@ async function connect(creds){return new Promise(resolve=>{
|
|
|
129
130
|
})}
|
|
130
131
|
function stop(){if(stopping)return;stopping=true;logLine("info","Disconnecting PCC...");try{socket?.close(1000,"Manual disconnect")}catch{}stopGateway();setTimeout(()=>process.exit(0),200).unref();}
|
|
131
132
|
process.on("SIGINT",stop);process.on("SIGTERM",stop);
|
|
132
|
-
if(["help","--help","-h"].includes(command)){console.log("Private Desktop MCP: connect | status | reset [--debug | --trace]\
|
|
133
|
+
if(["help","--help","-h"].includes(command)){console.log("Private Desktop MCP: connect | status | reset [--safe | --debug | --trace]\nDefault: TRACE logs with redacted/truncated command and response previews (may contain private data).\nUse --safe for compact metadata-only logs, or --debug for detailed metadata without content previews.\nFirst connect requires approval at https://private-desktop-device-relay.ljx2043979076.workers.dev/admin/devices\nCtrl+C to disconnect. No automatic startup.");}
|
|
133
134
|
else if(command==="status"){console.log("Paired:",!!saved());try{console.log("Local HTTP:",(await fetch("http://127.0.0.1:8717/mcp",{signal:AbortSignal.timeout(2000)})).status)}catch{console.log("Local MCP offline")}}
|
|
134
135
|
else if(command==="reset"){forget();console.log("Local credentials cleared. Revoke old credentials in the admin page too.");}
|
|
135
136
|
else if(command==="connect"){
|
|
136
|
-
logLine("info","╔══════════════ PCC REMOTE v0.3.
|
|
137
|
+
logLine("info","╔══════════════ PCC REMOTE v0.3.6 ══════════════╗");
|
|
137
138
|
logLine("info","Logging: "+(trace?"TRACE":debug?"DEBUG":"LIVE")+" | Gateway: Desktop Commander MCP");
|
|
138
139
|
if(trace)logLine("warn","TRACE mode can display private user content in this terminal; do not share these logs.");
|
|
139
140
|
logLine("info","╚═══════════════════════════════════════════════╝");
|
package/package.json
CHANGED